Skip to main content

Hello all,

I am new to the ZOS API, and would like to know how to get the file name once the connection has been done. I am using Python and I have tried :

 

TheApplication = TheConnection.ConnectAsExtension(0)

TheSystem = TheApplication.PrimarySystem

print(TheSystem.SystemName) 

 

but I can’t get the name of the zemax file. Any idea how get it?

Use

TheSystem.SystemFile

This returns the full file path.  If you just want the file name, you can import os and use:

file_name = os.path.basename(TheSystem.SystemFile);

 


Use

TheSystem.SystemFile

This returns the full file path.  If you just want the file name, you can import os and use:

file_name = os.path.basename(TheSystem.SystemFile);

 

Thank you Michael.


Reply