I want to create an Ansys optiSLang project using optiSLang's python API. In the project a python node should be added and the path to a script should be used.
How can I do that?
This can be done in few simple steps/lines: 1. define a RelativeSplittedPath to the script:
RelativeSplittedPath
import stdcpp_python_export csv_path = r"c:\path\to\script.py" osl_csv_path = stdcpp_python_export.RelativeSplittedPath(csv_path, stdcpp_python_export.BasePathMode.PROJECT_RELATIVE)
PythonActor
pyactor = actors.PythonActor("Python") add_actor(pyactor)
path
pyactor.path = osl_csv_path
further information can be found at: Ansys optiSLang Python API