UDMFunctionLibrary
UDMFunctionLibrary implements IUDMFunctionLib interface. The IUDMFunctionLib object is passed as a parameter to Python script in the following functions
- CreateInstance
- Refresh
You can call any of the functions from the functions list (shown below).
partRefId = udmFunctionLib.GetPartRefId(partId)
For example sample code that calls GetBoundingBox in Python script can look like this:
partId = 10
exact = True
udpPosition = UDPPosition(0,0,0)
(bret, udpPositionLow, udpPositionHigh) = udmFunctionLibrary.GetBoundingBox(partId, exact);
if bret:
udpPosition.X = udpPositionLow.X
As you can see udpPositionLow and udpPositionHigh output parameters are defined in the call to GetBoundingBox function. There is no need to define them before the function call.
Functions list:
- List_of_UDMDefinition: udmDefinitionList = GetDefinition()
- List_of_UDMOption: udmOptionList = GetOptions()
- bool: bret = SetMaterialName(string: matName, int: partId)
- bool: bret = SetMaterialName2(string: matName, string: partName)
- bool: bret = SetPartName(string: partName, int: partId)
- int: iret = GetInstanceId()
- string: str = GetPartRefId(int: partId)
- bool: bret = SetPartRefId(int: partId, string: refId)
- List_of_int: faceIds = GetAllFaces(int: partId)
- List_of_int: edgeIds = GetAllEdges(int: partId)
- List_of_int: vertexIds = GetAllVertices(int: partId)
- bool: bret = SetFaceAttribs(List_of_int: faceIds, List_of_string: attribs)
- bool: bret = SetEdgeAttribs(List_of_int: edgeIds, List_of_string: attribs)
- bool: bret = SetVertexAttribs(List_of_int: vertexIds, List_of_string: attribs)
- string: str = GetModelerUnit()
- string: str = GetCacheFileForUDMResume()
- bool: bret = SetPartColor(int: partId, int: nColor)
- bool: bret = SetPartFlags(int: partId, int: nFlags)
- (bool: bret, UDPPosition: low, UDPPosition: high) = GetBoundingBox(int: partId, bool: exact)
- bool: bret = IsParametricUpdate()
- bool: bret = SetMaterialNameByRefId(string: partRefID, string: matName)
- bool: bret = SetPartNameByRefId(string: partRefId, string: partName)
- bool: bret = SetPartColorByRefId(string: partRefId, int: nColor)
- bool: bret = SetPartFlagsByRefId(string: partRefId, int: nFlags)
In addition to the above functions all functions defined in the UDPFunctionLib are available in the IUDMFunctionLib and can be called directly exactly the same way as the IUDMFunctionLib functions.
Example:
udmFunctionLib.CreateCircle(center,radius,ratio,isCovered)