Skip to main content

We have created a public repository called https://github.com/ansys/optical-automation. We are hoping to gradually move our solutions to this Ansys open project on GitHub.

How to use Ansys optical-automation

Ansys optical-automation comes with a documentation: https://ansys-internal.github.io/optical-automation/

This section shows how to clone the GitHub repository and run the code in Visual Studio. 
Note the Visual Studio is not absolutely required. Users can use their preferred tool to sync the GIT repository and preferred IDE tool to run the Python project. Here we simply use Visual Studio as an example.

 

Visual Studio installation

Users can download and install the latest Visual Studio in the following link: https://visualstudio.microsoft.com/vs/community/

During the installation, the Python development must be selected as below.

blobid0.png

GitHub repository configuration

After the installation, we can launch the Visual Studio and click Clone a repository.

blobid1.png

Copy and paste the link below to the Repository location.

(Please don’t open this link in Browser and then paste in Visual Studio, this will change the link)

https://github.com/ansys/optical-automation.git

Run Rayfile Converter

For example let’s run the Rayfile converter. The rayfile_converter_example.py can be found in Solution Explorer >Ansys_optical_automation > Application > Rayfile_converter_Example.

By double clicking, we can open rayfile_converter_example.py.

By pressing Shift+Alt+F5, you can run the conversion tool. A window will prompt for selecting the file you want to convert. Users can select .ray, .sdf and .dat in this window for conversion. The converted file will be generated in the same folder as the file we select. 

 

Python SPEOS and Zemax Source file converter | Zemax Community

Speos and Zemax Source file converter – Knowledgebase


Different IDE tools can be used to work with Ansys optical-automation. If you are a Visual Studio user, you can follow Yuan’s post above, which gives step-by-step guidance to download and use the Ansys optical-automation. In this post, I will use PyCharm as the IDE tool to run the Ansys optical-automation project.

In this post, I will demonstrate how to use Ansys optical-automation. You can watch the video or download the attached instructions to make yourself ready using the example automation scripts provided inside the Ansys optical-automation. 

 

 


Reply