<?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: Drawing &amp;quot;Update&amp;quot; event in Inventor Programming - iLogic, Macros, AddIns &amp; Apprentice</title>
    <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/drawing-quot-update-quot-event/m-p/8698276#M96183</link>
    <description>&lt;P&gt;Is that a no?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;PS, I'm not sure why I put "view" in the title. Please ignore that. It should just say, &lt;EM&gt;Drawing "Update" event&lt;/EM&gt;.&lt;/P&gt;</description>
    <pubDate>Mon, 01 Apr 2019 12:51:02 GMT</pubDate>
    <dc:creator>DRoam</dc:creator>
    <dc:date>2019-04-01T12:51:02Z</dc:date>
    <item>
      <title>Drawing "Update" event</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/drawing-quot-update-quot-event/m-p/8684832#M96016</link>
      <description>&lt;P&gt;I'm trying to hook up some custom actions to the "Update Drawing" event, so they happen immediately after a drawing is updated. I can easily watch for manual updates and respond to those. The problem is, Inventor also &lt;EM&gt;automatically&lt;/EM&gt; updates drawings after certain actions, such as opening or activating an out-of-date drawing. I can't figure out how to watch for these automatic Updates.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I tried watching the "OnDocumentChange" event, but this event isn't triggered by Inventor's automatic updates.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I could easily check for an OnOpenDocument or OnActivateDocument event, but these don't tell me whether the drawing is going to be updated as part of the open/activate or not, and I don't want my code running unless an Update is actually happening.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;My last idea was to check the "DrawingDocument.RequiresUpdate" property BEFORE an open/activate event and again AFTER it, and if "RequiresUpdate" changed from True to False, then the drawing was updated. Surprisingly, this worked for the OnActivateDocument event. However, "RequiresUpdate" always returns False inside of the "OnOpenDocument" event. So I can't tell if a drawing was updated during opening.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So, my questions:&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;Is there a simple, fool-proof way to watch for the "automatic drawing update" event?&lt;/LI&gt;
&lt;LI&gt;If not, is there a way to determine if an Update is going to happen during a drawing Open event, since "RequiresUpdate" always returns False during an open?&lt;/LI&gt;
&lt;/OL&gt;</description>
      <pubDate>Mon, 01 Apr 2019 15:45:38 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/drawing-quot-update-quot-event/m-p/8684832#M96016</guid>
      <dc:creator>DRoam</dc:creator>
      <dc:date>2019-04-01T15:45:38Z</dc:date>
    </item>
    <item>
      <title>Re: Drawing "Update" event</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/drawing-quot-update-quot-event/m-p/8698276#M96183</link>
      <description>&lt;P&gt;Is that a no?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;PS, I'm not sure why I put "view" in the title. Please ignore that. It should just say, &lt;EM&gt;Drawing "Update" event&lt;/EM&gt;.&lt;/P&gt;</description>
      <pubDate>Mon, 01 Apr 2019 12:51:02 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/drawing-quot-update-quot-event/m-p/8698276#M96183</guid>
      <dc:creator>DRoam</dc:creator>
      <dc:date>2019-04-01T12:51:02Z</dc:date>
    </item>
    <item>
      <title>Re: Drawing "Update" event</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/drawing-quot-update-quot-event/m-p/8739018#M96656</link>
      <description>&lt;P&gt;Can you share what you want to do when drawing is being updated?&lt;/P&gt;</description>
      <pubDate>Thu, 18 Apr 2019 05:22:03 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/drawing-quot-update-quot-event/m-p/8739018#M96656</guid>
      <dc:creator>YuhanZhang</dc:creator>
      <dc:date>2019-04-18T05:22:03Z</dc:date>
    </item>
    <item>
      <title>Re: Drawing "Update" event</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/drawing-quot-update-quot-event/m-p/8749087#M96828</link>
      <description>&lt;P&gt;Hey&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/1171223"&gt;@DRoam&lt;/a&gt;&amp;nbsp;,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The first thing coming to my mind for this requirement is using OpenWithOptions to open the drawing file with setting DeferUpdates to True:&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Dim oNM As NameValueMap&lt;BR /&gt;Set oNM = ThisApplication.TransientObjects.CreateNameValueMap&lt;BR /&gt;oNM.Add "DeferUpdates", True&lt;BR /&gt;Dim oDoc As DrawingDocument&lt;BR /&gt;Set oDoc = ThisApplication.Documents.OpenWithOptions("Path\part.idw", oNM)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;By opening drawing file with defer update setting to True, it should work combining what you mentioned using&amp;nbsp;&lt;SPAN&gt;DrawingDocument.RequiresUpdate:&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;bUpdated&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;Boolean&lt;/SPAN&gt; 
