<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Copy UCS from part to assembly in Inventor Programming - iLogic, Macros, AddIns &amp; Apprentice</title>
    <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/copy-ucs-from-part-to-assembly/m-p/7533316#M76706</link>
    <description>&lt;P&gt;Hello &lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/4427777"&gt;@chandra.shekar.g&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;is it possible to get the UCS from a part in a subassembly? How do I transforme the matrix?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you&lt;/P&gt;
&lt;P&gt;Georg&lt;/P&gt;</description>
    <pubDate>Fri, 10 Nov 2017 09:19:50 GMT</pubDate>
    <dc:creator>GeorgK</dc:creator>
    <dc:date>2017-11-10T09:19:50Z</dc:date>
    <item>
      <title>Copy UCS from part to assembly</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/copy-ucs-from-part-to-assembly/m-p/7493392#M76126</link>
      <description>&lt;P&gt;Hello together,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;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.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;Dim oDoc As Document&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; oDoc = m_invApp.ActiveDocument&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim CompDefs As AssemblyComponentDefinitions&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; CompDefs = oDoc.ComponentDefinitions&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim oCompDef As AssemblyComponentDefinition&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; oCompDef = CompDefs.Item(1)&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim oWx As Inventor.WorkAxis&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; oWx = m_invApp.CommandManager.Pick(SelectionFilterEnum.kWorkAxisFilter, "Please select WorkAxis:")&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; If oWx.IsCoordinateSystemElement Then&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim oWxNodeDef As Inventor.NativeBrowserNodeDefinition&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim oWxNode As Inventor.BrowserNode&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; oWxNodeDef = oDoc.BrowserPanes.GetNativeBrowserNodeDefinition(oWx)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; oWxNode = oDoc.BrowserPanes.ActivePane.TopNode.AllReferencedNodes(oWxNodeDef).Item(1)&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim oUCS As Inventor.UserCoordinateSystem&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; oUCS = oWxNode.Parent.NativeObject&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim oTransMatrix As Matrix&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; oTransMatrix = oUCS.Transformation&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; '.........................&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; End If&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;How could I do this?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Georg&lt;/P&gt;</description>
      <pubDate>Thu, 26 Oct 2017 12:47:22 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/copy-ucs-from-part-to-assembly/m-p/7493392#M76126</guid>
      <dc:creator>GeorgK</dc:creator>
      <dc:date>2017-10-26T12:47:22Z</dc:date>
    </item>
    <item>
      <title>Re: Copy UCS from part to assembly</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/copy-ucs-from-part-to-assembly/m-p/7501299#M76194</link>
      <description>&lt;P&gt;Hi &lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/241746"&gt;@GeorgK&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In order to copy UCS from part to assembly, UserCoordinateSystemProxy can be created from part&amp;nbsp;and copied into AssemblyDocument.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;To illustrate the same,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;Launch Inventor 2018&lt;/LI&gt;
&lt;LI&gt;open new assembly document&lt;/LI&gt;
&lt;LI&gt;Download attached part(UCS part.ipt) to desired location&lt;/LI&gt;
&lt;LI&gt;Copy and paste the following VBA code into VBA editor.&lt;/LI&gt;
&lt;LI&gt;Update the path of part in VBA code.&lt;/LI&gt;
&lt;LI&gt;On running the code, a UCS will be copied from part to assembly.&lt;/LI&gt;
&lt;/OL&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;Sub Main()

    Dim oDoc As AssemblyDocument
    Set oDoc = ThisApplication.ActiveDocument
    
    Dim oDef As AssemblyComponentDefinition
    Set oDef = oDoc.ComponentDefinition
    
    Dim occMatrix As Matrix
    Set occMatrix = ThisApplication.TransientGeometry.CreateMatrix
    
    Dim occ As ComponentOccurrence
    Set occ = oDef.Occurrences.Add&lt;FONT color="#ff0000"&gt;("Path of part files\UCS part.ipt"&lt;/FONT&gt;, occMatrix)
        
    Dim compDef As PartComponentDefinition
    Set compDef = occ.Definition
    
    Dim partUCS As UserCoordinateSystem
    Set partUCS = compDef.UserCoordinateSystems.Item(1)
      
    Dim oProxy As UserCoordinateSystemProxy
    Call occ.CreateGeometryProxy(partUCS, oProxy)
        
    Dim oMatrix As Matrix
    Set oMatrix = oProxy.Transformation
       
    Dim oUCSDef As UserCoordinateSystemDefinition
    Set oUCSDef = oDef.UserCoordinateSystems.CreateDefinition
    
    oUCSDef.Transformation = oMatrix
    
    Dim oUCS As UserCoordinateSystem
    Set oUCS = oDef.UserCoordinateSystems.Add(oUCSDef)
    
End Sub
&lt;/PRE&gt;
&lt;P&gt;Please feel free to contact if there is any queries.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If solves problem, click on "Accept as solution" / give a "Kudo".&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks and regards,&lt;/P&gt;</description>
      <pubDate>Mon, 30 Oct 2017 11:49:19 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/copy-ucs-from-part-to-assembly/m-p/7501299#M76194</guid>
      <dc:creator>chandra.shekar.g</dc:creator>
      <dc:date>2017-10-30T11:49:19Z</dc:date>
    </item>
    <item>
      <title>Re: Copy UCS from part to assembly</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/copy-ucs-from-part-to-assembly/m-p/7519577#M76468</link>
      <description>&lt;P&gt;Hello &lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/4427777"&gt;@chandra.shekar.g&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;is it possible to select the UCS directly? I have several parts with different UCS in each part.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you for your help.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Georg&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 06 Nov 2017 10:22:26 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/copy-ucs-from-part-to-assembly/m-p/7519577#M76468</guid>
      <dc:creator>GeorgK</dc:creator>
      <dc:date>2017-11-06T10:22:26Z</dc:date>
    </item>
    <item>
      <title>Re: Copy UCS from part to assembly</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/copy-ucs-from-part-to-assembly/m-p/7523248#M76557</link>
      <description>&lt;P&gt;Hi &lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/241746"&gt;@GeorgK&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Try the following VBA code to select the UCS and create the same in AssemblyDocument.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;Sub Main()

    Dim oDoc As AssemblyDocument
    Set oDoc = ThisApplication.ActiveDocument
    
    Dim oDef As AssemblyComponentDefinition
    Set oDef = oDoc.ComponentDefinition

    Dim oUCS As UserCoordinateSystem
    Set oUCS = ThisApplication.CommandManager.Pick(kUserCoordinateSystemFilter, "Select UCS")
    
    Dim oMatrix As Matrix
    Set oMatrix = oUCS.Transformation
       
    Dim oUCSDef As UserCoordinateSystemDefinition
    Set oUCSDef = oDef.UserCoordinateSystems.CreateDefinition
    
    oUCSDef.Transformation = oMatrix
    
    Dim copiedUCS As UserCoordinateSystem
    Set copiedUCS = oDef.UserCoordinateSystems.Add(oUCSDef)
    
End Sub
&lt;/PRE&gt;
&lt;P&gt;Please feel free to contact if there is any queries.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If solves problem, click on "Accept as solution" / give a "Kudo".&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks and regards,&lt;/P&gt;</description>
      <pubDate>Tue, 07 Nov 2017 10:40:52 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/copy-ucs-from-part-to-assembly/m-p/7523248#M76557</guid>
      <dc:creator>chandra.shekar.g</dc:creator>
      <dc:date>2017-11-07T10:40:52Z</dc:date>
    </item>
    <item>
      <title>Re: Copy UCS from part to assembly</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/copy-ucs-from-part-to-assembly/m-p/7523747#M76562</link>
      <description>&lt;P&gt;Hello &lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/4427777"&gt;@chandra.shekar.g&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;your code does not position the UCS in the assembly at the position where the part with the UCS is. The part includes the UCS.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you Georg&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="UCS.jpg" style="width: 705px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/422851i9B9B933F4F1FBCFF/image-size/large?v=v2&amp;amp;px=999" role="button" title="UCS.jpg" alt="UCS.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 07 Nov 2017 13:40:49 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/copy-ucs-from-part-to-assembly/m-p/7523747#M76562</guid>
      <dc:creator>GeorgK</dc:creator>
      <dc:date>2017-11-07T13:40:49Z</dc:date>
    </item>
    <item>
      <title>Re: Copy UCS from part to assembly</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/copy-ucs-from-part-to-assembly/m-p/7526312#M76619</link>
      <description>&lt;P&gt;Hi &lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/241746"&gt;@GeorgK&lt;/a&gt;,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Try the following VBA code to copy UCS from part to assembly. Here, location of part occurrence plays important role in copying UCS. So, occurrence selection is required to copy UCS.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;Sub Main()

    Dim oDoc As AssemblyDocument
    Set oDoc = ThisApplication.ActiveDocument
    
    Dim oDef As AssemblyComponentDefinition
    Set oDef = oDoc.ComponentDefinition

    Dim oUCS As UserCoordinateSystem
    Set oUCS = ThisApplication.CommandManager.Pick(kUserCoordinateSystemFilter, "Select UCS")
    
    Dim occ As ComponentOccurrence
    Set occ = ThisApplication.CommandManager.Pick(kAssemblyOccurrenceFilter, "Select occurrence from which UCS need to copy")
    
    Dim occMatrix As Matrix
    Set occMatrix = occ.Transformation
    
    Dim oMatrix As Matrix
    Set oMatrix = oUCS.Transformation
    Call oMatrix.TransformBy(occMatrix)
       
    Dim oUCSDef As UserCoordinateSystemDefinition
    Set oUCSDef = oDef.UserCoordinateSystems.CreateDefinition
    
    oUCSDef.Transformation = oMatrix
    
    Dim copiedUCS As UserCoordinateSystem
    Set copiedUCS = oDef.UserCoordinateSystems.Add(oUCSDef)
    
