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:
tar_com$ = "Target"
num = NSUR()
FOR ii, 0, num, 1
cur_com$ = $COMMENT(ii)
IF ( cur_com$ $== tar_com$ )
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