<?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: Event when Assembly/Drawing is completely opened in Inventor Programming Forum</title>
    <link>https://forums.autodesk.com/t5/inventor-programming-forum/event-when-assembly-drawing-is-completely-opened/m-p/8629649#M78312</link>
    <description>&lt;P&gt;Hi and thanks for your answer!&lt;/P&gt;
&lt;P&gt;I've just tried it but it fires too often.&lt;/P&gt;
&lt;P&gt;Here's where I've used it:&lt;/P&gt;
&lt;PRE&gt;Private Sub m_ApplicationEvents_OnOpenDocument(ByVal DocumentObject As Inventor._Document, ByVal FullFileName As String, ByVal BeforeOrAfter As Inventor.EventTimingEnum, ByVal Context As Inventor.NameValueMap, ByRef HandlingCode As Inventor.HandlingCodeEnum) Handles m_ApplicationEvents.OnOpenDocument

  If BeforeOrAfter = EventTimingEnum.kAfter Then
    'Some other code 
    If g_inventorApplication.ready = True Then
      MsgBox("ready")
    End If&lt;BR /&gt;  End If
End Sub&lt;/PRE&gt;
&lt;P&gt;And the OnReady event is triggered only once after Inventor is initialized (as described in the API help), not after opening a file.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Do I miss something here?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 01 Mar 2019 08:23:08 GMT</pubDate>
    <dc:creator>ge.ki</dc:creator>
    <dc:date>2019-03-01T08:23:08Z</dc:date>
    <item>
      <title>Event when Assembly/Drawing is completely opened</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/event-when-assembly-drawing-is-completely-opened/m-p/8628051#M78310</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Is there any event triggered, as soon as all files of an assembly (or drawing) are loaded?&lt;/P&gt;
&lt;P&gt;Inside the OpenDocument event, I watched an assembly with subassemblies opening with &lt;FONT face="courier new,courier"&gt;MsgBox(FullFileName)&lt;/FONT&gt;. The top-level file name is at least the one showing up at first (in kBefore), but after that, I don't see when it's finished.&lt;/P&gt;
&lt;P&gt;I've tried serval workarounds without success &lt;img id="smileysad" class="emoticon emoticon-smileysad" src="https://forums.autodesk.com/i/smilies/16x16_smiley-sad.png" alt="Smiley Sad" title="Smiley Sad" /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If there's nothing I guess I have to catch the assembly name in the beginning, search for all dependencies and then wait until all of them went through the opening process. But this sounds kind of cumbersome to me.&lt;/P&gt;
&lt;P&gt;I hope there's is another way...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you!&lt;/P&gt;</description>
      <pubDate>Thu, 28 Feb 2019 16:07:56 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/event-when-assembly-drawing-is-completely-opened/m-p/8628051#M78310</guid>
      <dc:creator>ge.ki</dc:creator>
      <dc:date>2019-02-28T16:07:56Z</dc:date>
    </item>
    <item>
      <title>Re: Event when Assembly/Drawing is completely opened</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/event-when-assembly-drawing-is-completely-opened/m-p/8628912#M78311</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I use "Inventor.ready = true" frequently&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Regards,&lt;/P&gt;</description>
      <pubDate>Thu, 28 Feb 2019 20:57:23 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/event-when-assembly-drawing-is-completely-opened/m-p/8628912#M78311</guid>
      <dc:creator>bradeneuropeArthur</dc:creator>
      <dc:date>2019-02-28T20:57:23Z</dc:date>
    </item>
    <item>
      <title>Re: Event when Assembly/Drawing is completely opened</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/event-when-assembly-drawing-is-completely-opened/m-p/8629649#M78312</link>
      <description>&lt;P&gt;Hi and thanks for your answer!&lt;/P&gt;
&lt;P&gt;I've just tried it but it fires too often.&lt;/P&gt;
&lt;P&gt;Here's where I've used it:&lt;/P&gt;
&lt;PRE&gt;Private Sub m_ApplicationEvents_OnOpenDocument(ByVal DocumentObject As Inventor._Document, ByVal FullFileName As String, ByVal BeforeOrAfter As Inventor.EventTimingEnum, ByVal Context As Inventor.NameValueMap, ByRef HandlingCode As Inventor.HandlingCodeEnum) Handles m_ApplicationEvents.OnOpenDocument

  If BeforeOrAfter = EventTimingEnum.kAfter Then
    'Some other code 
    If g_inventorApplication.ready = True Then
      MsgBox("ready")
    End If&lt;BR /&gt;  End If
