<?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: How to pass the transformation matrix to imported component inside Assembly environment in Inventor Programming - iLogic, Macros, AddIns &amp; Apprentice</title>
    <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/how-to-pass-the-transformation-matrix-to-imported-component/m-p/12774241#M167358</link>
    <description>&lt;P&gt;You can apply transformation without break link.&lt;/P&gt;&lt;LI-CODE lang="visual-basic"&gt;Dim asm As AssemblyDocument = ThisDoc.Document

Dim boxOccurrence As ComponentOccurrence = asm.ComponentDefinition.Occurrences(1).Definition.Occurrences(1)

Dim mtx As Matrix = boxOccurrence.Transformation
mtx.Cell(1, 4) += 1

boxOccurrence.Transformation = mtx&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 15 May 2024 07:14:07 GMT</pubDate>
    <dc:creator>Michael.Navara</dc:creator>
    <dc:date>2024-05-15T07:14:07Z</dc:date>
    <item>
      <title>How to pass the transformation matrix to imported component inside Assembly environment</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/how-to-pass-the-transformation-matrix-to-imported-component/m-p/12774108#M167355</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I am loading the step file as an imported component in the assembly environment by using the API.&amp;nbsp;&lt;/P&gt;&lt;P&gt;But I want to apply transformations to imported components. One way is to break the link to the imported component and apply the transformation, but for that, you need to save the assembly first and then apply the transformation. But in my case, it's not expected. Is there any other way to apply transformation?&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thanks in advance!&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 15 May 2024 05:32:28 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/how-to-pass-the-transformation-matrix-to-imported-component/m-p/12774108#M167355</guid>
      <dc:creator>dhanshri_gavas</dc:creator>
      <dc:date>2024-05-15T05:32:28Z</dc:date>
    </item>
    <item>
      <title>Re: How to pass the transformation matrix to imported component inside Assembly environment</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/how-to-pass-the-transformation-matrix-to-imported-component/m-p/12774241#M167358</link>
      <description>&lt;P&gt;You can apply transformation without break link.&lt;/P&gt;&lt;LI-CODE lang="visual-basic"&gt;Dim asm As AssemblyDocument = ThisDoc.Document

Dim boxOccurrence As ComponentOccurrence = asm.ComponentDefinition.Occurrences(1).Definition.Occurrences(1)

Dim mtx As Matrix = boxOccurrence.Transformation
mtx.Cell(1, 4) += 1

