TAGGED: OpticStudio
-
-
January 1, 2025 at 6:01 pmbinyuwSubscriber
-
January 2, 2025 at 11:03 amChristophe WeisseAnsys Employee
Hello,
To the best of my knowledge, you won’t find an object that readily does that.
However, you could use a macro or the ZOS-API to place and orient the array of sources to your will.
Here’s a (hopefully close enough) 1D example of what you could do with a ZPL macro. All sources aim at the same point, you use-case being simplier it is rather easy to edit the code to match your needs:
# "Focal" distance of the detectors
distance = 25
# Distance between detectors as a factor of the index value
factor = 4
FOR det_index, -5, 5, 1
# Insert new object in first line of editor
INSERTOBJECT 1, 1
# Change object type to Detector Rectangle
SETNSCPROPERTY 1, 1, 0, 0, "NSC_DETE"
# Calculate Detector Y Position
y_pos = factor * det_index
# Change Detector Y Position
SETNSCPOSITION 1, 1, 2, y_pos
# Calculated required Tilt About X in deg
IF (det_index == 0)
tilt_x = 0
ELSE
tilt_x = 90 - ATAN( distance / y_pos ) / 3.14159265359 * 180
ENDIF
# Adjust Detector Tilt About X
SETNSCPOSITION 1, 1, 4, tilt_x
NEXTIf you run this macro, this is what the 3D Layout will look like:
If you need the array to be parametric and/or if your array is very large, it could then be more convenient to program the source the way you need with the Source DLL option. -
January 2, 2025 at 3:46 pmbinyuwSubscriber
Thank you so much.
my rectangle sources have specific position and sizes. They all have a defined spacing and titled angle. May I just manually create multiple "source rectangles" in the editor (or any other ways)? I check the DLL and API and still confuse about the coding.
Eventually I want to create something like this:
x:1.5mm, y:0.05mm title angle 45 degree C
Best
Binyu
-
January 3, 2025 at 9:18 amChristophe WeisseAnsys Employee
Dear Binyu,
You're right, creating every object by hand is always possible (you can copy/paste any object, which may make it somewhat convenient) but you'd need to edit some parameters manually. Also, API or DLL can be quite intense if your task is rather simple. This is why my first suggestion was to use macros (ZPL).
This is an easier to use, simplier programming option that excells at automating tasks.
I gave it a quick go to illustrate how ZPL could be used in your set-up:
I hope this helps,
Christophe
-
- You must be logged in to reply to this topic.
- STEP File Exports
- Optic studio-zemax operand values are different from the plot (Genc and Denc)
- Assistance Needed for Wavelength Adjustment in Optical Ring Modulator Simulation
- Matlab linkage Zemax memory overflow problem
- RMS spot size interpretation
- Relay Lens Optimization
- 请问怎么在fdtd里面椭圆偏振光源?
- ZEMAX CAD export problems with tilted surfaces
- one_sided cylindrical lens array
- Plot coupling coefficient versus power from power meter
-
1882
-
802
-
599
-
591
-
366
© 2025 Copyright ANSYS, Inc. All rights reserved.