Head File for Intrinsic Structure Definition

Many intrinsic structures are written in C++ for UDPs. These intrinsic structures are provided in the UserDefinedPrimitiveStructures.h file (under directory: AnsysEM\Maxwell[x.x]\Win64\UserDefinedPrimitives\Examples\Headers).

Here are some common intrinsic structures that you need to know before starting coding for UDPs:

UDPPosition

Defines the most common and basic structure in a coordinate system, which is used to describe a point in the system.

struct UDPPosition

{

double x;

double y;

double z;

};

UDPPolylineDefinition

Defines the structure of polyline in a UDP, which is used to create sheets or lines in a UDP.

struct UDPPolylineDefinition

{

int noOfPoints;

struct UDPPosition* arrayOfPosition;

int noOfSegments;

struct UDPPolylineSegmentDefinition* arrayOfSegmentDefinition;

int isClosed;

int isCovered; /* Only if it is closed, then it can be covered */

};

UDPPrimitiveParameterDefinition

Defines the parameter/property definition of each UDP, such as DiaGap, DiaYoke and Length in the Properties window of each UDP. A definition for a parameter includes the name of the parameter, description of the parameter, unit of parameter, and default value of it.

struct UDPPrimitiveParameterDefinition

{

char* name; /* Name of the parameter */

char* description; /* some description of the parameter */

UDPUnitType unitType; /* No unit/length/angle */

double defaultValue;

};

UDPPolylineSegmentDefinition

Defines line segments used to form a polyline.

struct UDPPolylineSegmentDefinition

{

UDPPolylineSegmentType segmentType;

int segmentStartIndex;

 

/* Below information is required to be set only if you are using Spline */

int numberOfPoints;

 

/* Below information is required to be set only if you are using Angular Arc */

double angle; /* in degrees */

UDPPosition centerPoint;

UDPCoordinateSystemPlane arcPlane;

};

UDPSweepOptions

Sweep is a kind of operation to move an object from one position to another and meanwhile creating another object based on the track of the movement. For instance, sweep operations can be used to create a sheet from a line or a 3D object from a sheet. Different kinds of sweep types (and sweep angles) are used in SweepAlongAxis and SweepAroundAxis functions to make a sheet or a 3D object.

struct UDPSweepOptions

{

UDPSweepDraftType draftType;

double draftAngle;

double twistAngle;

};

UDPVector

Vector structures are used in UDP coding, mainly for rotation, moving or other kinds of transformations of geometry.

struct UDPVector

{

double x;

double y;

double z;

};