Announcements
Attention for Customers without Multi-Factor Authentication or Single Sign-On - OTP Verification rolls out April 2025. Read all about it here.
JelteDeJong
in reply to: Anonymous

you can get workpoint coordinates acc. to UCS like this.

Dim doc As PartDocument = ThisDoc.Document
Dim partDef As PartComponentDefinition = doc.ComponentDefinition

Dim workpoint As WorkPoint = partDef.WorkPoints.Item(1)
Dim point As Point = workpoint.Point
MsgBox(String.Format("WorkPoint: {0}x{1}x{2}", point.X, point.Y, point.Z))

Dim yourUCS As UserCoordinateSystem = partDef.UserCoordinateSystems.Item(1)
Dim yourUCSmat As Matrix = yourUCS.Transformation

point.TransformBy(yourUCSmat)

MsgBox(String.Format("WorkPoint acc. to UCS: {0}x{1}x{2} (Dimensions in cm)", point.X, point.Y, point.Z))

Jelte de Jong
Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.

EESignature


Blog: hjalte.nl - github.com