End Sub&lt;/PRE&gt;
&lt;P&gt;And the OnReady event is triggered only once after Inventor is initialized (as described in the API help), not after opening a file.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Do I miss something here?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 01 Mar 2019 08:23:08 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/event-when-assembly-drawing-is-completely-opened/m-p/8629649#M78312</guid>
      <dc:creator>ge.ki</dc:creator>
      <dc:date>2019-03-01T08:23:08Z</dc:date>
    </item>
    <item>
      <title>Re: Event when Assembly/Drawing is completely opened</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/event-when-assembly-drawing-is-completely-opened/m-p/8704854#M78313</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have also notice the same thing.&lt;/P&gt;
&lt;P&gt;I am currently storing the context.Item["TopLevelfilename"] passed in the kBefore event and then in the kAfter event comparing the stored value against the "fulldocumentname" parameter (which is cumbersome as you have mentioned) that seems to do the trick.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Wangdu&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;coolOrange&lt;/P&gt;
&lt;P&gt;&lt;A href="http://www.coolOrange.com" target="_blank"&gt;www.coolOrange.com&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 03 Apr 2019 15:23:21 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/event-when-assembly-drawing-is-completely-opened/m-p/8704854#M78313</guid>
      <dc:creator>wangdu</dc:creator>
      <dc:date>2019-04-03T15:23:21Z</dc:date>
    </item>
    <item>
      <title>Re: Event when Assembly/Drawing is completely opened</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/event-when-assembly-drawing-is-completely-opened/m-p/8706481#M78314</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;I am far from my desk but you could try this:&lt;/P&gt;
&lt;P&gt;You could try to check the event per "DocumentObject" type.&lt;/P&gt;
&lt;P&gt;just do it for one type either:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;&lt;SPAN style="display: inline !important; float: none; background-color: #ffffff; color: #666666; cursor: text; font-family: inherit; font-size: 16px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 1.7142; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px;"&gt;DocumentObject&lt;/SPAN&gt;. type = ...Assembly&lt;/LI&gt;
&lt;LI style="box-sizing: border-box;"&gt;&lt;SPAN style="background-color: #ffffff; box-sizing: border-box; color: #666666; cursor: text; display: inline; float: none; font-family: inherit; font-size: 16px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 1.7142; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px;"&gt;DocumentObject&lt;/SPAN&gt;. type = ...Part&lt;/LI&gt;
&lt;LI style="box-sizing: border-box;"&gt;&lt;SPAN style="background-color: #ffffff; box-sizing: border-box; color: #666666; cursor: text; display: inline; float: none; font-family: inherit; font-size: 16px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 1.7142; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px;"&gt;DocumentObject&lt;/SPAN&gt;. type = ...Drawing&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;Regards,&lt;/P&gt;</description>
      <pubDate>Thu, 04 Apr 2019 06:47:34 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/event-when-assembly-drawing-is-completely-opened/m-p/8706481#M78314</guid>
      <dc:creator>bradeneuropeArthur</dc:creator>
      <dc:date>2019-04-04T06:47:34Z</dc:date>
    </item>
    <item>
      <title>Re: Event when Assembly/Drawing is completely opened</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/event-when-assembly-drawing-is-completely-opened/m-p/8706809#M78315</link>
      <description>&lt;P&gt;From your description seems the top assembly only fires the OnOpenDocument once(kBefore) and ignores the kAfter. Does this happen to all the assemblies there or only happen to specific assemblies? Can you try below EventWatcher.exe tool if you installed the DeveloperTools.msi to double check:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;C:\Users\Public\Documents\Autodesk\Inventor 2019\SDK\DeveloperTools\Tools\EventWatcher\bin\Release\EventWatcher.exe&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;1. Start Inventor.&lt;/P&gt;
