Skip to main content

ZOS-API- How to access properties and methods in Non-Sequential Component Editor?

  • September 30, 2019
  • 0 replies
  • 865 views

Julia
Fully Spectral
Forum|alt.badge.img+2
  • Fully Spectral
  • 51 replies
TheSystem.NCE.GetObjectAt(1). Comment;TheSystem.NCE.GetObjectAt(1). RefObject;TheSystem.NCE.GetObjectAt(1). InsideOf;TheSystem.NCE.GetObjectAt(1). XPosition;TheSystem.NCE.GetObjectAt(1). YPosition;TheSystem.NCE.GetObjectAt(1). Zposition;TheSystem.NCE.GetObjectAt(1). TiltAboutX;TheSystem.NCE.GetObjectAt(1). TiltAboutY;TheSystem.NCE.GetObjectAt(1). TiltAboutZ;TheSystem.NCE.GetObjectAt(1). Material;

 

The above code can get and set values of RefObject, InsideOf, XPosition, YPosition, Zposition, TiltAboutX, TiltAboutY, TiltAboutZ; strings of Comment, Material.

TheSystem.NCE. ReloadAllObjects();TheSystem.NCE. ReloadObject(2);

In the above code:

  • Reload all objects
  • Reload object#2
[bool_return,R11,R12,R13,R21,R22,R23,R31,R32,R33,Xo,Yo,Zo]=TheSystem.NCE.GetMatrix(1);TheSystem.NCE.PrevNSCGroup();TheSystem.NCE.NextNSCGroup();
  • Get the rotation and position matrices for NSC object 1 relative to the NSC surface origin
  • Select the previously available non-sequential surface
  • Select the next available non-sequential surface

 

pixels=TheSystem.NCE.GetDetectorSize(4);[bool_return,total_hits]= TheSystem.NCE.GetDetectorData(4, -3, 0);  [bool_return,total_coherent_power]= TheSystem.NCE.GetCoherentData(4,0,ZOSAPI.Editors.NCE.DetectorDataType.Power);
  • Get the total number of pixels for the detector object4
  • Get data from NSC detector4 (pixel=-3, data=0)
  • Get coherent data from NSC detector4 (pixel=0 to retrieve the sum over all pixels )
 [bool_return,peak_intensity]= TheSystem.NCE.GetColorDetectorData(4,-1, true,2,0,0);[bool_return,total_power]= TheSystem.NCE.GetPolarDetectorData(4,0, ZOSAPI.Editors.NCE.PolarDetectorDataType.Power);
  • Get data from NSC color detector4(pixel= -1 to retrieve the maximum data, bool true represent angle space data, data=2 get data of power/solid angle)
  • Get data from NSC polar detector4 (pixel=0: Sum of all data for all pixels on the detector)
data = NET.createArray('System.Double', TheNCE.GetDetectorSize(4));bool_return=TheSystem.NCE.GetAllDetectorData(4, 1, TheNCE.GetDetectorSize(4), data);
  • Retrieve irradiance data (data=1) for all pixels at once and get a bool return
data=TheSystem.NCE.GetAllDetectorDataSafe(4,1);display(data.double);
  • Retrieve irradiance data (data=1) for all pixels at once and get data array return
TheSystem.NCE.SaveDetector(4, 'savedDetector.DDR');TheSystem.NCE.LoadDetector(4, 'savedDetector.DDR', true);
  • Save the data on Detector Rectangle 4 as 'savedDetector.DDR'
  • Load 'savedDetector.DDR' to NSC Detector Rectangle 4

 

TheNCE=TheSystem.NCE;ob2=TheNCE.GetObjectAt(2);diffraction_data=ob2.DiffractionData;diffraction_data.Split=ZOSAPI.Editors.NCE.DiffractionSplitType.SplitByTable;diffraction_data.StartOrder=0;diffraction_data.StopOrder=2;diffraction_data.SetReflectParameterValue(0,0.5);
  • Set diffraction property of object2 in Non-sequential as Split by data
  • Set Start Order as 0, Stop Order as 2
  • Set the reflect fraction of order0 as 0.5
TheNCE = TheSystem.NCE;obj_1 = TheNCE.GetObjectAt(1);surf1=obj_1.CoatScatterData.GetFaceData(1);ScatType_isx = obj_1.CoatScatterData.GetFaceData(1).CreateScatterModelSettings(ZOSAPI.Editors.NCE.ObjectScatteringTypes.ISScatterCatalog);ScatType_isx.S_ISScatterCatalog_.SetReflectFile('Sabic_LEXAN_LUX2114G_WH5B140X_1.5mm.isx');ScatType_isx.S_ISScatterCatalog_.SamplingT = ZOSAPI.Editors.Samplings.TwoDegrees;obj_1.CoatScatterData.GetFaceData(1).ChangeScatterModelSettings(ScatType_isx);
  • Set scatter for surface1 of object1 as ISScatterCatalog, the file string is not the full path string


 

Did this topic help you find an answer to your question?

0 replies

Be the first to reply!

Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings