Skip to main content

Sample code using Interactive Extension:

TheConnection = ZOSAPI.ZOSAPI_Connection();

TheApplication = TheConnection.ConnectAsExtension(21);

TheSystem = TheApplication.PrimarySystem;

Obj2 = TheSystem.NCE.GetObjectAt(2);

Obj2_VolumePhysicsData = Obj2.VolumePhysicsData;

Obj2_VolumePhysicsData.Model = ZOSAPI.Editors.NCE.VolumePhysicsModelType.DLLDefinedScattering;

Obj2_ModelSettings = Obj2_VolumePhysicsData.ModelSettings.S_DLLDefinedScattering_;

Obj2_ModelSettings.DLL = 'Mie.dll';

Obj2_ModelSettings.MeanPath = 5;

Obj2_ModelSettings.SetParameterValue(0, 1.53);

Obj2_ModelSettings.SetParameterValue(1, 0.5);

Obj2_ModelSettings.SetParameterValue(2, 100000000000000000);

Obj2_ModelSettings.SetParameterValue(3, 0.001);

Obj2_ModelSettings.SetParameterValue(4, 1);

 

For newbies, re-requested steps:

  1. The object is set to a volume object 
  2. The interactive extension is activated

More information:

You can find the settings for DLL Defined Scattering in the ZOSAPI.Editors.NCE.IVMPS_DLLDefinedScattering Interface Reference. This is where you will find the properties and public member functions for all DLL Volume Scatter models:
 
?name=Screenshot+2024-04-03+161640.jpg
 
As you can see in the GUI, all DLL models have the common parameters Mean Path and Angle. The rest of the parameters are DLL specific. For this reason, we do not use the full name, but instead we use the parameter number as the reference for these settings. This means that you need to access these parameters using their numbers rather than their names.

Sample file attached for your reference.


Reply