<?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 How to read all component in assembly in Inventor Programming - iLogic, Macros, AddIns &amp; Apprentice</title>
    <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/how-to-read-all-component-in-assembly/m-p/8034500#M84831</link>
    <description>&lt;P&gt;How to read all component&amp;nbsp;if we use apprentice.&lt;/P&gt;&lt;P&gt;We can read all document if we use AllReferencedDocuments. But I don't see option for replace component in this mode.&amp;nbsp; But we can replace component if use ReferencedDocumentDescriptors. But in this mode just read all component in level 1.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please tell me how to read all component in referenced document or how to replace component in All Referenced Document.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here's my code.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;Sub ReplaceComponent()
        ' Create an instance of Apprentice.
        Dim apprentice As New Inventor.ApprenticeServerComponent
        ' Open a document.
        Dim doc As Inventor.ApprenticeServerDocument
        doc = apprentice.Open(FilePath)
        'Me-Replace component
        For Each docDes As Inventor.DocumentDescriptor In doc.ReferencedDocumentDescriptors
            Console.WriteLine(docDes.ReferencedFileDescriptor.FullFileName)
            'If docDes.ReferencedFileDescriptor.FullFileName = OldName Then
            '    Console.WriteLine("--&amp;gt;" &amp;amp; NewName)
            '    'docDes.ReferencedFileDescriptor.ReplaceReference(newPartFile)
            '    'fileSave.AddFileToSave(NewDoc, NewDoc.FullFileName)
            '    'fileSave.ExecuteSave()
            '    'Return
            'End If
        Next
    End Sub&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 30 May 2018 07:58:19 GMT</pubDate>
    <dc:creator>abilabib</dc:creator>
    <dc:date>2018-05-30T07:58:19Z</dc:date>
    <item>
      <title>How to read all component in assembly</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/how-to-read-all-component-in-assembly/m-p/8034500#M84831</link>
      <description>&lt;P&gt;How to read all component&amp;nbsp;if we use apprentice.&lt;/P&gt;&lt;P&gt;We can read all document if we use AllReferencedDocuments. But I don't see option for replace component in this mode.&amp;nbsp; But we can replace component if use ReferencedDocumentDescriptors. But in this mode just read all component in level 1.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please tell me how to read all component in referenced document or how to replace component in All Referenced Document.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here's my code.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;Sub ReplaceComponent()
        ' Create an instance of Apprentice.
        Dim apprentice As New Inventor.ApprenticeServerComponent
        ' Open a document.
        Dim doc As Inventor.ApprenticeServerDocument
        doc = apprentice.Open(FilePath)
        'Me-Replace component
        For Each docDes As Inventor.DocumentDescriptor In doc.ReferencedDocumentDescriptors
            Console.WriteLine(docDes.ReferencedFileDescriptor.FullFileName)
            'If docDes.ReferencedFileDescriptor.FullFileName = OldName Then
            '    Console.WriteLine("--&amp;gt;" &amp;amp; NewName)
            '    'docDes.ReferencedFileDescriptor.ReplaceReference(newPartFile)
            '    'fileSave.AddFileToSave(NewDoc, NewDoc.FullFileName)
            '    'fileSave.ExecuteSave()
            '    'Return
            'End If
        Next
    End Sub&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 30 May 2018 07:58:19 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/how-to-read-all-component-in-assembly/m-p/8034500#M84831</guid>
      <dc:creator>abilabib</dc:creator>
      <dc:date>2018-05-30T07:58:19Z</dc:date>
    </item>
    <item>
      <title>Re: How to read all component in assembly</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/how-to-read-all-component-in-assembly/m-p/8034971#M84836</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/688382"&gt;@abilabib&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hoping that below forum link would help&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://forums.autodesk.com/t5/inventor-customization/apprenticeservercomponent-replacereference-errors/td-p/5871842" target="_blank"&gt;https://forums.autodesk.com/t5/inventor-customization/apprenticeservercomponent-replacereference-errors/td-p/5871842&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks and regards,&lt;/P&gt;</description>
      <pubDate>Wed, 30 May 2018 11:57:31 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/how-to-read-all-component-in-assembly/m-p/8034971#M84836</guid>
      <dc:creator>chandra.shekar.g</dc:creator>
      <dc:date>2018-05-30T11:57:31Z</dc:date>
    </item>
    <item>
      <title>Re: How to read all component in assembly</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/how-to-read-all-component-in-assembly/m-p/8040009#M84932</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/4427777"&gt;@chandra.shekar.g&lt;/a&gt;&amp;nbsp;: Thanks for your reply.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 01 Jun 2018 03:27:41 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/how-to-read-all-component-in-assembly/m-p/8040009#M84932</guid>
      <dc:creator>abilabib</dc:creator>
      <dc:date>2018-06-01T03:27:41Z</dc:date>
    </item>
  </channel>
</rss>