End Sub
&lt;/PRE&gt;
&lt;P&gt;Please feel free to contact if there is any queries.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If solves problem, click on "Accept as solution" / give a "Kudo".&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks and regards,&lt;/P&gt;</description>
      <pubDate>Wed, 08 Nov 2017 08:45:43 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/copy-ucs-from-part-to-assembly/m-p/7526312#M76619</guid>
      <dc:creator>chandra.shekar.g</dc:creator>
      <dc:date>2017-11-08T08:45:43Z</dc:date>
    </item>
    <item>
      <title>Re: Copy UCS from part to assembly</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/copy-ucs-from-part-to-assembly/m-p/7526380#M76624</link>
      <description>&lt;P&gt;Hello &lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/4427777"&gt;@chandra.shekar.g&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;thank you very much. Now I understand the transformation. That's great. Is it possible to get the occurrence from the UCS by code?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Georg&lt;/P&gt;</description>
      <pubDate>Wed, 08 Nov 2017 09:16:38 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/copy-ucs-from-part-to-assembly/m-p/7526380#M76624</guid>
      <dc:creator>GeorgK</dc:creator>
      <dc:date>2017-11-08T09:16:38Z</dc:date>
    </item>
    <item>
      <title>Re: Copy UCS from part to assembly</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/copy-ucs-from-part-to-assembly/m-p/7526621#M76630</link>
      <description>&lt;P&gt;Hi &lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/241746"&gt;@GeorgK&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Try the following VBA code which takes occurrence from UCS and&amp;nbsp;copy UCS from part to assembly.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;Sub Main()

    Dim oDoc As AssemblyDocument
    Set oDoc = ThisApplication.ActiveDocument
    
    Dim oDef As AssemblyComponentDefinition
    Set oDef = oDoc.ComponentDefinition

    Dim oUCS As UserCoordinateSystem
    Set oUCS = ThisApplication.CommandManager.Pick(kUserCoordinateSystemFilter, "Select UCS")
    
    Dim occDef As ComponentDefinition
    Set occDef = oUCS.Parent
    
    Dim occ As ComponentOccurrence
    Dim occMatrix As Matrix
    
    For Each occ In oDef.Occurrences
        If occ.Definition Is occDef Then
            Set occMatrix = occ.Transformation
        End If
    Next
    
    If occMatrix Is Nothing Then
        Debug.Print ("UCS occurrence not found")
    Else
     
        Dim oMatrix As Matrix
        Set oMatrix = oUCS.Transformation
        Call oMatrix.TransformBy(occMatrix)
           
        Dim oUCSDef As UserCoordinateSystemDefinition
        Set oUCSDef = oDef.UserCoordinateSystems.CreateDefinition
        
        oUCSDef.Transformation = oMatrix
        
        Dim copiedUCS As UserCoordinateSystem
        Set copiedUCS = oDef.UserCoordinateSystems.Add(oUCSDef)
        
    End If
    
