RemoteUtilities Class — NXOpen Python API Reference 12.0.0 documentation

# RemoteUtilities Class

class `NXOpen.``RemoteUtilities`

  Bases: `NXOpen.TaggedObject`

  This class is primarily designed for use in a remote session, and allows client applications to access resources on a remote server.

  Note that due to security considerations, this class is independent of the main `NXOpen.Session`. The server must explicitly export a RemoteUtilities object in order to allow clients to access the methods in this class. Application writers should be aware that this class will allow clients to delete and modify files on the server.

  To obtain an instance of this class use `NXOpen.RemoteUtilities.GetRemoteUtilities()`

  New in version NX3.0.0.

# Properties

Property | Description
--- | ---
Tag | Returns the Tag for this object.

# Methods

Method | Description
--- | ---
CopyFile | Copies a file.
CreateDirectory | Creates a directory.
DeleteFile | Deletes a file.
FileExists | Tests to see that a file exists
GetEnvironmentVariable | Gets the value of an environment variable.
IsFileWritable | Returns true if a file exists, and is writable by the NX session.
RemoveDirectory | Deletes a directory.
RenameFile | Renames a file.
SetFileWritable | Sets a file’s permissions to be writable by the NX session.

# Method Detail

## CopyFile

`RemoteUtilities.``CopyFile`

  Copies a file.

  Signature `CopyFile(originalFilename, newFilename)`

  Parameters:

  - originalFilename (str) – Original filename.
  - newFilename (str) – Newly copied filename.

  New in version NX3.0.0.

  License requirements: None.

## CreateDirectory

`RemoteUtilities.``CreateDirectory`

  Creates a directory.

  Signature `CreateDirectory(dirname)`

  Parameters: | dirname (str) – Name of new directory

  New in version NX3.0.0.

  License requirements: None.

## DeleteFile

`RemoteUtilities.``DeleteFile`

  Deletes a file.

  Note that if the file does not exist, this method returns without any errors.

  Signature `DeleteFile(filename)`

  Parameters: | filename (str) – File to be deleted.

  New in version NX3.0.0.

  License requirements: None.

## FileExists

`RemoteUtilities.``FileExists`

  Tests to see that a file exists

  Signature `FileExists(testFilename)`

  Parameters: | testFilename (str) – Filename to query
  Returns: | True if the file exists
  Return type: | bool

  New in version NX3.0.0.

  License requirements: None.

## GetEnvironmentVariable

`RemoteUtilities.``GetEnvironmentVariable`

  Gets the value of an environment variable.

  Signature `GetEnvironmentVariable(variableName)`

  Parameters: | variableName (str) – The environment variable
  Returns: | The value of the variable.
  Return type: | str

  New in version NX3.0.0.

  Deprecated since version NX8.0.0: Use Session.GetEnvironmentVariable instead.

  License requirements: None.

## IsFileWritable

`RemoteUtilities.``IsFileWritable`

  Returns true if a file exists, and is writable by the NX session.

  Signature `IsFileWritable(filename)`

  Parameters: | filename (str) – File to be checked.
  Returns: | True if the file exists, and is writable
  Return type: | bool

  New in version NX3.0.0.

  License requirements: None.

## RemoveDirectory

`RemoteUtilities.``RemoveDirectory`

  Deletes a directory.

  Signature `RemoveDirectory(dirname)`

  Parameters: | dirname (str) – Name of directory to be deleted

  New in version NX3.0.0.

  License requirements: None.

## RenameFile

`RemoteUtilities.``RenameFile`

  Renames a file.

  Signature `RenameFile(oldFilename, newFilename)`

  Parameters:

  - oldFilename (str) – Old filename.
  - newFilename (str) – New filename.

  New in version NX3.0.0.

  License requirements: None.

## SetFileWritable

`RemoteUtilities.``SetFileWritable`

  Sets a file’s permissions to be writable by the NX session.

  Signature `SetFileWritable(filename, writable)`

  Parameters:

  - filename (str) – File to be checked.
  - writable (bool) – True to make the file writable, false to make it readonly

  New in version NX3.0.0.

  License requirements: None.