<?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: Replace IAM with STP as multibody part (VBA) in Inventor Programming - iLogic, Macros, AddIns &amp; Apprentice</title>
    <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/replace-iam-with-stp-as-multibody-part-vba/m-p/6705915#M68165</link>
    <description>&lt;P&gt;Hi Tom,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;A colleague in Inventor Engineering confirms that there is not a direct way to replace a component with an SAT and have it be a part.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;gt;&amp;gt; &amp;gt;&amp;gt;&lt;/P&gt;
&lt;P&gt;If users directly specify a SAT for the ComponentOccurrence.Replace method, Inventor will import the SAT using default settings(which will import the SAT as assembly).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If the user wants to open the SAT as a single part with multiple solids, he/she can use below VBA code to import the SAT, and then save the part document and use it to replace the component:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;Sub ImportSATSample()
    Dim oSat As TranslatorAddIn
    Set oSat = ThisApplication.ApplicationAddIns.ItemById("{89162634-02B6-11D5-8E80-0010B541CD80}")

    Dim oDM As DataMedium
    Set oDM = ThisApplication.TransientObjects.CreateDataMedium
    Dim oContext As TranslationContext
    Set oContext = ThisApplication.TransientObjects.CreateTranslationContext
    oContext.Type = kDataDropIOMechanism
    
    Dim oOptions As NameValueMap
    Set oOptions = ThisApplication.TransientObjects.CreateNameValueMap
    
    oDM.MediumType = kFileNameMedium
    oDM.FileName = "C:\Temp\Sat.sat"
    
    ' Import SAT as a single part with multiple solid bodies
    oOptions.Add "ImportAASP", True
    oOptions.Add "ImportAASPIndex", 0

    Dim oDoc As PartDocument
    Set oDoc = ThisApplication.Documents.Add(kPartDocumentObject)
    
    Call oSat.Open(oDM, oContext, oOptions, oDoc)
    oDoc.SaveAs "C:\Temp\Sat.ipt", False
    
