getv#

INTERCONNECT.getv(varname)#

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

The variable can be a string, real/complex numbers, matrix, cell or struct.

This method is a low level method that interacts directly with the script workspace in Lumerical. It is not recommended to use this unless a specific function needs to be achieved.

Parameters:
varnamestr

Lumerical variable name of the variable to obtain.

Returns:
any

Retrieved Python variable, the type depends on the type of variable in Lumerical.

See also

putv()

Puts a variable from the local Python environment into an active Lumerical session.

Passing data

Information on how passing non-dataset variables are handled.

Accessing simulation results

Information on how passing datasets are handled.

Examples

Putting a string from Python to Lumerical, then retrieving it and printing its type.

>>> with lumapi.FDTD(hide = True) as fdtd:
>>>     Lumerical = 'Ansys Inc'
>>>     fdtd.putv('Lum_str',Lumerical)
>>>     print(type(fdtd.getv('Lum_str')),str(fdtd.getv('Lum_str')))

Returns

>>> <class 'str'> Ansys Inc