&lt;P&gt;2. Run the EventWatcher.exe.&lt;/P&gt;
&lt;P&gt;3. Check the ApplicationEvents.OnOpenDocument event.&lt;/P&gt;
&lt;P&gt;4.Open your assembly.&lt;/P&gt;
&lt;P&gt;5. In the output panel, copy the results in a text editor and search if the OnOpenDocument fires for kBefore and kAfter for the assembly.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please let me what you see with the tool.&lt;/P&gt;</description>
      <pubDate>Thu, 04 Apr 2019 09:35:41 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/event-when-assembly-drawing-is-completely-opened/m-p/8706809#M78315</guid>
      <dc:creator>YuhanZhang</dc:creator>
      <dc:date>2019-04-04T09:35:41Z</dc:date>
    </item>
    <item>
      <title>Re: Event when Assembly/Drawing is completely opened</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/event-when-assembly-drawing-is-completely-opened/m-p/8707380#M78316</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The event is fired in both kBefore and kAfter for the topassembly. That's not the issue for me at least. The issue is that the context.Item["TopLevelFilename"] in the kAfter event is different from the kBefore event. The value of the context.Item["TopLevelFilename"] in the case of kAfter event is always same as fullDocumentName parameter.&amp;nbsp; The value for TopLevelFilename should not get changed in the kAfter event since there is only one Top assembly or part or drawing.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Wangdu&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;coolOrange&lt;/P&gt;
&lt;P&gt;&lt;A href="http://www.coolOrange.com" target="_blank"&gt;www.coolOrange.com&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 04 Apr 2019 12:56:21 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/event-when-assembly-drawing-is-completely-opened/m-p/8707380#M78316</guid>
      <dc:creator>wangdu</dc:creator>
      <dc:date>2019-04-04T12:56:21Z</dc:date>
    </item>
    <item>
      <title>Re: Event when Assembly/Drawing is completely opened</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/event-when-assembly-drawing-is-completely-opened/m-p/8714000#M78317</link>
      <description>&lt;P&gt;This should be as designed if you read the details of the description for the Context argument:&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;TABLE class="api-list"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD class="api-list"&gt;Output NameValueMap object that can be used to determine the context of why the event fired. Additional information is provided through this argument to help in understanding the context of how the document is being opened. Name = "TopLevelFilename", Value = The full filename of the top-level file that was opened that's causing this file to be opened. For example, if an assembly is opened and a document referenced by that assembly is opened as a result, the TopLevelFilename will be the full filename of the assembly. &lt;FONT color="#000000"&gt;&lt;STRONG&gt;This value can be the same as the FullDocumentName argument which indicates this document was opened by itself.&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;So you can handle this in your code. Hope this clears.&lt;/P&gt;</description>
      <pubDate>Mon, 08 Apr 2019 09:11:29 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/event-when-assembly-drawing-is-completely-opened/m-p/8714000#M78317</guid>
      <dc:creator>YuhanZhang</dc:creator>
      <dc:date>2019-04-08T09:11:29Z</dc:date>
    </item>
    <item>
      <title>Re: Event when Assembly/Drawing is completely opened</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/event-when-assembly-drawing-is-completely-opened/m-p/8719474#M78318</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you for your reply.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It is exactly what I understood that the document if opened by itself has the TopLevelFilename has the samesvalue as the FullDocumentName. And the issue is it is always same no matter whether the document is opened by itself or by a top level assembly or drawing.&lt;/P&gt;
&lt;P&gt;Regards,&lt;/P&gt;
&lt;P&gt;Wangdu&lt;/P&gt;</description>
      <pubDate>Wed, 10 Apr 2019 06:12:42 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/event-when-assembly-drawing-is-completely-opened/m-p/8719474#M78318</guid>
      <dc:creator>wangdu</dc:creator>
      <dc:date>2019-04-10T06:12:42Z</dc:date>
    </item>
    <item>
      <title>Re: Event when Assembly/Drawing is completely opened</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/event-when-assembly-drawing-is-completely-opened/m-p/8719506#M78319</link>
      <description>&lt;P&gt;Thanks for clarifying! Sounds like the solution.&lt;/P&gt;
&lt;P&gt;I'll have to try that first, but unfortunately project priorities changed so I won't have time for that soon.&lt;/P&gt;</description>
      <pubDate>Wed, 10 Apr 2019 06:33:52 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/event-when-assembly-drawing-is-completely-opened/m-p/8719506#M78319</guid>
      <dc:creator>ge.ki</dc:creator>
      <dc:date>2019-04-10T06:33:52Z</dc:date>
    </item>
  </channel>
</rss>