&lt;SPAN&gt;If&lt;/SPAN&gt; &lt;SPAN&gt;oDoc&lt;/SPAN&gt;.&lt;SPAN&gt;RequiresUpdate&lt;/SPAN&gt; = &lt;SPAN&gt;True&lt;/SPAN&gt; &lt;SPAN&gt;Then&lt;/SPAN&gt; &lt;BR /&gt;        'Setting &lt;SPAN&gt;DrawingSettings&lt;/SPAN&gt;.&lt;SPAN&gt;DeferUpdates to False to apply update in such case&lt;/SPAN&gt;
	&lt;SPAN&gt;oDoc&lt;/SPAN&gt;.&lt;SPAN&gt;DrawingSettings&lt;/SPAN&gt;.&lt;SPAN&gt;DeferUpdates&lt;/SPAN&gt; = &lt;SPAN&gt;False&lt;/SPAN&gt; 
	&lt;SPAN&gt;bUpdated&lt;/SPAN&gt; = &lt;SPAN&gt;True&lt;/SPAN&gt; 
	&lt;SPAN&gt;MsgBox&lt;/SPAN&gt;(&lt;SPAN&gt;bUpdated&lt;/SPAN&gt;)	
&lt;SPAN&gt;End&lt;/SPAN&gt; &lt;SPAN&gt;If&lt;/SPAN&gt; &amp;nbsp;&amp;nbsp;&lt;/PRE&gt;</description>
      <pubDate>Wed, 24 Apr 2019 05:10:57 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/drawing-quot-update-quot-event/m-p/8749087#M96828</guid>
      <dc:creator>JaneFan</dc:creator>
      <dc:date>2019-04-24T05:10:57Z</dc:date>
    </item>
    <item>
      <title>Re: Drawing "Update" event</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/drawing-quot-update-quot-event/m-p/8753348#M96897</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/532715"&gt;@YuhanZhang&lt;/a&gt;, my add-in is supposed to manage certain things about the drawing, such as information in text fields and which parts are shown in Parts Lists. These need to stay up to date with changes to referenced documents, but I don't want my code running unnecessarily. I assumed the most efficient way to do this would be to "hook in" to the built-in Update and run my code whenever it does.&lt;/P&gt;</description>
      <pubDate>Thu, 25 Apr 2019 16:31:27 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/drawing-quot-update-quot-event/m-p/8753348#M96897</guid>
      <dc:creator>DRoam</dc:creator>
      <dc:date>2019-04-25T16:31:27Z</dc:date>
    </item>
    <item>
      <title>Re: Drawing "Update" event</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/drawing-quot-update-quot-event/m-p/8753354#M96898</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/538492"&gt;@JaneFan&lt;/a&gt;&amp;nbsp;thanks for the suggestion, that might work. As long as I can make sure Defer Updates isn't already On before I open the drawing. I don't want to turn it off and update the drawing if updates are supposed to be deferred.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I've had to put this project on hold for now but I'll update you on how that works out when I get the chance to try it.&lt;/P&gt;</description>
      <pubDate>Thu, 25 Apr 2019 16:33:28 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/drawing-quot-update-quot-event/m-p/8753354#M96898</guid>
      <dc:creator>DRoam</dc:creator>
      <dc:date>2019-04-25T16:33:28Z</dc:date>
    </item>
    <item>
      <title>Re: Drawing "Update" event</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/drawing-quot-update-quot-event/m-p/8754364#M96910</link>
      <description>&lt;P&gt;So sounds like you just want to make sure the drawing is up-to-date when you manage the drawing objects to get info from them, I guess what you want is not just&amp;nbsp;to hook up the event when Update is happening, but needs the drawing is updated when you get the info. If yes you can do some check if the drawing is updated, and you can even call the DrawingView.[_Update], Sheet.Update and DrawingDocument.Update to make sure the drawing document is up-to-date before you manage the drawing objects.&lt;/P&gt;</description>
      <pubDate>Fri, 26 Apr 2019 03:08:21 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/drawing-quot-update-quot-event/m-p/8754364#M96910</guid>
      <dc:creator>YuhanZhang</dc:creator>
      <dc:date>2019-04-26T03:08:21Z</dc:date>
    </item>
  </channel>
</rss>

