putv#

DEVICE.putv(varname, value)#

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

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

The name of the variable to retrieve from the Lumerical session.

valueany

The value to put into the Lumerical session. The type depends on the type of variable in Python.

See the “See also” section below for more details on supported data types and how they are handled.

Returns:
None
Raises:
LumApiError

If the method cannot retrieve the variable or the data type is unsupported.

See also

getv()

Gets a variable from the 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