<?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 View won't update in Inventor Programming Forum</title>
    <link>https://forums.autodesk.com/t5/inventor-programming-forum/drawing-view-won-t-update/m-p/3497766#M137903</link>
    <description>&lt;P&gt;Just a hunch, do you have this problem if you open your template with visibility turned on?&lt;/P&gt;&lt;P&gt;e.g.&lt;/P&gt;&lt;P&gt;oTemplate = m_inventorApplication.Documents.Open(sTemplateFileName, &lt;FONT color="#FF0000"&gt;True&lt;/FONT&gt;)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've had a few problems in the past with updating when i've opened a file in the background.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;also try saving a copy of the IDW before you replace the reference (basically just changing the order of processes)&lt;/P&gt;</description>
    <pubDate>Wed, 13 Jun 2012 10:07:20 GMT</pubDate>
    <dc:creator>matt_jlt</dc:creator>
    <dc:date>2012-06-13T10:07:20Z</dc:date>
    <item>
      <title>Drawing View won't update</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/drawing-view-won-t-update/m-p/3280075#M137899</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've got a macro which is creating .ipt and .idw files from templates. I'm once created I'm replacing the reference in the .idw to refer to the newly created .ipt file. The problem is that the drawing view isn't updating... I've been googling like mad, and i've tried the suggestions I've found, that is make the .ipt file dirty then udpate the drawing, but that hasn't worked. I've tried just using the drawingdocument.update function, but that hasn't worked either... I'm not sure what else I can try...&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any suggestions?&lt;/P&gt;</description>
      <pubDate>Wed, 04 Jan 2012 03:43:56 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/drawing-view-won-t-update/m-p/3280075#M137899</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2012-01-04T03:43:56Z</dc:date>
    </item>
    <item>
      <title>Re: Drawing View won't update</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/drawing-view-won-t-update/m-p/3497244#M137900</link>
      <description>&lt;P&gt;Still trying to figure this one out guys.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here's what I've tried:&lt;/P&gt;&lt;P&gt;osheet.update &amp;nbsp;- This doesn't work&lt;/P&gt;&lt;P&gt;odoc.update&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;- This doesn't work&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;odoc.update2&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;- This doesn't work&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;osheet.suppressed = true&lt;/P&gt;&lt;P&gt;osheet.suppressed = false &amp;nbsp;- this DOES update the view, but not the annotations And it's really slow.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Inventor says that osheet.drawingview(1).uptodate = true, but when you select the view in the GUI, the update button is available, when you press the button the view updates correctly.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any suggestions?&lt;/P&gt;</description>
      <pubDate>Tue, 12 Jun 2012 21:33:47 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/drawing-view-won-t-update/m-p/3497244#M137900</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2012-06-12T21:33:47Z</dc:date>
    </item>
    <item>
      <title>Re: Drawing View won't update</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/drawing-view-won-t-update/m-p/3497466#M137901</link>
      <description>&lt;P&gt;I'll need more code to be able to understand exactly whats happening so I can try and help you.&lt;/P&gt;</description>
      <pubDate>Wed, 13 Jun 2012 02:55:08 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/drawing-view-won-t-update/m-p/3497466#M137901</guid>
      <dc:creator>matt_jlt</dc:creator>
      <dc:date>2012-06-13T02:55:08Z</dc:date>
    </item>
    <item>
      <title>Re: Drawing View won't update</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/drawing-view-won-t-update/m-p/3497488#M137902</link>
      <description>&lt;P&gt;There isn't a definite flaw in the code, so unless I'd have to post the entire project so you could replicate the problem, and there's many links to network locations.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Perhaps some images will help to explain my problem.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A target="_blank" href="http://s429.photobucket.com/albums/qq13/hickoz_bro/Inventor%20-%20Misc%20Images/?action=view&amp;amp;current=13-06-20121-04-59PM.png"&gt;&lt;IMG alt="Photobucket" src="http://i429.photobucket.com/albums/qq13/hickoz_bro/Inventor%20-%20Misc%20Images/13-06-20121-04-59PM.png" border="0" /&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The above image shows the part (top window) as generated by my add-in. The bottom window shows the drawing of that same part also generated by my add-in. You'll notice that the drawing view does not accurately reflect the part. Instead it shows the part which was used as a template for the creation of the part in the top window.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The code below is used to replace the reference to the new created part BEFORE carrying out any other tasks on the drawing (such as re-size the drawing view).&lt;/P&gt;&lt;PRE&gt;        oTemplate = m_inventorApplication.Documents.Open(sTemplateFileName, False) &lt;EM&gt;&lt;FONT color="#008000"&gt;'Open the template drawing file&lt;/FONT&gt;&lt;/EM&gt;
        oTemplate.ReferencedDocumentDescriptors.Item(1).ReferencedFileDescriptor.ReplaceReference(sNewFilePath &amp;amp; PartName &amp;amp; ".ipt") &lt;EM&gt;&lt;FONT color="#008000"&gt;'Replace the reference of the template part file, with the created part file.&lt;/FONT&gt;&lt;/EM&gt;

        oTemplate.ReferencedDocuments.Item(1).Save() &lt;EM&gt;&lt;FONT color="#008000"&gt;'Save the created part file&lt;/FONT&gt;&lt;/EM&gt;
        oTemplate.SaveAs(sNewFilePath &amp;amp; PartName &amp;amp; sNewFileExtension, True) '&lt;EM&gt;&lt;FONT color="#008000"&gt;Save the drawing file to match the created parts filename.&lt;/FONT&gt;&lt;/EM&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You'll notice in the image above, that the drawing view is selected, and the 'Update' button in the quick access toolbar is enabled, suggesting that the drawing view is not up to date.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The image below shows the result of what happens when you press that 'Update' button. Clearly the drawing view now correctly reflects the part shown in the top window, however the scale needs to be adjusted.&lt;/P&gt;&lt;P&gt;&lt;A href="http://s429.photobucket.com/albums/qq13/hickoz_bro/Inventor%20-%20Misc%20Images/?action=view&amp;amp;current=13-06-20121-05-53PM.png" target="_blank"&gt;&lt;IMG alt="Photobucket" src="http://i429.photobucket.com/albums/qq13/hickoz_bro/Inventor%20-%20Misc%20Images/13-06-20121-05-53PM.png" border="0" /&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;SO... My question is, How do I invoke that Update command from the API? I've tried the update methods of the sheet, and document objects, but they don't work. The Rebuild method is not available to drawing documents.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any assistance would be great!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;NOTE: I've attached both of those images because they're squashed in this window.&lt;/P&gt;</description>
      <pubDate>Wed, 13 Jun 2012 03:25:22 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/drawing-view-won-t-update/m-p/3497488#M137902</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2012-06-13T03:25:22Z</dc:date>
    </item>
    <item>
      <title>Re: Drawing View won't update</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/drawing-view-won-t-update/m-p/3497766#M137903</link>
      <description>&lt;P&gt;Just a hunch, do you have this problem if you open your template with visibility turned on?&lt;/P&gt;&lt;P&gt;e.g.&lt;/P&gt;&lt;P&gt;oTemplate = m_inventorApplication.Documents.Open(sTemplateFileName, &lt;FONT color="#FF0000"&gt;True&lt;/FONT&gt;)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've had a few problems in the past with updating when i've opened a file in the background.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;also try saving a copy of the IDW before you replace the reference (basically just changing the order of processes)&lt;/P&gt;</description>
      <pubDate>Wed, 13 Jun 2012 10:07:20 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/drawing-view-won-t-update/m-p/3497766#M137903</guid>
      <dc:creator>matt_jlt</dc:creator>
      <dc:date>2012-06-13T10:07:20Z</dc:date>
    </item>
    <item>
      <title>Re: Drawing View won't update</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/drawing-view-won-t-update/m-p/3499692#M137904</link>
      <description>&lt;P&gt;Excellent! Setting the open behaviour to visible = True seems to have done the trick...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for the suggestion!&lt;/P&gt;</description>
      <pubDate>Thu, 14 Jun 2012 08:44:04 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/drawing-view-won-t-update/m-p/3499692#M137904</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2012-06-14T08:44:04Z</dc:date>
    </item>
    <item>
      <title>Re: Drawing View won't update</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/drawing-view-won-t-update/m-p/3499758#M137905</link>
      <description>&lt;P&gt;No problems, If you want to avoid seeing what is happening on the screen you could try disabling screen updating temporarily then once your addin has finished enable screen updating. It shouldn't give you any updating issues.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;ThisApplication.ScreenUpdating = False&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards, Matt.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If your problem is solved, don't forget to press the Accept Solution button&lt;BR /&gt;.&lt;/P&gt;</description>
      <pubDate>Thu, 14 Jun 2012 10:03:07 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/drawing-view-won-t-update/m-p/3499758#M137905</guid>
      <dc:creator>matt_jlt</dc:creator>
      <dc:date>2012-06-14T10:03:07Z</dc:date>
    </item>
  </channel>
</rss>

