UDP/UDM Structures
Differences compared to C API:
- UDMDefinition
- UDMOptions
- UDMParameters
Instead of containing arrays of data, the structures contain single fields where each field corresponds to an item in a different array from the original C API. The structure objects thus constructed are added to the Python list. Alternately the Python list can be initialized using the structure objects.
Example (creating UDMParameter list):
udmParamList = [
UDMParameter(
"cubeSizeName", UnitType.LengthUnit,
UDPParam(ParamDataType.Double, cubeSize),
ParamPropType.Value,
ParamPropFlag.MustBeReal),
UDMParameter(
"cubeDistanceName", UnitType.LengthUnit,
UDPParam(ParamDataType.Double, cubeDistance),
ParamPropType.Value,
ParamPropFlag.MustBeReal),
UDMParameter("numCubesName", UnitType.LengthUnit,
UDPParam(ParamDataType.Int, numCubes),
ParamPropType.Number,
ParamPropFlag.MustBeInt]
- UDPParam
- UDPParamData
Data field in UDPParam is now an object - the same for all types of data used - as Python can work with any type of data.
UDPParamData is obsolete, thus not implemented. Be sure to set proper data type to UDPParam.DataType when setting UDPParam.Data.
Example:
nCubesParam = UDPParam(ParamDataType.Int, numCubes)
nCubes = nCubesParam.Data
distanceParam = UDPParam()
distanceParam.setDouble(10.5)
doubleDistance = distanceParam.Data * 2
- UDP3x3Matrix
The structure is not implemented. Use size 9 Python List of doubles instead.
Example:
rotationMatrix =[0,0,1, 1,0,0, 0,0,1]
udpFunctionLib.Transform(partId, rotationMatrix, translationVector)
List of Structures
You can use constructors to create a structure. You can also modify fields - directly or by provided methods.
Example:
pos1 = UDPPosition(1,2,3)
pos2 = UDPPosition(x=1,y=10,z=0)
pos2.Z = pos1.Z
udpParam = UDPParam(ParamDataType.Double,1)
value = udpParam.Data
Structure | Construction | Members |
UDPPrimitiveTypeInfo | UDPPrimitiveTypeInfo( string name, string purpose, string company, string date, string version) | string Name string Purpose string Company string Date string Version |
UDPPrimitiveParameterDefinition | UDPPrimitiveParameterDefinition( string name, string description, UnitType unitType, double defaultValue) | string Name string Description UnitType UnitType double DefaultValue |
UDPParam | UDPParam()
UDPParam( ParamDataType dataType, object data) object can be int, double, string, bool or UDPPosition
methods: setInt(int val) setBool(bool val) setString(string val) setDouble(double val) setPosition(UDPPosition val)
| ParamDataType DataType object Data object can be int, double , string, bool or UDPPosition |
UDPPrimitiveParameterDefinition2 | UDPPrimitiveParameterDefinition2( string name, string description, UnitType unitType, ParamPropType propType, ParamPropFlag propFlag, UDPParam defaultValue) | string Name string Description UnitType UnitType ParamPropType PropType ParamPropFlag PropFlag UDPParam DefaultValue |
UDPPosition | UDPPosition( double x, double y, double z) | double X double Y double Z |
UDPVector | UDPVector( double x, double y, double z) | double X double Y double Z |
UDPSweepOptions | UDPSweepOptions( SweepDraftType draftType, double draftAngle, double twistAngle) | SweepDraftType DraftType double DraftAngle double TwistAngle |
UDPPolylineSegmentDefinition | UDPPolylineSegmentDefinition( PolylineSegmentType segmentType, int segmentStartIndex, int numberOfPoints, double angle, UDPPosition centerPoint, CoordinateSystemPlane arcPlane) | PolylineSegmentType SegmentType int segmentStartIndex, int numberOfPoints, double angle, UDPPosition centerPoint, CoordinateSystemPlane arcPlane)
|
UDPPolylineDefinition | UDPPolylineDefinition() UDPPolylineDefinition( List_of_UDPPosition positions, List_of_UDPPolylineSegmentDefinition segDefs, int closed, int covered) | int IsClosed int IsCovered List_of_UDPPosition ArrayOfPosition List_of_UDPPolylineSegmentDefinition ArrayOfSegmentDefinition |
UDPEquationBasedCurveDefinition | UDPEquationBasedCurveDefinition( string functionXt, string functionYt, string functionZt, double tStart, double tEnd, int numOfPointsOnCurve) | string FunctionXt string FunctionYt string FunctionZt double TStart double TEnd int NumOfPointsOnCurve |
UDPEquationBasedSurfaceDefinition | UDPEquationBasedSurfaceDefinition( string functionXuv, string functionYuv, string functionZuv, double uStart, double uEnd, double vStart, double vEnd int reserved1 int reserved2) | string FunctionXuv string FunctionYuv string FunctionZuv double UStart double UEnd double VStart double VEnd two integer arguments that are reserved for future use. They need to be provided, for example as 0. For example: theSurfaceDefinition = UDPEquationBasedSurfaceDefinition("u","v","1",0,1,0,1,0,0) |
UDPHelixDefinition | UDPHelixDefinition( int profileID, UDPPosition ptOnAxis, UDPPosition axisDir, double noOfTurns, bool isRightHanded, double radiusChangePerTurn, double pitch) | int ProfileID UDPPosition PtOnAxis UDPPosition AxisDir double NoOfTurns bool IsRightHanded double RadiusChangePerTurn double Pitch |
UDPSpiralDefinition | UDPSpiralDefinition( int profileID, UDPPosition ptOnAxis, UDPPosition axisDir, double noOfTurns, bool isRightHanded, double radiusChangePerTurn) | int ProfileID UDPPosition PtOnAxis UDPPosition AxisDir double NoOfTurns bool IsRightHanded double RadiusChangePerTurn |
UDPBLNDElements | UDPBLNDElements( int partID, int noOfEdges; int* listOfEdges; )
UDPBLNDElements( int partID, int noOfVertices; int* listOfVertices; ) | UDPBLNDElements can hold either edges or vertices, but not both at the same time. Edges should be applied to solids, and vertices should be applied to sheets. int PartID /* part to be blended i.e. filleted/chamfered */ int noOfEdges; int* listOfEdges; /* edges to be blended */ int noOfVertices; int* listOfVertices; /* vertices to be blended */
|
UDPBLNDFilletOptions | UDPBLNDFilletOptions( bool supressFillet, BLNDFilletRadiusLaw filletRadiusLaw, double filletStartRadius, double filletEndRadius, bool followSmoothEdgeSequence, BLNDFilletType filletType, double setbackDistance, double bulgeFactor) | bool SupressFillet /* Reserved for future */ BLNDFilletRadiusLaw FilletRadiusLaw double FilletStartRadius double FilletEndRadius bool FollowSmoothEdgeSequence /* Reserved for future */ BLNDFilletType FilletType double SetbackDistance double BulgeFactor /* Reserved for future */ |
UDPBLNDChamferOptions | UDPBLNDChamferOptions( bool supressChamfer, BLNDChamferRangeLaw chamferRangeLaw, double chamferLeftRange, double chamferRightRange) | bool SupressChamfer BLNDChamferRangeLaw ChamferRangeLaw double ChamferLeftRange double ChamferRightRange
|
UDPProgress | UDPProgress( int prog, int subProg, string mesg, string subMesg) | int Prog int SubProg string Mesg string SubMesg |
UDMInfo | UDMInfo( string name, string purpose, string company, string date, string version) | string Name string Purpose string Company string Date string Version |
UDMDefinition | UDMDefinition()
UDMDefinition( string name, UDParam value, ParamPropType propType, ParamPropFlag propFlag) | string DefName UDPParam DefValue ParamPropType PropType ParamPropFlag PropFlag
|
UDMOption | UDMOption()
UDMOption( string name, UDParam value, ParamPropType propType, ParamPropFlag propFlag) | string OptName UDPParam OptValue ParamPropType PropType ParamPropFlag PropFlag
|
UDMParameter | UDMParameter()
UDMParameter( string name, UDParam value, UnitType unitType, ParamPropType propType, ParamPropFlag propFlag) | string ParamName UDPParam ParamValue UnitType UnitType ParamPropType PropType ParamPropFlag PropFlag
|