Hi Santhoshi,
As far as I know, you can only retrieve a surface by its number. Therefore, I suggest creating a FOR-loop that goes through every surface and checks the surface name (I’m assuming what you call “name” is the Comment column) before returning the clear aperture. This example should get you started:
# Target Comment
tar_com$ = "Target"
# Number of surfaces in the system
num = NSUR()
# Loop over the surfaces
FOR ii, 0, num, 1
# Current surface Comment
cur_com$ = $COMMENT(ii)
# Compare current surface Comment
# with target Comment
IF ( cur_com$ $== tar_com$ )
# Print current surface Clear Semi-Diameter
PRINT SDIA(ii)
ENDIF
NEXT
If you have a Surface with its Comment value is “Target” (case sensitive), then this macro returns its Clear Semi-Diameter. Note that if two surfaces have the Comment “Target”, they’ll both have their Clear Semi-Diameter printed.
Let me know if it makes sense.
Take care,
David