-
Hi, I try to convert the standard example PythonStandalone_22_seq_spot_diagram.py for batch ray tracing. I have trouble with the following statement:
best regards |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Hi! First, thank you for using ZOSPy! There are two ways to access ZOS-API constants from ZOSPy, and your method is one of them. Alternatively, and this is the preferred way, you can use |
Beta Was this translation helpful? Give feedback.
Hi! First, thank you for using ZOSPy!
There are two ways to access ZOS-API constants from ZOSPy, and your method is one of them.
zp.constants.Tools.RayTrace.OPDMode[0]
will give youZOSAPI.Tools.RayTrace.OPDMode.None
.Alternatively, and this is the preferred way, you can use
zp.constants.Tools.RayTrace.OPDMode.None_
(note the underscore at the end). ZOSPy's constants are designed to reflect the behavior of the ZOS-API Enums as much as possible, so you can just access their values as attributes, e.g.ZOSAPI.Tools.RayTrace.OPDMode.Current
. However, this is not possible withNone
, because that name has a different meaning in Python. We therefore suffixed all occurences ofNone
with an unders…