UDMFunctionLibrary

UDMFunctionLibrary implements IUDMFunctionLib interface. The IUDMFunctionLib object is passed as a parameter to Python script in the following functions

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:

  1. List_of_UDMDefinition: udmDefinitionList = GetDefinition()
  2. List_of_UDMOption: udmOptionList = GetOptions()
  3. bool: bret = SetMaterialName(string: matName, int: partId)
  4. bool: bret = SetMaterialName2(string: matName, string: partName)
  5. bool: bret = SetPartName(string: partName, int: partId)
  6. int: iret = GetInstanceId()
  7. string: str = GetPartRefId(int: partId)
  8. bool: bret = SetPartRefId(int: partId, string: refId)
  9. List_of_int: faceIds = GetAllFaces(int: partId)
  10. List_of_int: edgeIds = GetAllEdges(int: partId)
  11. List_of_int: vertexIds = GetAllVertices(int: partId)
  12. bool: bret = SetFaceAttribs(List_of_int: faceIds, List_of_string: attribs)
  13. bool: bret = SetEdgeAttribs(List_of_int: edgeIds, List_of_string: attribs)
  14. bool: bret = SetVertexAttribs(List_of_int: vertexIds, List_of_string: attribs)
  15. string: str = GetModelerUnit()
  16. string: str = GetCacheFileForUDMResume()
  17. bool: bret = SetPartColor(int: partId, int: nColor)
  18. bool: bret = SetPartFlags(int: partId, int: nFlags)
  19. (bool: bret, UDPPosition: low, UDPPosition: high) = GetBoundingBox(int: partId, bool: exact)
  20. bool: bret = IsParametricUpdate()
  21. bool: bret = SetMaterialNameByRefId(string: partRefID, string: matName)
  22. bool: bret = SetPartNameByRefId(string: partRefId, string: partName)
  23. bool: bret = SetPartColorByRefId(string: partRefId, int: nColor)
  24. 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)