Skip to main content

ZOS-API interface 2024 R1

ZOSAPI.Common Namespace Reference

Last update: 17.07.2025

Classes

interface  ICoordinateTransform
 
interface  IMatrixData
 Methods and properties for retrieving and/or setting a 2D array of double precision data. More...
 
interface  IMetadata
 
interface  ISettingsData
 Methods and interfaces for storing and retrieving user-defined settings.
All settings are referenced via a user-defined string key, and has a specific type associated with it (e.g. a single integer, array of doubles, etc.). More...
 
interface  IVectorData
 Methods and properties for retrieving and/or setting a 1D array of double precision data. More...
 

Enumerations

enum  ZemaxColor {
  Default , Color1 , Color2 , Color3 ,
  Color4 , Color5 , Color6 , Color7 ,
  Color8 , Color9 , Color10 , Color11 ,
  Color12 , Color13 , Color14 , Color15 ,
  Color16 , Color17 , Color18 , Color19 ,
  Color20 , Color21 , Color22 , Color23 ,
  Color24 , NoColor
}
 
enum  ZemaxOpacity {
  P100 , P90 , P80 , P70 ,
  P60 , P50 , P40 , P30 ,
  P20 , P10 , P00
}
 
enum  SettingsDataType {
  None , Integer , Double , Float ,
  String , Byte , Boolean
}
 

Enumeration Type Documentation

◆ SettingsDataType

Enumerator
None 
Integer 
Double 
Float 
String 
Byte 
Boolean 

◆ ZemaxColor

Enumerator
Default 
Color1 
Color2 
Color3 
Color4 
Color5 
Color6 
Color7 
Color8 
Color9 
Color10 
Color11 
Color12 
Color13 
Color14 
Color15 
Color16 
Color17 
Color18 
Color19 
Color20 
Color21 
Color22 
Color23 
Color24 
NoColor 

◆ ZemaxOpacity

Usage (see Example 17 for a full sample)

C#

//Rectangular Volume
//Scattering properties
//Draw:opacity set to 50%
IObjectTypeSettings oType_2 = Object_2.GetObjectTypeSettings(ZOSAPI.Editors.NCE.ObjectType.RectangularVolume);
Object_2.ChangeType(oType_2);
Object_2.ZPosition = 2;
Object_2.Material = "N-BK7";
IObjectRectangularVolume RectVolume2_data = Object_2.ObjectData as IObjectRectangularVolume;
RectVolume2_data.X1HalfWidth = 12;
RectVolume2_data.Y1HalfWidth = 12;
RectVolume2_data.ZLength = 40;
RectVolume2_data.X2HalfWidth = 12;
RectVolume2_data.Y2HalfWidth = 12;
INCEVolumePhysicsData RectVolume2_volphysdata = Object_2.VolumePhysicsData;
RectVolume2_volphysdata.Model = VolumePhysicsModelType.AngleScattering;
RectVolume2_volphysdata.ModelSettings._S_AngleScattering.MeanPath = 5;
RectVolume2_volphysdata.ModelSettings._S_AngleScattering.Angle = 30;
INCEDrawData RectVolume2_Drawdata = Object_2.DrawData;
RectVolume2_Drawdata.Opacity = ZOSAPI.Common.ZemaxOpacity.P50;
Definition: InterfacesCommon.cs:9
Definition: InterfacesNCE.cs:19
Definition: InterfacesEditors.cs:12
The ZOSAPI namespace contains classes for initially connecting to zemax. See also ZOSAPI_Connection,...
Definition: IAS_FieldCurvatureAndDistortion.cs:5

C++

//Rectangular Volume
//Scattering properties
//Draw:opacity set to 50%
IObjectTypeSettingsPtr oType_2 = Object_2->GetObjectTypeSettings(ObjectType_RectangularVolume);
Object_2->ChangeType(oType_2);
Object_2->ZPosition = 2;
Object_2->Material = "N-BK7";
IObjectRectangularVolumePtr RectVolume2_data = Object_2->ObjectData;
RectVolume2_data->X1HalfWidth = 12;
RectVolume2_data->Y1HalfWidth = 12;
RectVolume2_data->ZLength = 40;
RectVolume2_data->X2HalfWidth = 12;
RectVolume2_data->Y2HalfWidth = 12;
INCEVolumePhysicsDataPtr RectVolume2_volphysdata = Object_2->VolumePhysicsData;
RectVolume2_volphysdata->Model = VolumePhysicsModelType_AngleScattering;
RectVolume2_volphysdata->ModelSettings->_S_AngleScattering->MeanPath = 5;
RectVolume2_volphysdata->ModelSettings->_S_AngleScattering->Angle = 30;
INCEDrawDataPtr RectVolume2_Drawdata = Object_2->DrawData;
RectVolume2_Drawdata->Opacity = ZemaxOpacity_P50;

Matlab

% Rectangular Volume
% Scattering Properties
% Draw:opacity set to 50%
oType_2 = Object_2.GetObjectTypeSettings(ZOSAPI.Editors.NCE.ObjectType.RectangularVolume);
Object_2.ChangeType(oType_2);
Object_2.ZPosition = 2;
Object_2.Material = 'N-BK7';
RectVolume2_data = Object_2.ObjectData;
RectVolume2_data.X1HalfWidth = 12;
RectVolume2_data.Y1HalfWidth = 12;
RectVolume2_data.ZLength = 40;
RectVolume2_data.X2HalfWidth = 12;
RectVolume2_data.Y2HalfWidth = 12;
RectVolume2_volphysdata = Object_2.VolumePhysicsData;
RectVolume2_volphysdata.Model = ZOSAPI.Editors.NCE.VolumePhysicsModelType.AngleScattering;
RectVolume2_volphysdata.ModelSettings.S_AngleScattering_.MeanPath = 5;
RectVolume2_volphysdata.ModelSettings.S_AngleScattering_.Angle = 30;
RectVolume2_DrawData = Object_2.DrawData;
RectVolume2_DrawData.Opacity = ZOSAPI.Common.ZemaxOpacity.P50;

Python

# Rectangular Volume
# Scattering Properties
# Draw:opacity set to 50%
oType_2 = Object_2.GetObjectTypeSettings(ZOSAPI.Editors.NCE.ObjectType.RectangularVolume)
Object_2.ChangeType(oType_2)
Object_2.ZPosition = 2
Object_2.Material = "N-BK7"
RectVolume2_data = Object_2.ObjectData
RectVolume2_data.X1HalfWidth = 12
RectVolume2_data.Y1HalfWidth = 12
RectVolume2_data.ZLength = 40
RectVolume2_data.X2HalfWidth = 12
RectVolume2_data.Y2HalfWidth = 12
RectVolume2_volphysdata = Object_2.VolumePhysicsData
RectVolume2_volphysdata.Model = ZOSAPI.Editors.NCE.VolumePhysicsModelType.AngleScattering
RectVolume2_volphysdata.ModelSettings._S_AngleScattering.MeanPath = 5
RectVolume2_volphysdata.ModelSettings._S_AngleScattering.Angle = 30
RectVolume2_DrawData = Object_2.DrawData
RectVolume2_DrawData.Opacity = ZOSAPI.Common.ZemaxOpacity.P50
Enumerator
P100 
P90 
P80 
P70 
P60 
P50 
P40 
P30 
P20 
P10 
P00 

Connect with Ansys