Announcements
Attention for Customers without Multi-Factor Authentication or Single Sign-On - OTP Verification rolls out April 2025. Read all about it here.
GeorgK
1481 Views, 11 Replies

Copy UCS from part to assembly

Hello together,

 

I have a part with a UCS inside. This part is placed in an assembly. I would like create a new UCS in the assembly with the same orientation as the part UCS.

 

 Dim oDoc As Document
        oDoc = m_invApp.ActiveDocument

        Dim CompDefs As AssemblyComponentDefinitions
        CompDefs = oDoc.ComponentDefinitions

        Dim oCompDef As AssemblyComponentDefinition
        oCompDef = CompDefs.Item(1)

        Dim oWx As Inventor.WorkAxis
        oWx = m_invApp.CommandManager.Pick(SelectionFilterEnum.kWorkAxisFilter, "Please select WorkAxis:")

        If oWx.IsCoordinateSystemElement Then

            Dim oWxNodeDef As Inventor.NativeBrowserNodeDefinition
            Dim oWxNode As Inventor.BrowserNode

            oWxNodeDef = oDoc.BrowserPanes.GetNativeBrowserNodeDefinition(oWx)
            oWxNode = oDoc.BrowserPanes.ActivePane.TopNode.AllReferencedNodes(oWxNodeDef).Item(1)

            Dim oUCS As Inventor.UserCoordinateSystem
            oUCS = oWxNode.Parent.NativeObject

            Dim oTransMatrix As Matrix
            oTransMatrix = oUCS.Transformation
          
            '.........................
        End If

 

How could I do this?

 

Thanks

 

Georg