New API Samples and Documentation


New API Samples and Documentation

Author
Message
Zemax_Kristen
Zemax_Kristen
Zemax Staff
Zemax Staff (217 reputation)

Group: Administrators / Zemax Staff
Posts: 74, Visits: 502
OpticStudio 17 includes a new API syntax help system and 25 new examples, each written in C#, C++, MATLAB, and Python. See this video for more information:


Dan Stroschine
Dan Stroschine
Forum Newbie
Forum Newbie (26 reputation)Forum Newbie (26 reputation)Forum Newbie (26 reputation)Forum Newbie (26 reputation)Forum Newbie (26 reputation)Forum Newbie (26 reputation)Forum Newbie (26 reputation)Forum Newbie (26 reputation)Forum Newbie (26 reputation)

Group: Forum Members
Posts: 8, Visits: 37
Are there plans to add a description of what each example does. Right now all I have to go on is the few words in the title.and the 100+ lines of code to sift through. There needs to be a detailed description of what example code is doing, i.e. "Creates a new field, evaluates any vignetting, creates a spot diagram, creates an MTF plot, writes MTF to an external file..." It would also be good to have a description of the main things that the example is supposed to show, i.e. creating that new field, creating an analysis window, saving the text data to a file...

Without these the usefulness of the examples is greatly diminished because digging through code just to see if it has what I need can be a huge time sink.
Zemax_Tom
Zemax_Tom
Forum Newbie
Forum Newbie (68 reputation)Forum Newbie (68 reputation)Forum Newbie (68 reputation)Forum Newbie (68 reputation)Forum Newbie (68 reputation)Forum Newbie (68 reputation)Forum Newbie (68 reputation)Forum Newbie (68 reputation)Forum Newbie (68 reputation)

Group: Administrators / Zemax Staff
Posts: 9, Visits: 144
Each example contains a short description and list of necessary inputs and outputs created. Please let us if you think these are not sufficient.



Dan Stroschine
Dan Stroschine
Forum Newbie
Forum Newbie (26 reputation)Forum Newbie (26 reputation)Forum Newbie (26 reputation)Forum Newbie (26 reputation)Forum Newbie (26 reputation)Forum Newbie (26 reputation)Forum Newbie (26 reputation)Forum Newbie (26 reputation)Forum Newbie (26 reputation)

Group: Forum Members
Posts: 8, Visits: 37
Zemax_Tom - Tuesday, August 8, 2017 11:09 AM
Each example contains a short description and list of necessary inputs and outputs created. Please let us if you think these are not sufficient.



OK, sorry. I was looking what was being shown when I had the language selected, not example root. Thanks.
Dan Stroschine
Dan Stroschine
Forum Newbie
Forum Newbie (26 reputation)Forum Newbie (26 reputation)Forum Newbie (26 reputation)Forum Newbie (26 reputation)Forum Newbie (26 reputation)Forum Newbie (26 reputation)Forum Newbie (26 reputation)Forum Newbie (26 reputation)Forum Newbie (26 reputation)

Group: Forum Members
Posts: 8, Visits: 37
When I try to run the basic standalone python application (no modifications to what is automatically created) in VS2017 Community Edition I keep getting this error: ModuleNotFoundError: No module named 'win32com'

I have Python 3.4 along with win32com in my site-packages folder and the path to it is in my PATH environment variables (Both the system and User). Is there a primer on how to setup VS to run a Python application?

Thanks,
Dan
Zemax_MichaelH
Zemax_MichaelH
Forum Newbie
Forum Newbie (40 reputation)Forum Newbie (40 reputation)Forum Newbie (40 reputation)Forum Newbie (40 reputation)Forum Newbie (40 reputation)Forum Newbie (40 reputation)Forum Newbie (40 reputation)Forum Newbie (40 reputation)Forum Newbie (40 reputation)

Group: Administrators / Zemax Staff
Posts: 23, Visits: 294
DanStro - Tuesday, August 8, 2017 2:44 PM
When I try to run the basic standalone python application (no modifications to what is automatically created) in VS2017 Community Edition I keep getting this error: ModuleNotFoundError: No module named 'win32com'

