<?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: Simplify assembly to part with API in Inventor Programming Forum</title>
    <link>https://forums.autodesk.com/t5/inventor-programming-forum/simplify-assembly-to-part-with-api/m-p/14068665#M179912</link>
    <description>&lt;P&gt;Thank you for your advice - it's great food for thought. The plugin is intended for a much more complex and varied assembly in the future, but there won't be any "floating" parts that would create a second body. Further abstraction is definitely in the cards just as an extra layer of protection, but that can be tinkered with when working with the target assembly later on.&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 27 Mar 2026 13:03:05 GMT</pubDate>
    <dc:creator>relicseekerharry</dc:creator>
    <dc:date>2026-03-27T13:03:05Z</dc:date>
    <item>
      <title>Simplify assembly to part with API</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/simplify-assembly-to-part-with-api/m-p/14065891#M179870</link>
      <description>&lt;P&gt;Hello Forum,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have been trying to make a plugin for my web application in C# that simplifies an assembly into a part then exports it as .stp. So far, I have been able to do the .stp stuff just fine.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However, the simplification part is eluding me. I have been using&amp;nbsp;&lt;A href="https://help.autodesk.com/view/INVNTOR/2025/ENU/?guid=DerivedAssemblyComponents_Add_Sample" target="_blank"&gt;Inventor 2025 Help | Derived Parts and Assemblies | Autodesk&lt;/A&gt;&amp;nbsp;as a reference, but cannot add the uniformDef as a derived part as the input is an assembly. The following is the top part of my ExportSTP method, before the working STP logic:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;public void ExportSTP(Document doc)
{
            var inventorApp = _inventorApplication;
            var startDir = System.IO.Directory.GetCurrentDirectory();

            var fileName = System.IO.Path.Combine(startDir, "Output.stp");
          
            PartDocument derivedPartDoc = null;

            try
            {
                if (doc.DocumentType == DocumentTypeEnum.kAssemblyDocumentObject)
                {
                    LogTrace($"Attempt to create derived part from assembly {doc.File.FullFileName}");

                    var tempPartPath = System.IO.Path.Combine(startDir, "DerivedPart.ipt");

                    derivedPartDoc = (PartDocument)inventorApp.Documents.Add(DocumentTypeEnum.kPartDocumentObject, inventorApp.FileManager.GetTemplateFile(DocumentTypeEnum.kPartDocumentObject), true);

                    // create uniform scale definition
                    var uniformDef = derivedPartDoc.ComponentDefinition.ReferenceComponents.DerivedPartComponents.CreateUniformScaleDef(doc.FullFileName);
                    uniformDef.ScaleFactor = 1.0;

                    // cast type for DerivedPartComponents.Add()
                    DerivedPartDefinition derivedDef = (DerivedPartDefinition)uniformDef;

                    derivedPartDoc.ComponentDefinition.ReferenceComponents.DerivedPartComponents.Add(derivedDef);
                    derivedPartDoc.SaveAs(tempPartPath, false);

                    LogTrace($"Successfully created derived part {derivedPartDoc.DisplayName}");

                }
            }
            catch (Exception ex)
            {
                LogError($"Failed to derive part: {ex.Message}");
                return;
            }&lt;/LI-CODE&gt;&lt;P&gt;It doesn't necessarily have to be a derived part - just as long as there is no way to split the .stp output back into assembly components. With just my .stp logic, I have been able to download an assembly as .stp then open it in Inventor and get all the components back, which is what I need to prevent.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The target workflow for the above snippet is: Input .iam -&amp;gt; simplify to .ipt -&amp;gt; convert and export .stp&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any help on reaching my goal would be greatly appreciated, thank you!&lt;/P&gt;</description>
      <pubDate>Wed, 25 Mar 2026 12:08:29 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/simplify-assembly-to-part-with-api/m-p/14065891#M179870</guid>
      <dc:creator>relicseekerharry</dc:creator>
      <dc:date>2026-03-25T12:08:29Z</dc:date>
    </item>
    <item>
      <title>Re: Simplify assembly to part with API</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/simplify-assembly-to-part-with-api/m-p/14066367#M179881</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/16835864"&gt;@relicseekerharry&lt;/a&gt;.&amp;nbsp; This is not something I do by code regularly, but I have a decent understanding of how it is done by code anyways.&amp;nbsp; In Line 21 of your example code above, you are using the&amp;nbsp;&lt;A href="https://help.autodesk.com/view/INVNTOR/2026/ENU/?guid=ReferenceComponents_DerivedPartComponents" target="_blank" rel="noopener"&gt;ReferenceComponents.DerivedPartComponents&lt;/A&gt;&amp;nbsp;Property, when you should be using the&amp;nbsp;&lt;A href="https://help.autodesk.com/view/INVNTOR/2026/ENU/?guid=ReferenceComponents_DerivedAssemblyComponents" target="_blank" rel="noopener"&gt;ReferenceComponents.DerivedAssemblyComponents&lt;/A&gt;&amp;nbsp;Property, because you are 'deriving in' an assembly file, not a part file.&amp;nbsp; And the&amp;nbsp;&lt;A href="https://help.autodesk.com/view/INVNTOR/2026/ENU/?guid=GUID-DerivedAssemblyDefinition" target="_blank" rel="noopener"&gt;DerivedAssemblyDefinition&lt;/A&gt;&amp;nbsp;Type variable should be created before that line, with that line setting its value.&amp;nbsp; That way you can set further property values of that definition object, before using it to create a new&amp;nbsp;&lt;A href="https://help.autodesk.com/view/INVNTOR/2026/ENU/?guid=GUID-DerivedAssemblyComponent" target="_blank" rel="noopener"&gt;DerivedAssemblyComponent&lt;/A&gt;.&amp;nbsp; One of the properties of the definition you may want to make sure to set is the&amp;nbsp;&lt;A href="https://help.autodesk.com/view/INVNTOR/2026/ENU/?guid=DerivedAssemblyDefinition_DeriveStyle" target="_blank" rel="noopener"&gt;DerivedAssemblyDefinition.DeriveStyle&lt;/A&gt;, to either the&amp;nbsp;DerivedComponentStyleEnum.&lt;SPAN&gt;kDeriveAsSingleBodyNoSeams or&amp;nbsp;DerivedComponentStyleEnum.kDeriveAsSingleBodyWithSeams value, to make it all one part, instead of the 'multi-body' variation.&amp;nbsp; That way it most likely will not be interpreted as representing an assembly, instead of a part later by the &lt;A href="https://help.autodesk.com/view/INVNTOR/2026/ENU/?guid=GUID-TranslatorAddIn" target="_blank" rel="noopener"&gt;TranslatorAddIn&lt;/A&gt;.&amp;nbsp; Then later, it may be necessary to use the&amp;nbsp;&lt;A href="https://help.autodesk.com/view/INVNTOR/2026/ENU/?guid=DerivedAssemblyComponent_BreakLinkToFile" target="_blank" rel="noopener"&gt;DerivedAssemblyComponent.BreakLinkToFile&lt;/A&gt;&amp;nbsp;Method, so it can not trace its origins back to an assembly file.&amp;nbsp; Just my initial thoughts.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 25 Mar 2026 17:42:45 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/simplify-assembly-to-part-with-api/m-p/14066367#M179881</guid>
      <dc:creator>WCrihfield</dc:creator>
      <dc:date>2026-03-25T17:42:45Z</dc:date>
    </item>
    <item>
      <title>Re: Simplify assembly to part with API</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/simplify-assembly-to-part-with-api/m-p/14068463#M179907</link>
      <description>&lt;P&gt;Good morning Wesley, thank you for your detailed explanation.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I achieved desirable effect with Shrinkwrap and opening the output doesn't seem to be traceable to an assembly as the solid bodies show no parents. However, it does have two solids which wasn't expected, especially considering kDeriveAsSingleBodyNoSeams was used! I have attached the output .stp for reference - originally Autodesk's sample wheel assembly&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;public void ExportSTP(Document doc)
{
    LogTrace("Simplify assembly then export STP file.");

    var inventorApp = _inventorApplication;
    var startDir = System.IO.Directory.GetCurrentDirectory();

    var fileName = System.IO.Path.Combine(startDir, "Output.stp");
    var tempPartPath = System.IO.Path.Combine(startDir, "DerivedPart.ipt");

    PartDocument partDoc = null;

    if (doc.DocumentType == DocumentTypeEnum.kAssemblyDocumentObject)
    {
        try
        {
            
            LogTrace($"Attempt to simplify assembly: {doc.FullFileName}");

            partDoc = (PartDocument)_inventorApplication.Documents.Add(DocumentTypeEnum.kPartDocumentObject, _inventorApplication.FileManager.GetTemplateFile(DocumentTypeEnum.kPartDocumentObject));
            PartComponentDefinition partCompDef = partDoc.ComponentDefinition;

            ShrinkwrapDefinition derivedDef = partCompDef.ReferenceComponents.ShrinkwrapComponents.CreateDefinition(doc.FullDocumentName);
            
            derivedDef.DeriveStyle = DerivedComponentStyleEnum.kDeriveAsSingleBodyNoSeams;
            derivedDef.RemoveAllInternalVoids = true;

            ShrinkwrapComponent derivedComp = partCompDef.ReferenceComponents.ShrinkwrapComponents.Add(derivedDef);

            partDoc.SaveAs(tempPartPath,false);

            LogTrace($"Assembly simplified successfully to {tempPartPath}");
        }
        catch (Exception ex)
        {
            LogError($"Failed to simplify assembly: {ex.Message}");
            return;
        }
    }&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 27 Mar 2026 10:13:39 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/simplify-assembly-to-part-with-api/m-p/14068463#M179907</guid>
      <dc:creator>relicseekerharry</dc:creator>
      <dc:date>2026-03-27T10:13:39Z</dc:date>
    </item>
    <item>
      <title>Re: Simplify assembly to part with API</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/simplify-assembly-to-part-with-api/m-p/14068572#M179909</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/16835864"&gt;@relicseekerharry&lt;/a&gt;.&amp;nbsp; Glad to hear you found a process that is working OK for you.&amp;nbsp; I just downloaded, opened, and reviewed the STEP file.&amp;nbsp; I am not really surprised by the results.&amp;nbsp; All bodies that were physically touching each other look like they were 'Joined' by Union type Boolean operations onto a single body.&amp;nbsp; However, the break disk (which got joined with the wheel rim) never touches the inner wheel hub or the break calipers/pads.&amp;nbsp; The hub, calipers, and pads are touching each other though, so they got joined together into one body, as expected.&amp;nbsp; These processes likely utilize the &lt;A href="https://help.autodesk.com/view/INVNTOR/2026/ENU/?guid=TransientBRep_DoBoolean" target="_blank" rel="noopener"&gt;TransientBRep.DoBoolean&lt;/A&gt;&amp;nbsp;method (and other similar methods) to perform the common 'Boolean operations' on all the bodies.&amp;nbsp; I'm not sure if switching the derived component style to the 'with seams' variation would make any difference, but could be tested.&amp;nbsp; Another setting/option that should definitely be looked into is the&amp;nbsp;&lt;A href="https://help.autodesk.com/view/INVNTOR/2026/ENU/?guid=ShrinkwrapDefinition_CreateIndependentBodiesOnFailedBoolean" target="_blank" rel="noopener"&gt;ShrinkwrapDefinition.CreateIndependentBodiesOnFailedBoolean&lt;/A&gt;&amp;nbsp;Property.&amp;nbsp; I pretty much never use the shrink wrap variation where I work, but I do a lot of manual deriving of parts or assemblies into other parts representing purchased stuff, which are mostly used for visual aids in our larger assemblies.&amp;nbsp; I'm guessing that maybe setting&amp;nbsp; the&amp;nbsp;&lt;A href="https://help.autodesk.com/view/INVNTOR/2026/ENU/?guid=ShrinkwrapDefinition_EnvelopesReplaceStyle" target="_blank" rel="noopener"&gt;ShrinkwrapDefinition.EnvelopesReplaceStyle&lt;/A&gt;&amp;nbsp;Property could be set to the&amp;nbsp;EnvelopesReplaceStyleEnum.kAllInOneEnvelopeReplaceStyle, but I'm honestly not sure how that works.&amp;nbsp; That type of definition does have a lot of interesting properties for helping to remove unwanted/unnecessary geometry in the final model though.&amp;nbsp; I'm just not sure if any of them match the exact scenario with that wheel assembly model.&lt;/P&gt;</description>
      <pubDate>Fri, 27 Mar 2026 11:45:10 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/simplify-assembly-to-part-with-api/m-p/14068572#M179909</guid>
      <dc:creator>WCrihfield</dc:creator>
      <dc:date>2026-03-27T11:45:10Z</dc:date>
    </item>
    <item>
      <title>Re: Simplify assembly to part with API</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/simplify-assembly-to-part-with-api/m-p/14068665#M179912</link>
      <description>&lt;P&gt;Thank you for your advice - it's great food for thought. The plugin is intended for a much more complex and varied assembly in the future, but there won't be any "floating" parts that would create a second body. Further abstraction is definitely in the cards just as an extra layer of protection, but that can be tinkered with when working with the target assembly later on.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 27 Mar 2026 13:03:05 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/simplify-assembly-to-part-with-api/m-p/14068665#M179912</guid>
      <dc:creator>relicseekerharry</dc:creator>
      <dc:date>2026-03-27T13:03:05Z</dc:date>
    </item>
  </channel>
</rss>

