INTERCONNECT#

class ansys.lumerical.core.INTERCONNECT(filename=None, key=None, hide=False, serverArgs={}, remoteArgs={}, **kwargs)#

Represents an interactive session with Ansys Lumerical INTERCONNECT™.

This class provides the main interface to interact with the Lumerical product.

Parameters:
filenamestr, optional

A single string containing either a script filename or a project filename. When the parameter is a project filename, the product opens and loads the project. When the parameter is a script filename, the product evaluates the script. We recommend using the keyword arguments script and project instead of this parameter. See below for more details on keyword arguments.

keystr, optional

Deprecated parameter, do not enter values other than the default.

hidebool, optional

Shows or hides the Lumerical GUI/CAD environment on startup. When set to True, all pop-up messages that normally appear in the GUI does not appear.

serverArgsstruct, optional

Pass command line arguments (Windows/Linux) to the product during launch as a dictionary. Equivalent to adding options (Windows / Linux) behind the “solutions” executables, for example, fdtd-solutions. Each key should match the name of the command line argument (without the -). The value depends on the type of command line argument:

  • For command line arguments that is a toggle, such as -use-solve, use Booleans as values.

  • For command line arguments with argument inputs, such as platform, use strings as values. This applies to numerical arguments such as those for “threads”.

Note: Incorrect command line arguments have no effect but will not result in an error or warning.

remoteArgsstruct, optional

Pass connection information as a dictionary. Use only when using the Python API remotely on a Linux machine that is running the Interop Server. Dictionary fields are as follows:

  • hostname: a string indicating the IP address.

  • port: an integer indicating the port to connect to.

**kwargsdict, optional

Keyword arguments, see “Other Parameters”: below for options and their usage.

Attributes:
Lumerical objects don’t have user modifiable attributes.
Other Parameters:
projectstr, optional

A single string containing a project filename, including extension. The product will open this project before any scripts specified by the script keyword are run.

scriptstr, optional

A single string containing a script filename including extension, or a collection of strings that are script filenames. For collections list and tuple are preferred; dicts are not supported. These scripts run after the opening the project specified in the project keyword. If you do not specify a project, they will run in a new blank project.

Notes

In addition to the class methods below, Lumerical objects dynamically define methods that correspond to Lumerical script commands when you instantiate them.

For more information, see the Script commands as methods article in the User guide.

Methods

INTERCONNECT.close()

Calls appClose on the the object handle and destroy the session

INTERCONNECT.eval(code)

Low level script workspace method that evaluates the input string as Lumerical Scripting Language.

INTERCONNECT.getAllSelectedObjects()

Returns a list of all currently selected simulation objects.

INTERCONNECT.getObjectById(id)

Returns a simulation object by ID.

INTERCONNECT.getObjectBySelection()

Returns the currently selected simulation object, if multiple objects are selected, the first one in the list returned.

INTERCONNECT.getv(varname)

Low level script workspace method that gets a variable from the Lumerical session.

INTERCONNECT.putv(varname, value)

Low level script workspace method that puts a variable from the local Python environment into an active Lumerical session.