Using the OpticStudio Dynamic CAD link

OpticStudio Premium can open native Autodesk Inventor part files (IPT), and PTC Creo Parametric part files (PRT) directly in non-sequential systems. These parts can then be dynamically modified or optimized. This article shows using a Creo part as an example.

Authored By Mojtaba Falahati

Introduction

OpticStudio Premium can dynamically open Autodesk Inventor, and PTC Creo Parametric part files in Non-Sequential Mode in order to model and parametrically control objects that aren't easily modelled by primitive or common shapes. The native CAD part is easily incorporated into the Non-Sequential Component Editor using the associated object type.

Any explicit dimensions defined on the object can be exposed and controlled within the Non-Sequential Component Editor. This will allow optical engineers to be able to work with the same files that their mechanical engineers use, without the need for format conversion. Using a Creo Parametric part file as an example, this article will walk through how to use the dynamic CAD capability.

Install CAD software

The first step required to use OpticStudio’s dynamic CAD capability is to install the appropriate CAD software package:  

  • Autodesk Inventor® 2018, or later, must be installed* to use the “CAD Part: Autodesk Inventor” object, which dynamically links to an Autodesk Inventor part file (*.ipt).
  • PTC Creo Parametric® 9.0 (or one of the following legacy releases of the software: Creo Parametric 8, 7, 6, 5, and 4) must be installed* to use the “CAD Part: Creo Parametric” object, which dynamically links to a Creo Parametric part file (*.prt).

*Please note that the OpticStudio technical support team cannot assist with Autodesk, or Creo installation.

When using the "CAD Part: Creo Parametric object" or "CAD Part: Autodesk Inventor object", it is not necessary to start the corresponding CAD application prior to loading a native CAD part into OpticStudio. Basically, OpticStudio will automatically open the CAD application in silent mode, meaning that the Creo Parametric (or Inventor) application will not appear anywhere on the user's monitor, but a process will be visible in the user's Task Manager listing. This process should be allowed to run as long as OpticStudio is running, in order to ensure that communication is always available between OpticStudio and the corresponding CAD application. In all cases, constant communication between OpticStudio and the creating program is necessary to allow modification of the part inside of OpticStudio.

Creo Parametric example

The following example uses a Creo Parametric part file which was obtained from the free CAD distribution website GrabCAD. Let’s say we want to parametrically model the following lamp in OpticStudio: 

The PRT file is included as an attachment in this article, or can be downloaded from the GrabCAD website: CFL Lamp (Bulb) | 3D CAD Model Library | GrabCAD

Let’s begin by investigating the part in Creo Parametric. The FeatureManager Model Tree shows the features and dimensions which were used to create the CFL Light Bulb:

2022-09-29_20-03-01.png

Right click on either of sketches or shapes in the Model Tree and click "Edit Dimensions" to see the associated dimensions in the window. In the following screenshot, you can see the dimensions that were used to create Sketch1:

2022-09-30_14-51-45.png

For reference, the bulb dimensions are as follows:

  • d0 =500 mm
  • d1 = 85 mm
  • d19 = 25 mm
  • d20 = 23 mm

Once this PRT file is opened in OpticStudio, the bulb dimensions can be accessed and edited in the Non-Sequential Component Editor. OpticStudio will automatically label these dimensions with the default name dx, where x is the integer number assigned to the dimensions. 

Note that the names of the features and dimensions can be changed in Creo Parametric, and this may make further modification more intuitive in OpticStudio. To do this, Click on any dimension value in the graphic area. The Dimension tab will be opened where you can edit the dimension name and value.

 

2022-09-30_16-23-41.png

 Now, the PRT file should be saved and closed, but leave Creo open and running in the background. 

OpticStudio dynamic CAD link

In order to open this Creo Parametric part in OpticStudio, the PRT file must be saved in the appropriate Zemax user data folder.  There are two folders in the user data folder {Zemax}\Objects for the Autodesk Inventor, and PTC Creo Parametric files, shown below:

 

2022-10-03_18-39-40.png

Note that these folder locations may be customized in the OpticStudio Setup...Project Preferences...Folders settings:

 

2022-10-03_18-43-47.png

Once the *.prt file is saved in the “Creo Parametric Files” folder, it can be opened through the Non-Sequential Component (NSC) Editor in OpticStudio.  To do this, open a new, Non-Sequential system.  In the NSC Editor, expand the Object Properties and select “CAD Part: Creo Parametric®” in the Type drop-down menu:

 

