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

I see what you mean... try this...

Dim app As Inventor.Application = ThisApplication
Dim doc As Document = app.ActiveDocument
Dim compDef As PartComponentDefinition = doc.ComponentDefinition


Dim wp1 As WorkPoint = compDef.WorkPoints("Work Point1")
Dim ucs As UserCoordinateSystem = compDef.UserCoordinateSystems(1)
'copy workpoint so it can be manipulated
Dim testPoint As Point = wp1.Point.Copy
'get the transform matrix for ucs
Dim invertMatrix As Matrix = ucs.Transformation
'invert matrix to find origin
invertMatrix.Invert
'transform point by inverted matrix to get desired point
testPoint.TransformBy(invertMatrix)

'you won't need to convert from metric to imperial but i'm leaving that in for me =P
MessageBox.Show("X: " & testPoint.X / 2.54 & " Y: " & testPoint.Y / 2.54 & " Z: " & testPoint.Z / 2.54 , "Title")
If I've helped you, please help me by supporting this idea.
Mass Override for Each Model State

Custom Glyph Icon for iMates