<?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: Select and extraction informations of  multiple drawings selection. (VBA/ AP in Inventor Programming Forum</title>
    <link>https://forums.autodesk.com/t5/inventor-programming-forum/select-and-extraction-informations-of-multiple-drawings/m-p/8701574#M77199</link>
    <description>&lt;P&gt;Apprentice is also Inventor, like "striped"&lt;/P&gt;
&lt;P&gt;apprentice can't do everything that Inventor can, but what it can, it does it verry quick!. so with properties you can us it. mind you all documents have to be migrarted to the version of Inventor that you are using, or Apprentice will give an error.&lt;/P&gt;
&lt;P&gt;other wise you need Inventor...&lt;/P&gt;
&lt;P&gt;what is your question...? How to automate the process without using "ActiveDocument" when I set the value oDrawDoc which require inventor to be open.....&lt;/P&gt;
&lt;P&gt;what would you like... no Inventor? what is the problem with option 2?&lt;/P&gt;
&lt;P&gt;you could open a document but not displaying it:&lt;/P&gt;
&lt;P&gt;Documents.Open( &lt;STRONG&gt;&lt;I&gt;FullDocumentName&lt;/I&gt;&lt;/STRONG&gt; As String, [&lt;STRONG&gt;&lt;I&gt;OpenVisible&lt;/I&gt;&lt;/STRONG&gt;] As Boolean ) As Document&lt;/P&gt;</description>
    <pubDate>Tue, 02 Apr 2019 14:56:58 GMT</pubDate>
    <dc:creator>HermJan.Otterman</dc:creator>
    <dc:date>2019-04-02T14:56:58Z</dc:date>
    <item>
      <title>Select and extraction informations of  multiple drawings selection. (VBA/ API)</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/select-and-extraction-informations-of-multiple-drawings/m-p/8701341#M77198</link>
      <description>&lt;P&gt;Hi Guys!&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The goal is to extract information from Title Boxes of a Drawing file.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Firstly i use some simple code in order to get iProprieties&amp;nbsp;from some drawings. That works perfectly but in some drawings the Title Boxes are filled Manually (Without using iProp).&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I started looking for the variable where the values of the title box are.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;According to my research, there are&amp;nbsp; 2 ways to access&amp;nbsp; this information using VBA:&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;- Using Apprentice Server:&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Dim oSheet As Worksheet&lt;BR /&gt;Set oSheet = Application.ActiveSheet&lt;/P&gt;
&lt;P&gt;Dim fd As FileDialog&lt;BR /&gt;Set fd = Application.FileDialog(msoFileDialogFilePicker)&lt;/P&gt;
&lt;P&gt;Dim vrtSelectedItem As Variant&lt;/P&gt;
&lt;P&gt;' create Apprentice server for reading into the file&lt;BR /&gt;Dim oIV As New ApprenticeServerComponent&lt;BR /&gt;Dim oIVDoc As ApprenticeServerDrawingDocument&lt;/P&gt;
&lt;P&gt;'Use the Show method to display the File Picker dialog box and return the user's action.&lt;BR /&gt;'The user pressed the action button.&lt;BR /&gt;If fd.Show = -1 Then.&lt;BR /&gt;&lt;BR /&gt;For Each vrtSelectedItem In fd.SelectedItems&lt;BR /&gt;&lt;BR /&gt;Set oIVDoc = oIV.Open(vrtSelectedItem)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Next vrtSelectedItem&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Using a spy on the variable&amp;nbsp;&lt;STRONG&gt;oIVDoc (&lt;/STRONG&gt;ApprenticeDrawingDocument)&lt;STRONG style="font-family: inherit;"&gt;&amp;nbsp;&lt;/STRONG&gt;&lt;SPAN style="font-family: inherit;"&gt;i could access to the values of all variables of. However&amp;nbsp;I couldn't get the values of variables which contains the values of the title block (Way: oIVDoc -&amp;gt; Sheets -&amp;gt;Item 1-&amp;gt;TitleBlock bellow)&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-family: inherit;"&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Title_Box_error.PNG" style="width: 745px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/621370iFE950E31D209B265/image-size/large?v=v2&amp;amp;px=999" role="button" title="Title_Box_error.PNG" alt="Title_Box_error.PNG" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;it says there is an error defined by the application or the object.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;- The second way&amp;nbsp;to access values of title boxes is to use the class DrawingDocument:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Dim vrtSelectedItem As Variant&lt;BR /&gt;Dim SelectedItem As Variant&lt;/P&gt;
&lt;P&gt;Dim invApp As Object&lt;BR /&gt;Set invApp = GetObject(, "Inventor.Application")&lt;/P&gt;
&lt;P&gt;Dim oDrawDoc As DrawingDocument&lt;/P&gt;
&lt;P&gt;Dim fd As FileDialog&lt;BR /&gt;Set fd = Application.FileDialog(msoFileDialogFilePicker)If fd.Show = -1 Then&lt;/P&gt;
&lt;P&gt;For Each vrtSelectedItem In fd.SelectedItems&lt;BR /&gt;Dim DrawingFile As Document&lt;BR /&gt;Set DrawingFile = invApp.Documents.Open(vrtSelectedItem)&lt;BR /&gt;Set oDrawDoc = invApp.ActiveDocument&lt;/P&gt;
&lt;P&gt;Next&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Using that solution I could get the values of each box in the title box using the way:&amp;nbsp;&lt;/P&gt;
&lt;P&gt;oDrawdoc (Spy) -&amp;gt;TitleBlockDefinitions-&amp;gt;Sketch-&amp;gt;TextBoxes&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Result Titleblock.PNG" style="width: 860px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/621400iF710182251BD8B7D/image-size/large?v=v2&amp;amp;px=999" role="button" title="Result Titleblock.PNG" alt="Result Titleblock.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;using (GetResultText()) i could get the value thati wanted&amp;nbsp; finally!&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;BUT&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In that second solution the drawing document must be ACTIVE (Open on Inventor during processing).&amp;nbsp;&lt;/P&gt;
&lt;P&gt;My question are:&amp;nbsp;&lt;/P&gt;
&lt;P&gt;How to automate the process without using "ActiveDocument" when I set the value oDrawDoc which require inventor to be open ?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Can we use the ApprenticeServer to get these values?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks !&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Ayoub&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Chbani&lt;/P&gt;
&lt;P&gt;Engineer intern (BaguetteLand)&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 02 Apr 2019 13:34:46 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/select-and-extraction-informations-of-multiple-drawings/m-p/8701341#M77198</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-04-02T13:34:46Z</dc:date>
    </item>
    <item>
      <title>Re: Select and extraction informations of  multiple drawings selection. (VBA/ AP</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/select-and-extraction-informations-of-multiple-drawings/m-p/8701574#M77199</link>
      <description>&lt;P&gt;Apprentice is also Inventor, like "striped"&lt;/P&gt;
&lt;P&gt;apprentice can't do everything that Inventor can, but what it can, it does it verry quick!. so with properties you can us it. mind you all documents have to be migrarted to the version of Inventor that you are using, or Apprentice will give an error.&lt;/P&gt;
&lt;P&gt;other wise you need Inventor...&lt;/P&gt;
&lt;P&gt;what is your question...? How to automate the process without using "ActiveDocument" when I set the value oDrawDoc which require inventor to be open.....&lt;/P&gt;
&lt;P&gt;what would you like... no Inventor? what is the problem with option 2?&lt;/P&gt;
&lt;P&gt;you could open a document but not displaying it:&lt;/P&gt;
&lt;P&gt;Documents.Open( &lt;STRONG&gt;&lt;I&gt;FullDocumentName&lt;/I&gt;&lt;/STRONG&gt; As String, [&lt;STRONG&gt;&lt;I&gt;OpenVisible&lt;/I&gt;&lt;/STRONG&gt;] As Boolean ) As Document&lt;/P&gt;</description>
      <pubDate>Tue, 02 Apr 2019 14:56:58 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/select-and-extraction-informations-of-multiple-drawings/m-p/8701574#M77199</guid>
      <dc:creator>HermJan.Otterman</dc:creator>
      <dc:date>2019-04-02T14:56:58Z</dc:date>
    </item>
    <item>
      <title>Re: Select and extraction informations of  multiple drawings selection. (VBA/ AP</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/select-and-extraction-informations-of-multiple-drawings/m-p/8704641#M77200</link>
      <description>&lt;P&gt;Hi Herm,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you for your reply. indeed the apprentice server does operations quickly compared to Inventor, the final goal is to scan all our Drawings database and c&lt;SPAN style="font-family: inherit;"&gt;reate an excel sheet which specifies all information&amp;nbsp;according to&amp;nbsp;Drawings: Engine, part number, sub Assembly: That will allow operators to access to a drawings file just by making a search&amp;nbsp;by Keyword.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-family: inherit;"&gt;The apprentice server should allow me to do this as "background" operation without loading each file on inventor&amp;nbsp;software get the result and then close that file.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-family: inherit;"&gt;I just tried to open the file as you said and that works perfectly without displaying the drawing that reduces&amp;nbsp;the processing time.&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-family: inherit;"&gt;Do I have to Close the file after each iteration with:&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-family: inherit;"&gt;Set DrawingFile = invApp.Document.Close(True)&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-family: inherit;"&gt;Or there is a better solution?&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-family: inherit;"&gt;&amp;nbsp;While opening some files a window pop up with due to mismatching&amp;nbsp;links according to a picture on the drawing file which doesn't match:&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-family: inherit;"&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Pop window.PNG" style="width: 828px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/622033i2AA94CD2FA66E231/image-size/large?v=v2&amp;amp;px=999" role="button" title="Pop window.PNG" alt="Pop window.PNG" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;Do you know how to get rid of that windows which slow down the process time ?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks !&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Ayoub&lt;/P&gt;</description>
      <pubDate>Wed, 03 Apr 2019 14:29:14 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/select-and-extraction-informations-of-multiple-drawings/m-p/8704641#M77200</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-04-03T14:29:14Z</dc:date>
    </item>
    <item>
      <title>Re: Select and extraction informations of  multiple drawings selection. (VBA/ AP</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/select-and-extraction-informations-of-multiple-drawings/m-p/8705638#M77201</link>
      <description>&lt;P&gt;yes, I would close the drawings, when you are done with them!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;you can prevent the dialogboxes in Inventor with : &lt;SPAN style="line-height: 140%;"&gt; _InvApplication.SilentOperation = True&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="line-height: 140%;"&gt;what you are describing, you want to use this to create an excel file for properties and links to other files.... maybe you should install and use Vault....! it comes with Inventor and then you have this all and more...&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 03 Apr 2019 19:46:53 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/select-and-extraction-informations-of-multiple-drawings/m-p/8705638#M77201</guid>
      <dc:creator>HermJan.Otterman</dc:creator>
      <dc:date>2019-04-03T19:46:53Z</dc:date>
    </item>
  </channel>
</rss>