2022-09-30_19-57-27.png

Select the appropriate prt file:

 

2022-10-03_18-56-05.png

Press OK and open a new NSC Shaded Model to view the part. The component looks identical to what was shown in Creo Parametric.

 

2022-09-30_19-27-38.png

In this example, the units in the Creo Parametric part file are millimeters, which is also the default setting for Lens Units in OpticStudio. When opening an Autodesk Inventor or PTC Creo Parametric OpticStudio will automatically determine if the units match the current Lens Units setting. If the units are different, it will issue a warning. To avoid potential confusion and error, it is strongly recommended that the user set the Lens Units in OpticStudio and the system units of the CAD program to be the same. 

Once opened in OpticStudio, the CAD object may have optical properties such as coatings, materials, and scattering functions applied. In addition, the dimensions for the part may be displayed directly in the NSC Editor under the parameter columns, allowing for dynamic control of the defining characteristics of the part. Expand the Object Properties and go to the CAD settings. Here you will see a list of all the smart dimensions and configurations defined in the PRT file. The configuration capability in Creo Parametric is very similar to the multiple configuration capability in OpticStudio. It allows you to define multiple variations of the same part in one file. The Creo Parametric and OpticStudio capabilities can be linked using the CPCN multi-configuration operand, which controls this Creo Configuration setting.

By default, these part dimensions are not exposed as parameters in the NSC Editor, but any of the dimensions may be exposed by selecting it in the Part Dimension Name combo-box and clicking Expose. Note that there are identical settings for exposing the dimensions of Inventor.

 

2022-09-30_19-29-32.png 

For this example, click Expose All. All the dimensions are now available in the NSC Editor for dynamic modification.

 

2022-09-30_19-32-21.png

Try changing some of the parameters and update the NSC Shaded Model to see the changes. In the image below, we changed d0 from 500 mm to 550 mm, d1 changed from 85 mm to 90 mm and d19 from 25 mm to 40 mm.  

 

2022-09-30_19-38-26.png

 

If a client machine has OpticsBuilder for Creo 7 installed and the OpticsBuilder for Creo Parametric 7 Steps on following articles have not been performed:

Zemax OpticStudio can potentially run into issues while creating or loading a CAD Part: Creo Parametric object.  Hence, when using the Dynamic Link with Creo Parametric 7, the steps explained in the article which is linked above are essential.

Save the modified file

Any changes made to the CAD object in OpticStudio can be saved in the object’s native file format. In this case, we would save the modified object as a PRT part file, and for Inventor the objects would be saved as IPT files. To do this, go to the toolbar of the NSC Editor, expand the CAD tools, and select Save Modified Part from the drop-down menu:

SaveModified.png

 

The modified object may be saved into a new file, or into the same file name as the original CAD object, thus overwriting the original. Note that saving the object as a new CAD file will not automatically replace the CAD file that is currently in use in OpticStudio. To change the current CAD file, go back to the Type settings in the Object Properties, and select the newly created CAD file from the Data File drop-down menu.  

In addition to saving the modified part dimensions, any optical properties assigned in OpticStudio, like coatings or materials, can also be saved with the native CAD file. In PTC Creo Parametric, optical properties are saved as Annotation Notes, which may be found under the Model Tree for the part or assembly (as long as Display Annotations is checked under the Model Tree Filters menu). In Autodesk Inventor, optical properties are saved under the Custom tab of the iProperties dialog box. In Creo Parametric, the name of the Annotation Note starts with the letter “Z” (the full property is not given by the note name but by the note text) while in Autodesk Inventor, the name of the optical property starts with the word “OpticStudio”.

The information saved in the creating program will have no meaning to that program but is provided only for reference. However, if the same file is subsequently loaded into another OpticStudio design, the property information from that file may be read in by OpticStudio, and used to assign optical properties to that object in the new OpticStudio design.

The following screenshot shows the modified Creo Parametric part in OpticStudio. The Creo Parametric part has a N-BK7 material, and scatter profiles have been assigned to the outer surfaces of the light bulb and base. Two Filament sources have been defined inside the lamp bulb, and a Detector Polar shows the resulting angular far field distribution. This example is saved as a *.ZAR archive file in the article attachment.   

2022-09-30_19-55-37.png

2022-10-09_21-55-04.png

 

 

 

 

Was this article helpful?
0 out of 0 found this helpful

Comments

0 comments

Please sign in to leave a comment.