boxOccurrence.Transformation = mtx&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 15 May 2024 07:14:07 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/how-to-pass-the-transformation-matrix-to-imported-component/m-p/12774241#M167358</guid>
      <dc:creator>Michael.Navara</dc:creator>
      <dc:date>2024-05-15T07:14:07Z</dc:date>
    </item>
    <item>
      <title>Re: How to pass the transformation matrix to imported component inside Assembly environment</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/how-to-pass-the-transformation-matrix-to-imported-component/m-p/12776862#M167398</link>
      <description>&lt;P&gt;Here is my sample code I have applied transformation to the component, but nothing changes in environment.&lt;BR /&gt;before Applying the transformation&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="dhanshri_gavas_0-1715839473749.png" style="width: 600px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1363036iB40CA36BA6D7AF2D/image-size/medium?v=v2&amp;amp;px=400" role="button" title="dhanshri_gavas_0-1715839473749.png" alt="dhanshri_gavas_0-1715839473749.png" /&gt;&lt;/span&gt;&lt;BR /&gt;&lt;BR /&gt;After applying the transformation&lt;BR /&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="dhanshri_gavas_1-1715839531855.png" style="width: 600px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1363037i2E1A3D4D73743179/image-size/medium?v=v2&amp;amp;px=400" role="button" title="dhanshri_gavas_1-1715839531855.png" alt="dhanshri_gavas_1-1715839531855.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;var txn = InventorApp.TransactionManager.StartTransactionForDocumentOpen("FDX Import"); Document _document = InventorApp.ActiveDocument; AssemblyDocument aDoc = _document as AssemblyDocument; AssemblyComponentDefinition oPartCompDef = aDoc.ComponentDefinition; InventorApp.PartOptions.EnableConstructionEnvironment = false; aDoc.ObjectVisibility.Sketches = true; ObjectCollection oBodies = InventorApp.TransientObjects.CreateObjectCollection(); string filePath = "D:\\StepFiles\\CCADAEB1A99EB29F20431D6F3761692C105ADF2E.stp";//bRepGeometry.FilePath; ImportedGenericComponentDefinition impPart = (ImportedGenericComponentDefinition)oPartCompDef.ImportedComponents.CreateDefinition(filePath); impPart.ReferenceModel = true; impPart.ImportedModelGeometryTypes = ImportedModelGeometryTypeEnum.kWiresModelGeometryType | ImportedModelGeometryTypeEnum.kSolidsModelGeometryType | ImportedModelGeometryTypeEnum.kMeshesModelGeometryType | ImportedModelGeometryTypeEnum.kSurfacesModelGeometryType; oPartCompDef.ImportedComponents.Add((ImportedComponentDefinition)impPart); impPart.IncludeAll(); // ComponentOccurrence boxOccurrence = pDoc.ComponentDefinition.Occurrences(1).Definition.Occurrences(1); ComponentOccurrence oc1 = aDoc.ComponentDefinition.Occurrences[1]; TransientGeometry transientGeometry = InventorApp.TransientGeometry; Matrix transMatrix = oc1.Transformation; double[] arr = new double[16]; oc1.Transformation.PutMatrixData(ref arr); transMatrix.Cell[1, 4] = 0; transMatrix.Cell[2, 4] = 0; transMatrix.Cell[3, 4] = 1; oc1.Transformation = transMatrix; aDoc.Update2(); txn.End();&lt;/P&gt;</description>
      <pubDate>Thu, 16 May 2024 06:07:05 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/how-to-pass-the-transformation-matrix-to-imported-component/m-p/12776862#M167398</guid>
      <dc:creator>dhanshri_gavas</dc:creator>
      <dc:date>2024-05-16T06:07:05Z</dc:date>
    </item>
    <item>
      <title>Re: How to pass the transformation matrix to imported component inside Assembly environment</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/how-to-pass-the-transformation-matrix-to-imported-component/m-p/12777761#M167405</link>
      <description>&lt;P&gt;Just a tip: please use the code tags in your post (&amp;lt;/&amp;gt; button in the ribbon).&lt;/P&gt;&lt;P&gt;The code you posted is difficult to read.&lt;/P&gt;</description>
      <pubDate>Thu, 16 May 2024 12:53:48 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/how-to-pass-the-transformation-matrix-to-imported-component/m-p/12777761#M167405</guid>
      <dc:creator>_dscholtes_</dc:creator>
      <dc:date>2024-05-16T12:53:48Z</dc:date>
    </item>
    <item>
      <title>Re: How to pass the transformation matrix to imported component inside Assembly environment</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/how-to-pass-the-transformation-matrix-to-imported-component/m-p/12777818#M167408</link>
      <description>&lt;P&gt;I have a 4x4 transformation matrix. How can I directly apply that matrix to the transformation matrix?&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;            var txn = InventorApp.TransactionManager.StartTransactionForDocumentOpen("FDX Import");
            Document _document = InventorApp.ActiveDocument;
            AssemblyDocument aDoc = _document as AssemblyDocument;
            AssemblyComponentDefinition oPartCompDef = aDoc.ComponentDefinition;
            InventorApp.PartOptions.EnableConstructionEnvironment = false;
            aDoc.ObjectVisibility.Sketches = true;
            ObjectCollection oBodies = InventorApp.TransientObjects.CreateObjectCollection();
            string filePath = "D:\\StepFiles\\CCADAEB1A99EB29F20431D6F3761692C105ADF2E.stp";//bRepGeometry.FilePath;
            ImportedGenericComponentDefinition impPart = (ImportedGenericComponentDefinition)oPartCompDef.ImportedComponents.CreateDefinition(filePath);
            impPart.ReferenceModel = true;
            impPart.ImportedModelGeometryTypes = ImportedModelGeometryTypeEnum.kWiresModelGeometryType | ImportedModelGeometryTypeEnum.kSolidsModelGeometryType | ImportedModelGeometryTypeEnum.kMeshesModelGeometryType | ImportedModelGeometryTypeEnum.kSurfacesModelGeometryType;
            oPartCompDef.ImportedComponents.Add((ImportedComponentDefinition)impPart);
            impPart.IncludeAll();
            // ComponentOccurrence boxOccurrence = pDoc.ComponentDefinition.Occurrences(1).Definition.Occurrences(1);
            ComponentOccurrence oc1 = aDoc.ComponentDefinition.Occurrences[1];
            TransientGeometry transientGeometry = InventorApp.TransientGeometry;
            Matrix transMatrix = oc1.Transformation;           

            transMatrix.Cell[1, 4] = 0;
            transMatrix.Cell[2, 4] = 1;
            transMatrix.Cell[3, 4] =1;
            oc1.Transformation = transMatrix;
            txn.End();&lt;/LI-CODE&gt;</description>
      <pubDate>Thu, 16 May 2024 13:14:18 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/how-to-pass-the-transformation-matrix-to-imported-component/m-p/12777818#M167408</guid>
      <dc:creator>dhanshri_gavas</dc:creator>
      <dc:date>2024-05-16T13:14:18Z</dc:date>
    </item>
  </channel>
</rss>