End Sub
&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;lt;&amp;lt; &amp;lt;&amp;lt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks,&lt;/P&gt;
&lt;P&gt;Wayne&lt;/P&gt;</description>
    <pubDate>Wed, 23 Nov 2016 18:01:41 GMT</pubDate>
    <dc:creator>wayne.brill</dc:creator>
    <dc:date>2016-11-23T18:01:41Z</dc:date>
    <item>
      <title>Replace IAM with STP as multibody part (VBA)</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/replace-iam-with-stp-as-multibody-part-vba/m-p/6676554#M67809</link>
      <description>&lt;P&gt;Hello&lt;/P&gt;&lt;P&gt;we replace a part of&amp;nbsp;the assemblies in a document&amp;nbsp;with generatet SAT Files. We do it manually: Save the IAM as SAT&amp;nbsp;and then with Component --&amp;gt; "Replace with..". In the dailog we choose the SAT File and under SAT-Import options&amp;nbsp;the option: &lt;EM&gt;import as a&amp;nbsp;single part&lt;/EM&gt; (or multibody part - don't know if it is the right translation). See the attached file. Then the IAM will replaced with an IPT from the SAT.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Now we will automate this process, but there is the following problem: If we replace&amp;nbsp;via VBA the IAM with the SAT File with: Call Occurence.Replace(SATFile, True)) the SAT import has as result a new Assembly, not a new Part like in the manually process.&lt;/P&gt;&lt;P&gt;So my question is: where can i find the&amp;nbsp;the possibility to import the SAT &lt;EM&gt;as a single multibody part&lt;/EM&gt; in VBA?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;We use INV1015&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks Tom&lt;/P&gt;</description>
      <pubDate>Wed, 09 Nov 2016 10:57:25 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/replace-iam-with-stp-as-multibody-part-vba/m-p/6676554#M67809</guid>
      <dc:creator>tom_schmitt</dc:creator>
      <dc:date>2016-11-09T10:57:25Z</dc:date>
    </item>
    <item>
      <title>Re: Replace IAM with STP as multibody part (VBA)</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/replace-iam-with-stp-as-multibody-part-vba/m-p/6705915#M68165</link>
      <description>&lt;P&gt;Hi Tom,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;A colleague in Inventor Engineering confirms that there is not a direct way to replace a component with an SAT and have it be a part.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;gt;&amp;gt; &amp;gt;&amp;gt;&lt;/P&gt;
&lt;P&gt;If users directly specify a SAT for the ComponentOccurrence.Replace method, Inventor will import the SAT using default settings(which will import the SAT as assembly).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If the user wants to open the SAT as a single part with multiple solids, he/she can use below VBA code to import the SAT, and then save the part document and use it to replace the component:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;Sub ImportSATSample()
    Dim oSat As TranslatorAddIn
    Set oSat = ThisApplication.ApplicationAddIns.ItemById("{89162634-02B6-11D5-8E80-0010B541CD80}")

    Dim oDM As DataMedium
    Set oDM = ThisApplication.TransientObjects.CreateDataMedium
    Dim oContext As TranslationContext
    Set oContext = ThisApplication.TransientObjects.CreateTranslationContext
    oContext.Type = kDataDropIOMechanism
    
    Dim oOptions As NameValueMap
    Set oOptions = ThisApplication.TransientObjects.CreateNameValueMap
    
    oDM.MediumType = kFileNameMedium
    oDM.FileName = "C:\Temp\Sat.sat"
    
    ' Import SAT as a single part with multiple solid bodies
    oOptions.Add "ImportAASP", True
    oOptions.Add "ImportAASPIndex", 0

    Dim oDoc As PartDocument
    Set oDoc = ThisApplication.Documents.Add(kPartDocumentObject)
    
    Call oSat.Open(oDM, oContext, oOptions, oDoc)
    oDoc.SaveAs "C:\Temp\Sat.ipt", False
    
End Sub
&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;lt;&amp;lt; &amp;lt;&amp;lt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks,&lt;/P&gt;
&lt;P&gt;Wayne&lt;/P&gt;</description>
      <pubDate>Wed, 23 Nov 2016 18:01:41 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/replace-iam-with-stp-as-multibody-part-vba/m-p/6705915#M68165</guid>
      <dc:creator>wayne.brill</dc:creator>
      <dc:date>2016-11-23T18:01:41Z</dc:date>
    </item>
    <item>
      <title>Re: Replace IAM with STP as multibody part (VBA)</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/replace-iam-with-stp-as-multibody-part-vba/m-p/6707311#M68170</link>
      <description>&lt;P&gt;Hello Wayne,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;thanks a lot for your reply.&lt;/P&gt;&lt;P&gt;I already found the same solution of the problem and with this method it runs really good.&lt;/P&gt;&lt;P&gt;You havte to save the part as a SAT, import the SAT file in this way (over the ImportAASPIndex feature), save the file as IPT and then replace the IAM with this IPT.&lt;/P&gt;&lt;P&gt;The macro helps my &lt;SPAN&gt;&lt;SPAN&gt;colleagues to save time by reducing their manually work.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;SPAN&gt;One thing i noticed: If i make the manual way (Component-&amp;gt;Replace) the ipt will be smaller (30%) and has another structure. See the pictures. &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;SPAN&gt;I have to find out, which other parameter from the ValueMap of the AddIn is responsible for this.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;SPAN&gt;Problem is that i doesnt find any docu in detail.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;SPAN&gt;BR &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;SPAN&gt;Tom&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;SPAN&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="automatic import" style="width: 215px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/295930iF4DB00625F1ADB95/image-size/large?v=v2&amp;amp;px=999" role="button" title="2.JPG" alt="2.JPG" /&gt;&lt;/span&gt;﻿&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="manual import" style="width: 205px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/295931i7C97F70D8AC2B6EF/image-size/large?v=v2&amp;amp;px=999" role="button" title="1.JPG" alt="1.JPG" /&gt;&lt;/span&gt;﻿&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 24 Nov 2016 08:03:57 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/replace-iam-with-stp-as-multibody-part-vba/m-p/6707311#M68170</guid>
      <dc:creator>tom_schmitt</dc:creator>
      <dc:date>2016-11-24T08:03:57Z</dc:date>
    </item>
  </channel>
</rss>