End Sub
&lt;/PRE&gt;
&lt;P&gt;Please feel free to contact if there is any queries.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If solves problem, click on "Accept as solution" / give a "Kudo".&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks and regards,&lt;/P&gt;</description>
      <pubDate>Wed, 08 Nov 2017 10:53:01 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/copy-ucs-from-part-to-assembly/m-p/7526621#M76630</guid>
      <dc:creator>chandra.shekar.g</dc:creator>
      <dc:date>2017-11-08T10:53:01Z</dc:date>
    </item>
    <item>
      <title>Re: Copy UCS from part to assembly</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/copy-ucs-from-part-to-assembly/m-p/7526716#M76633</link>
      <description>&lt;P&gt;Hello &lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/4427777"&gt;@chandra.shekar.g&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;thank you very much. That saves me a lot of time.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Georg&lt;/P&gt;</description>
      <pubDate>Wed, 08 Nov 2017 11:32:23 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/copy-ucs-from-part-to-assembly/m-p/7526716#M76633</guid>
      <dc:creator>GeorgK</dc:creator>
      <dc:date>2017-11-08T11:32:23Z</dc:date>
    </item>
    <item>
      <title>Re: Copy UCS from part to assembly</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/copy-ucs-from-part-to-assembly/m-p/7533316#M76706</link>
      <description>&lt;P&gt;Hello &lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/4427777"&gt;@chandra.shekar.g&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;is it possible to get the UCS from a part in a subassembly? How do I transforme the matrix?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you&lt;/P&gt;
&lt;P&gt;Georg&lt;/P&gt;</description>
      <pubDate>Fri, 10 Nov 2017 09:19:50 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/copy-ucs-from-part-to-assembly/m-p/7533316#M76706</guid>
      <dc:creator>GeorgK</dc:creator>
      <dc:date>2017-11-10T09:19:50Z</dc:date>
    </item>
    <item>
      <title>Re: Copy UCS from part to assembly</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/copy-ucs-from-part-to-assembly/m-p/7538030#M76751</link>
      <description>&lt;P&gt;Hi &lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/241746"&gt;@GeorgK&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You could try the following VBA code. Here,&amp;nbsp;only part occurrences are considered.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;Sub Main()

    Dim oDoc As AssemblyDocument
    Set oDoc = ThisApplication.ActiveDocument
    
    Dim oDef As AssemblyComponentDefinition
    Set oDef = oDoc.ComponentDefinition

    Dim oUCS As UserCoordinateSystem
    Set oUCS = ThisApplication.CommandManager.Pick(kUserCoordinateSystemFilter, "Select UCS")
    
    Dim occDef As ComponentDefinition
    Set occDef = oUCS.Parent
    
    Dim occ As ComponentOccurrence
    Dim occMatrix As Matrix
    
    For Each occ In oDef.Occurrences.AllLeafOccurrences
        If occ.Definition Is occDef Then
            Set occMatrix = occ.Transformation
            Exit For
        End If
    Next
    
    If occMatrix Is Nothing Then
        Debug.Print ("UCS occurrence not found")
    Else
     
        Dim oMatrix As Matrix
        Set oMatrix = oUCS.Transformation
        Call oMatrix.TransformBy(occMatrix)
           
        Dim oUCSDef As UserCoordinateSystemDefinition
        Set oUCSDef = oDef.UserCoordinateSystems.CreateDefinition
        
        oUCSDef.Transformation = oMatrix
        
        Dim copiedUCS As UserCoordinateSystem
        Set copiedUCS = oDef.UserCoordinateSystems.Add(oUCSDef)
        
    End If
    
End Sub

&lt;/PRE&gt;
&lt;P&gt;Please feel free to contact if there is any queries.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If solves problem, click on "Accept as solution" / give a "Kudo".&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks and regards,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 13 Nov 2017 04:21:16 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/copy-ucs-from-part-to-assembly/m-p/7538030#M76751</guid>
      <dc:creator>chandra.shekar.g</dc:creator>
      <dc:date>2017-11-13T04:21:16Z</dc:date>
    </item>
    <item>
      <title>Re: Copy UCS from part to assembly</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/copy-ucs-from-part-to-assembly/m-p/7538642#M76768</link>
      <description>&lt;P&gt;Hello &lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/4427777"&gt;@chandra.shekar.g&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;thank you very much. That solves the problem.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Georg&lt;/P&gt;</description>
      <pubDate>Mon, 13 Nov 2017 09:48:02 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/copy-ucs-from-part-to-assembly/m-p/7538642#M76768</guid>
      <dc:creator>GeorgK</dc:creator>
      <dc:date>2017-11-13T09:48:02Z</dc:date>
    </item>
  </channel>
</rss>

