<?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: iLogic Help: Saving all parts in assembly in Inventor Programming - iLogic, Macros, AddIns &amp; Apprentice</title>
    <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/ilogic-help-saving-all-parts-in-assembly-amp-subassemblies-into/m-p/8302678#M89419</link>
    <description>iLogic.&lt;BR /&gt;I brought a friend in to have a look and now this stage is working.&lt;BR /&gt;Once the code is cleaned up I'll upload as a solution.&lt;BR /&gt;</description>
    <pubDate>Sun, 30 Sep 2018 12:54:21 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2018-09-30T12:54:21Z</dc:date>
    <item>
      <title>iLogic Help: Saving all parts in assembly &amp; subassemblies into a folder.</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/ilogic-help-saving-all-parts-in-assembly-amp-subassemblies-into/m-p/8301783#M89415</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;Background:&lt;/P&gt;&lt;P&gt;I am making a process for creating models from pre-existing assemblies and then saving it all together&amp;nbsp;including sub-assembly parts in a project folder.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I plan on&amp;nbsp;then working out how to replace the references with the newly required parts.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The code below gets an error on this line&lt;/P&gt;&lt;PRE&gt;&lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;oPartDoc&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;Inventor&lt;/SPAN&gt;.&lt;SPAN&gt;PartDocument&lt;/SPAN&gt;	&lt;/PRE&gt;&lt;P&gt;and probably quite a few other errors.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I repurposed this from a piece i found for iterating through subassemblies parts and listing them to change the material.&lt;/P&gt;&lt;PRE&gt;&lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;CreateNewModel&lt;/SPAN&gt; = &lt;SPAN&gt;String&lt;/SPAN&gt;.&lt;SPAN&gt;Format&lt;/SPAN&gt;(&lt;SPAN&gt;"C:\Here\Drawings\{0}-{1}\Drawings\Rev0\{0}-{1}.iam"&lt;/SPAN&gt;, &lt;SPAN&gt;DrawingReference&lt;/SPAN&gt;, &lt;SPAN&gt;ProjectName&lt;/SPAN&gt;)
&lt;SPAN&gt;ThisDoc&lt;/SPAN&gt;.&lt;SPAN&gt;Document&lt;/SPAN&gt;.&lt;SPAN&gt;SaveAs&lt;/SPAN&gt;(&lt;SPAN&gt;CreateNewModel&lt;/SPAN&gt;, &lt;SPAN&gt;True&lt;/SPAN&gt;)
			
&lt;SPAN&gt;MessageBox&lt;/SPAN&gt;.&lt;SPAN&gt;Show&lt;/SPAN&gt;(&lt;SPAN&gt;"New Project Save Successful"&lt;/SPAN&gt;, &lt;SPAN&gt;"Save New"&lt;/SPAN&gt;)

   &lt;SPAN&gt;' Get the active assembly document. &lt;/SPAN&gt;
&lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;oAsmDoc&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;AssemblyDocument&lt;/SPAN&gt;  
&lt;SPAN&gt;oAsmDoc&lt;/SPAN&gt; = &lt;SPAN&gt;ThisApplication&lt;/SPAN&gt;.&lt;SPAN&gt;ActiveDocument&lt;/SPAN&gt; 
   
    &lt;SPAN&gt;' Iterate through all of the documents refrenced by the assembly. &lt;/SPAN&gt;
    &lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;oDoc&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;Document&lt;/SPAN&gt;
    &lt;SPAN&gt;For&lt;/SPAN&gt; &lt;SPAN&gt;Each&lt;/SPAN&gt; &lt;SPAN&gt;oDoc&lt;/SPAN&gt; &lt;SPAN&gt;In&lt;/SPAN&gt; &lt;SPAN&gt;oAsmDoc&lt;/SPAN&gt;.&lt;SPAN&gt;AllReferencedDocuments&lt;/SPAN&gt; 
        &lt;SPAN&gt;' Check to see if this is a part. &lt;/SPAN&gt;
        &lt;SPAN&gt;If&lt;/SPAN&gt; &lt;SPAN&gt;oDoc&lt;/SPAN&gt;.&lt;SPAN&gt;DocumentType&lt;/SPAN&gt; = &lt;SPAN&gt;kPartDocumentObject&lt;/SPAN&gt; &lt;SPAN&gt;Then&lt;/SPAN&gt; 
            &lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;oPartDoc&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;Inventor&lt;/SPAN&gt;.&lt;SPAN&gt;PartDocument&lt;/SPAN&gt;	
            &lt;SPAN&gt;oPartDoc&lt;/SPAN&gt; = &lt;SPAN&gt;oDoc&lt;/SPAN&gt; 
			&lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;PartName&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;String&lt;/SPAN&gt; = &lt;SPAN&gt;oDoc&lt;/SPAN&gt;.&lt;SPAN&gt;ToString&lt;/SPAN&gt;

            &lt;SPAN&gt;' Set the material.&lt;/SPAN&gt;
			&lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;CreatePart&lt;/SPAN&gt; = &lt;SPAN&gt;String&lt;/SPAN&gt;.&lt;SPAN&gt;Format&lt;/SPAN&gt;(&lt;SPAN&gt;"C:\Here\Drawings\{0}-{1}\Drawings\Rev0\{2}.iam"&lt;/SPAN&gt;, &lt;SPAN&gt;DrawingReference&lt;/SPAN&gt;, &lt;SPAN&gt;ProjectName&lt;/SPAN&gt;, &lt;SPAN&gt;PartName&lt;/SPAN&gt;)
            &lt;SPAN&gt;oPartDoc&lt;/SPAN&gt;.&lt;SPAN&gt;Document&lt;/SPAN&gt;.&lt;SPAN&gt;Saveas&lt;/SPAN&gt;(&lt;SPAN&gt;CreatePart&lt;/SPAN&gt;)
        &lt;SPAN&gt;End&lt;/SPAN&gt; &lt;SPAN&gt;If&lt;/SPAN&gt; 
    &lt;SPAN&gt;Next&lt;/SPAN&gt; &lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 29 Sep 2018 14:08:00 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/ilogic-help-saving-all-parts-in-assembly-amp-subassemblies-into/m-p/8301783#M89415</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-09-29T14:08:00Z</dc:date>
    </item>
    <item>
      <title>Re: iLogic Help: Saving all parts in assembly &amp; subassemblies into a folder.</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/ilogic-help-saving-all-parts-in-assembly-amp-subassemblies-into/m-p/8302079#M89416</link>
      <description>&lt;P&gt;@Anonymous&lt;/a&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Inventor programming needs and issues need to be posting in the Inventor Customization forum.&amp;nbsp; &lt;A href="https://forums.autodesk.com/t5/inventor-customization/bd-p/120&amp;nbsp;&amp;nbsp;" target="_blank"&gt;https://forums.autodesk.com/t5/inventor-customization/bd-p/120&amp;nbsp;&amp;nbsp;&lt;/A&gt; I will have the moderator relocate your posting there for better results.&lt;/P&gt;</description>
      <pubDate>Sat, 29 Sep 2018 20:36:27 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/ilogic-help-saving-all-parts-in-assembly-amp-subassemblies-into/m-p/8302079#M89416</guid>
      <dc:creator>Mark.Lancaster</dc:creator>
      <dc:date>2018-09-29T20:36:27Z</dc:date>
    </item>
    <item>
      <title>Re: iLogic Help: Saving all parts in assembly &amp; subassemblies into a folder.</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/ilogic-help-saving-all-parts-in-assembly-amp-subassemblies-into/m-p/8302401#M89417</link>
      <description>&lt;P&gt;Is this code used in I-logic or VBA or else?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;for me the code runs prefect in i-logic !&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 30 Sep 2018 06:07:30 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/ilogic-help-saving-all-parts-in-assembly-amp-subassemblies-into/m-p/8302401#M89417</guid>
      <dc:creator>bradeneuropeArthur</dc:creator>
      <dc:date>2018-09-30T06:07:30Z</dc:date>
    </item>
    <item>
      <title>Re: iLogic Help: Saving all parts in assembly</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/ilogic-help-saving-all-parts-in-assembly-amp-subassemblies-into/m-p/8302678#M89419</link>
      <description>iLogic.&lt;BR /&gt;I brought a friend in to have a look and now this stage is working.&lt;BR /&gt;Once the code is cleaned up I'll upload as a solution.&lt;BR /&gt;</description>
      <pubDate>Sun, 30 Sep 2018 12:54:21 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/ilogic-help-saving-all-parts-in-assembly-amp-subassemblies-into/m-p/8302678#M89419</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-09-30T12:54:21Z</dc:date>
    </item>
  </channel>
</rss>

