Hi,
Something strange has happened. I had previously a code that worked and now it doesn't (I have updated ZEMAX since then).
The code I am having issues with, is changing an angle to 'Ray Rotator' in Par 3 or Par 4 (column 3 or 4 from Material on the editor list), which in this case is the angle of the rotationZ and rotationY. The problem is that I am getting error message:
Unable to use a value of type ZOSAPI.Editors.NCE.ObjectColumn as an index.
Error in GetAngle_Cond3_v2>writeTiltAboutY (line 142)
NCEObj.GetObjectCell(ZOSAPI.Editors.NCE.ObjectColumn.Par4).DoubleValue = y;
Error in GetAngle_Cond3_v2>BeginApplication (line 70)
writeTiltAboutY(o23, angleY);
Error in GetAngle_Cond3_v2 (line 14)
r = BeginApplication(TheApplication, args);
My code is:
% Set the Tilt Angle of Y
writeTiltAboutY(o23, angleY);
NCEObj.GetObjectCell(ZOSAPI.Editors.NCE.ObjectColumn.Par3).DoubleValue = y;
end
I have no idea what that means.
Any ideas how to change the angle from matlab in the editor,
doesn't seem to be working. I also tried
but its not doing what I want. Nothing seem to be happening.
I also tried
The row values are correct according to the editor list.
Its a non-sequential analysis.
Looking further I can see that, 023 is empty [], even though i write:
TheNCE is however containing something.
TheNCE =
ZOSAPI_NCE with properties:
AllObjectsTypeSource: [1×1 System.Collections.Generic.List>]
EveryObject: [1×1 System.Collections.Generic.List]
AllSources: [1×1 System.Collections.Generic.List]
AllDetectors: [1×1 System.Collections.Generic.List]
AllObjects: [1×1 System.Collections.Generic.List]
RowToObjectOffset: 1
ActiveSurface: 1
NumberOfObjects: 1
FirstColumn: Comment
LastColumn: Par250
Type: NonSequentialComponents
MinColumn: 1
MaxColumn: 260
NumberOfRows: 1
Editor: NCE
Parent: [1×1 ZemaxUI.ZOSAPI.ZemaxSystem]
Any ideas?
Thanks for any assistance!