Thanks for your question here on the Community Forums!
I have tested your MATLAB code on my side, and when the Zemax sample file was loaded correctly from the API, then I got a reasonable output as below:
I only got an empty output like you when the sample file was not loaded correctly from the API:
Please note that you need to define the full path together with the extension of the file, and not just the file name, in order for the LoadFile function to work correctly.
You may use the following code to load the Double Gauss file: samplesFolder = TheApplication.SamplesDir; DGfile = System.String.Concat(samplesFolder, '\Sequential\Objectives\Double Gauss 5 degree field.zos'); TheSystem.LoadFile(DGfile, false) Also, the LoadFile function returns a bool variable which indicates whether the loading process was successful or not. Please double-check that to make sure the file loading was completed successfully.
Thanks for your question here on the Community Forums!
I have tested your MATLAB code on my side, and when the Zemax sample file was loaded correctly from the API, then I got a reasonable output as below:
I only got an empty output like you when the sample file was not loaded correctly from the API:
Please note that you need to define the full path together with the extension of the file, and not just the file name, in order for the LoadFile function to work correctly.
You may use the following code to load the Double Gauss file: samplesFolder = TheApplication.SamplesDir; DGfile = System.String.Concat(samplesFolder, '\Sequential\Objectives\Double Gauss 5 degree field.zos'); TheSystem.LoadFile(DGfile, false) Also, the LoadFile function returns a bool variable which indicates whether the loading process was successful or not. Please double-check that to make sure the file loading was completed successfully.
Thanks for your question here on the Community Forums!
I have tested your MATLAB code on my side, and when the Zemax sample file was loaded correctly from the API, then I got a reasonable output as below:
I only got an empty output like you when the sample file was not loaded correctly from the API:
Please note that you need to define the full path together with the extension of the file, and not just the file name, in order for the LoadFile function to work correctly.
You may use the following code to load the Double Gauss file: samplesFolder = TheApplication.SamplesDir; DGfile = System.String.Concat(samplesFolder, '\Sequential\Objectives\Double Gauss 5 degree field.zos'); TheSystem.LoadFile(DGfile, false) Also, the LoadFile function returns a bool variable which indicates whether the loading process was successful or not. Please double-check that to make sure the file loading was completed successfully.
We use 3 different kinds of cookies. You can choose which cookies you want to accept. We need basic cookies to make this site work, therefore these are the minimum you can select. Learn more about our cookies.