I have Python 3.4 along with win32com in my site-packages folder and the path to it is in my PATH environment variables (Both the system and User). Is there a primer on how to setup VS to run a Python application?

Thanks,
Dan

Hi Dan,

Can you run a boilerplate template via Python? You can access the pre-generated code from Programming > Python > Standalone Application.



This will generate the template that has connections to the ZOS-API and you should be able to simply run this code. If you still cannot run the pre-generated code, then the following article talks about how to get Python setup to connect with the ZOS-API:

http://www.zemax.com/os/resources/learn/knowledgebase/getting-started-with-python

Dan Stroschine
Dan Stroschine
Forum Newbie
Forum Newbie (26 reputation)Forum Newbie (26 reputation)Forum Newbie (26 reputation)Forum Newbie (26 reputation)Forum Newbie (26 reputation)Forum Newbie (26 reputation)Forum Newbie (26 reputation)Forum Newbie (26 reputation)Forum Newbie (26 reputation)

Group: Forum Members
Posts: 8, Visits: 37
Zemax_MichaelH - Wednesday, August 9, 2017 8:26 AM
DanStro - Tuesday, August 8, 2017 2:44 PM
When I try to run the basic standalone python application (no modifications to what is automatically created) in VS2017 Community Edition I keep getting this error: ModuleNotFoundError: No module named 'win32com'

I have Python 3.4 along with win32com in my site-packages folder and the path to it is in my PATH environment variables (Both the system and User). Is there a primer on how to setup VS to run a Python application?

Thanks,
Dan

Hi Dan,

Can you run a boilerplate template via Python? You can access the pre-generated code from Programming > Python > Standalone Application.



This will generate the template that has connections to the ZOS-API and you should be able to simply run this code. If you still cannot run the pre-generated code, then the following article talks about how to get Python setup to connect with the ZOS-API:

http://www.zemax.com/os/resources/learn/knowledgebase/getting-started-with-python

I can't run that template. I've uninstalled all of my versions of Python and reinstalled just 3.6, along with the correct version of PyWin. I went through the "getting started with python" page (including the troubleshooting section) and now I don't get the same error, but I still can't run the template. Here is an image of the error.


Zemax_MichaelH
Zemax_MichaelH
Forum Newbie
Forum Newbie (40 reputation)Forum Newbie (40 reputation)Forum Newbie (40 reputation)Forum Newbie (40 reputation)Forum Newbie (40 reputation)Forum Newbie (40 reputation)Forum Newbie (40 reputation)Forum Newbie (40 reputation)Forum Newbie (40 reputation)

Group: Administrators / Zemax Staff
Posts: 23, Visits: 294
DanStro - Wednesday, August 9, 2017 11:15 AM
Zemax_MichaelH - Wednesday, August 9, 2017 8:26 AM
DanStro - Tuesday, August 8, 2017 2:44 PM
When I try to run the basic standalone python application (no modifications to what is automatically created) in VS2017 Community Edition I keep getting this error: ModuleNotFoundError: No module named 'win32com'

I have Python 3.4 along with win32com in my site-packages folder and the path to it is in my PATH environment variables (Both the system and User). Is there a primer on how to setup VS to run a Python application?

Thanks,
Dan

Hi Dan,

Can you run a boilerplate template via Python? You can access the pre-generated code from Programming > Python > Standalone Application.



This will generate the template that has connections to the ZOS-API and you should be able to simply run this code. If you still cannot run the pre-generated code, then the following article talks about how to get Python setup to connect with the ZOS-API:

http://www.zemax.com/os/resources/learn/knowledgebase/getting-started-with-python

I can't run that template. I've uninstalled all of my versions of Python and reinstalled just 3.6, along with the correct version of PyWin. I went through the "getting started with python" page (including the troubleshooting section) and now I don't get the same error, but I still can't run the template. Here is an image of the error.


There is a known problem with Python 3.6 and pywin32.



I would recommend using Python 3.5.3, 64-bit. You will also need to make sure that you have the 64-bit pywin32 installed as well; you cannot use 64-bit Python with 32-bit pywin32.
GO


Similar Topics


Login
Existing Account
Email Address:


Password:


Select a Forum....























































Zemax Users Forum


Search