<?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: iLogic save image of model in Inventor Forum</title>
    <link>https://forums.autodesk.com/t5/inventor-forum/ilogic-save-image-of-model/m-p/6877941#M291147</link>
    <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/537534"&gt;@MjDeck&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;When you close a drawing, it will also close all its referenced model documents (unless they are open in a separate window).&lt;BR /&gt;Try adding this to the top of the rule:&lt;BR /&gt;&lt;BR /&gt;If ThisApplication.ActiveView.Document IsNot ThisDoc.Document Then Return&lt;/P&gt;
&lt;P&gt;(Note: IsNot is one word.)&lt;BR /&gt;&lt;BR /&gt;That will prevent the rule from&amp;nbsp;doing anything&amp;nbsp;when thw document is being closed from a drawing.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Hi MjDeck,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Ah-ha. So that helps me understand the Close Document event.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you close the model when the drawing is still open the Close Document event does not fire the rule, because the document is still open from Inventor's view point.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;However, even with the addition of the line you suggested I still see the error when I have both the model and the drawing open and I close the model, then close the drawing. Attached are some example file with the rule as an internal rule in the part.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I hope this helps.&lt;BR /&gt;Best of luck to you in all of your Inventor pursuits,&lt;BR /&gt;Curtis&lt;BR /&gt;&lt;A href="http://inventortrenches.blogspot.com" target="_blank"&gt;http://inventortrenches.blogspot.com&lt;/A&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 14 Feb 2017 20:37:00 GMT</pubDate>
    <dc:creator>Curtis_W</dc:creator>
    <dc:date>2017-02-14T20:37:00Z</dc:date>
    <item>
      <title>iLogic save image of model</title>
      <link>https://forums.autodesk.com/t5/inventor-forum/ilogic-save-image-of-model/m-p/6875045#M291140</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have been working on some iLogic code where I am trying to save a bmp of the model. I have it to run on close of the document but I keep running into a couple issues. First randomly this will rotate the drawing to an ISO image when the model has already been closed. Second I get an error if I close the model while having the drawing open. It will not run the command and tries to run when closing the drawing and gives me an error. How can I specify to run only if its an .ipt or .iam not a .dwg or .idw. I have this set to execute on close of document because of running into issues with having it not save the files with the part number after save. We seemed to have some lag and it required the user to hit save twice in order to save the image.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any help or advice would be appreciated.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is my code I currently have.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;oFileName &lt;STRONG&gt;=&lt;/STRONG&gt; &lt;STRONG&gt;ThisDoc&lt;/STRONG&gt;.&lt;STRONG&gt;FileName&lt;/STRONG&gt;&lt;STRONG&gt;(&lt;/STRONG&gt;False&lt;STRONG&gt;)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Dim&lt;/STRONG&gt; m_Camera &lt;STRONG&gt;As&lt;/STRONG&gt; Inventor.Camera&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Dim&lt;/STRONG&gt; m_Doc &lt;STRONG&gt;As&lt;/STRONG&gt; Inventor.&lt;STRONG&gt;Document&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Dim&lt;/STRONG&gt; m_TO &lt;STRONG&gt;As&lt;/STRONG&gt; Inventor.TransientObjects&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;m_TO &lt;STRONG&gt;=&lt;/STRONG&gt; &lt;STRONG&gt;ThisApplication&lt;/STRONG&gt;.TransientObjects&lt;/P&gt;&lt;P&gt;m_Doc &lt;STRONG&gt;=&lt;/STRONG&gt; &lt;STRONG&gt;ThisDoc&lt;/STRONG&gt;.&lt;STRONG&gt;Document&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;m_Camera &lt;STRONG&gt;=&lt;/STRONG&gt; &lt;STRONG&gt;ThisApplication&lt;/STRONG&gt;.ActiveView.Camera&lt;/P&gt;&lt;P&gt;&lt;EM&gt;'m_Camera.Perspective = True&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;m_Camera.ViewOrientationType &lt;STRONG&gt;=&lt;/STRONG&gt; Inventor.ViewOrientationTypeEnum.kIsoTopLeftViewOrientation&lt;/P&gt;&lt;P&gt;m_Camera.Fit&lt;/P&gt;&lt;P&gt;m_Camera.ApplyWithoutTransition&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Dim&lt;/STRONG&gt; m_CV as Inventor.&lt;STRONG&gt;View&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;m_CV &lt;STRONG&gt;=&lt;/STRONG&gt; &lt;STRONG&gt;ThisApplication&lt;/STRONG&gt;.ActiveView&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Dim&lt;/STRONG&gt; m_PrevMode &lt;STRONG&gt;As&lt;/STRONG&gt; &lt;STRONG&gt;Integer&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Dim&lt;/STRONG&gt; m_Disp3D &lt;STRONG&gt;As&lt;/STRONG&gt; &lt;STRONG&gt;Boolean&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;m_PrevMode &lt;STRONG&gt;=&lt;/STRONG&gt; m_CV.DisplayMode&lt;/P&gt;&lt;P&gt;m_Disp3D &lt;STRONG&gt;=&lt;/STRONG&gt; &lt;STRONG&gt;ThisApplication&lt;/STRONG&gt;.DisplayOptions.Show3DIndicator&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;m_CV.DisplayMode &lt;STRONG&gt;=&lt;/STRONG&gt; Inventor.DisplayModeEnum.kSHADEDWITHEDGESRendering&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;ThisApplication&lt;/STRONG&gt;.DisplayOptions.Show3DIndicator &lt;STRONG&gt;=&lt;/STRONG&gt; False&lt;/P&gt;&lt;P&gt;&lt;EM&gt;'MessageBox.Show(m_CV.DisplayMode)&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;m_CV.Update&lt;/P&gt;&lt;P&gt;m_Camera.SaveAsBitmap&lt;STRONG&gt;(&lt;/STRONG&gt;"T:\inventor workspace\inventor labels\"&lt;STRONG&gt;&amp;amp;&lt;/STRONG&gt; oFileName &lt;STRONG&gt;&amp;amp;&lt;/STRONG&gt;".bmp", &lt;STRONG&gt;800&lt;/STRONG&gt;, &lt;STRONG&gt;600&lt;/STRONG&gt;, m_TO.CreateColor&lt;STRONG&gt;(255&lt;/STRONG&gt;,&lt;STRONG&gt;255&lt;/STRONG&gt;,&lt;STRONG&gt;255))&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;m_CV.DisplayMode &lt;STRONG&gt;=&lt;/STRONG&gt; m_PrevMode&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;ThisApplication&lt;/STRONG&gt;.DisplayOptions.Show3DIndicator &lt;STRONG&gt;=&lt;/STRONG&gt; m_Disp3D&lt;/P&gt;&lt;P&gt;m_CV.Update&lt;/P&gt;</description>
      <pubDate>Mon, 13 Feb 2017 20:23:34 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-forum/ilogic-save-image-of-model/m-p/6875045#M291140</guid>
      <dc:creator>beth.maddux</dc:creator>
      <dc:date>2017-02-13T20:23:34Z</dc:date>
    </item>
    <item>
      <title>Re: iLogic save image of model</title>
      <link>https://forums.autodesk.com/t5/inventor-forum/ilogic-save-image-of-model/m-p/6875178#M291141</link>
      <description>&lt;P&gt;Hi beth.maddux,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;I've added a file type check so it will not run if the file is not a part and it is not an assembly.&lt;/LI&gt;
&lt;LI&gt;I would typically have a rule like this run on the&lt;STRONG&gt; Before Save&lt;/STRONG&gt; event ( we'd very rarely want to use After Save)&lt;/LI&gt;
&lt;LI&gt;The error(s)&amp;nbsp;when the drawing is open might be due to the&amp;nbsp;Close Document event and the file type, but I think the file type test is getting past it.&lt;/LI&gt;
&lt;LI&gt;I could not get the rule to fire using the Close Document event.&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;So try this version with the file type check and using the Before Save event, note I changed the output path for my testing to c:\Temp, so be sure to change that back.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Edit: I just realized that maybe you're needing to run this after save or on close, because the file name = part number hasn't happened yet for new documents when using the Before Save?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also just as a tip, you can search and ask programming questions of this type on the Inventor Customization forum too:&lt;BR /&gt;&lt;A href="https://forums.autodesk.com/t5/Autodesk-Inventor-Customization/bd-p/120" target="_blank"&gt;http://forums.autodesk.com/t5/Autodesk-Inventor-Customization/bd-p/120&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;I hope this helps.&lt;BR /&gt;Best of luck to you in all of your Inventor pursuits,&lt;BR /&gt;Curtis&lt;BR /&gt;&lt;A href="http://inventortrenches.blogspot.com" target="_blank"&gt;http://inventortrenches.blogspot.com&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;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;Dim m_Doc As Inventor.Document
m_Doc = ThisDoc.Document
If m_Doc.DocumentType &amp;lt;&amp;gt; kAssemblyDocumentObject _
	And m_Doc.DocumentType &amp;lt;&amp;gt; kPartDocumentObject Then 
	MessageBox.Show("File is not a model.", "iLogic")
	Return 'exit rule
End If


Dim m_Camera As Inventor.Camera
Dim m_TO As Inventor.TransientObjects 

m_TO = ThisApplication.TransientObjects

oFileName = ThisDoc.FileName(False)
m_Camera = ThisApplication.ActiveView.Camera
'm_Camera.Perspective = True

m_Camera.ViewOrientationType = Inventor.ViewOrientationTypeEnum.kIsoTopLeftViewOrientation
m_Camera.Fit
m_Camera.ApplyWithoutTransition 

Dim m_CV as Inventor.View
m_CV = ThisApplication.ActiveView 

Dim m_PrevMode As Integer
Dim m_Disp3D As Boolean 

m_PrevMode = m_CV.DisplayMode
m_Disp3D = ThisApplication.DisplayOptions.Show3DIndicator 

m_CV.DisplayMode = Inventor.DisplayModeEnum.kSHADEDWITHEDGESRendering
ThisApplication.DisplayOptions.Show3DIndicator = False

m_CV.Update
m_Camera.SaveAsBitmap("C:\Temp\"&amp;amp; oFileName &amp;amp;".bmp", 800, 600, m_TO.CreateColor(255,255,255))
 

m_CV.DisplayMode = m_PrevMode
ThisApplication.DisplayOptions.Show3DIndicator = m_Disp3D
m_CV.Update
&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 13 Feb 2017 21:21:48 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-forum/ilogic-save-image-of-model/m-p/6875178#M291141</guid>
      <dc:creator>Curtis_W</dc:creator>
      <dc:date>2017-02-13T21:21:48Z</dc:date>
    </item>
    <item>
      <title>Re: iLogic save image of model</title>
      <link>https://forums.autodesk.com/t5/inventor-forum/ilogic-save-image-of-model/m-p/6877610#M291142</link>
      <description>&lt;P&gt;Yes we have it set on close because of it not putting the part number into the file. So I put this in our template and I am getting the same error this happens when I close the model and then make changes to the drawing. Then I go to save and close the drawing and then it gives me an error about the document being set. Does that make sense to you? Same as my drawings are still rotating but it happens when you open another drawing and close it then the one you didn't close rotates. I just am stuck at why it keeps doing this and I am not sure how to stop it.&lt;/P&gt;</description>
      <pubDate>Tue, 14 Feb 2017 18:47:10 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-forum/ilogic-save-image-of-model/m-p/6877610#M291142</guid>
      <dc:creator>beth.maddux</dc:creator>
      <dc:date>2017-02-14T18:47:10Z</dc:date>
    </item>
    <item>
      <title>Re: iLogic save image of model</title>
      <link>https://forums.autodesk.com/t5/inventor-forum/ilogic-save-image-of-model/m-p/6877646#M291143</link>
      <description>&lt;P&gt;Hi beth.maddux,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have a general idea of what might be happening, so I'll try to have another look and post back later.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I hope this helps.&lt;BR /&gt;Best of luck to you in all of your Inventor pursuits,&lt;BR /&gt;Curtis&lt;BR /&gt;&lt;A href="http://inventortrenches.blogspot.com" target="_blank"&gt;http://inventortrenches.blogspot.com&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 14 Feb 2017 18:56:46 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-forum/ilogic-save-image-of-model/m-p/6877646#M291143</guid>
      <dc:creator>Curtis_W</dc:creator>
      <dc:date>2017-02-14T18:56:46Z</dc:date>
    </item>
    <item>
      <title>Re: iLogic save image of model</title>
      <link>https://forums.autodesk.com/t5/inventor-forum/ilogic-save-image-of-model/m-p/6877833#M291144</link>
      <description>&lt;P&gt;Hi beth.maddux,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I still can't get the rule to run on the Close Document event ( I put a message box at the end as a test).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I tried this as an external rule and an internal rule.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But I do see that if I set this rule to run on the assembly close event, and then save and close the model file, and then save and close an open drawing file that references that same model, I get the error you mentioned coming from this rule.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I don't understand it, but maybe &lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/537534"&gt;@MjDeck&lt;/a&gt;&amp;nbsp;knows something about the Close Document event trigger that would help us understand what is happening.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I hope this helps.&lt;BR /&gt;Best of luck to you in all of your Inventor pursuits,&lt;BR /&gt;Curtis&lt;BR /&gt;&lt;A href="http://inventortrenches.blogspot.com" target="_blank"&gt;http://inventortrenches.blogspot.com&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 14 Feb 2017 19:54:40 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-forum/ilogic-save-image-of-model/m-p/6877833#M291144</guid>
      <dc:creator>Curtis_W</dc:creator>
      <dc:date>2017-02-14T19:54:40Z</dc:date>
    </item>
    <item>
      <title>Re: iLogic save image of model</title>
      <link>https://forums.autodesk.com/t5/inventor-forum/ilogic-save-image-of-model/m-p/6877876#M291145</link>
      <description>&lt;P&gt;When you close a drawing, it will also close all its referenced model documents (unless they are open in a separate window).&lt;BR /&gt;Try adding this to the top of the rule:&lt;BR /&gt;&lt;BR /&gt;If ThisApplication.ActiveView.Document IsNot ThisDoc.Document Then Return&lt;/P&gt;
&lt;P&gt;(Note: IsNot is one word.)&lt;BR /&gt;&lt;BR /&gt;That will prevent the rule from&amp;nbsp;doing anything&amp;nbsp;when thw document is being closed from a drawing.&lt;/P&gt;</description>
      <pubDate>Tue, 14 Feb 2017 20:10:32 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-forum/ilogic-save-image-of-model/m-p/6877876#M291145</guid>
      <dc:creator>MjDeck</dc:creator>
      <dc:date>2017-02-14T20:10:32Z</dc:date>
    </item>
    <item>
      <title>Re: iLogic save image of model</title>
      <link>https://forums.autodesk.com/t5/inventor-forum/ilogic-save-image-of-model/m-p/6877923#M291146</link>
      <description>&lt;P&gt;I am still getting errors if I have the drawing open and then close the model the rule will not run.&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;&lt;STRONG&gt;If&lt;/STRONG&gt; &lt;STRONG&gt;ThisApplication&lt;/STRONG&gt;.ActiveView.&lt;STRONG&gt;Document&lt;/STRONG&gt; &lt;STRONG&gt;IsNot&lt;/STRONG&gt; &lt;STRONG&gt;ThisDoc&lt;/STRONG&gt;.&lt;STRONG&gt;Document&lt;/STRONG&gt; &lt;STRONG&gt;Then&lt;/STRONG&gt; &lt;STRONG&gt;Return&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Dim&lt;/STRONG&gt; m_Doc &lt;STRONG&gt;As&lt;/STRONG&gt; Inventor.&lt;STRONG&gt;Document&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;m_Doc &lt;STRONG&gt;=&lt;/STRONG&gt; &lt;STRONG&gt;ThisDoc&lt;/STRONG&gt;.&lt;STRONG&gt;Document&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;If&lt;/STRONG&gt; m_Doc.DocumentType &lt;STRONG&gt;&amp;lt;&amp;gt;&lt;/STRONG&gt; kAssemblyDocumentObject _&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;STRONG&gt;And&lt;/STRONG&gt; m_Doc.DocumentType &lt;STRONG&gt;&amp;lt;&amp;gt;&lt;/STRONG&gt; kPartDocumentObject &lt;STRONG&gt;Then&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;STRONG&gt;MessageBox&lt;/STRONG&gt;.&lt;STRONG&gt;Show&lt;/STRONG&gt;&lt;STRONG&gt;(&lt;/STRONG&gt;"File is not a model.", "iLogic"&lt;STRONG&gt;)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;STRONG&gt;Return&lt;/STRONG&gt; &lt;EM&gt;'exit rule&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;End&lt;/STRONG&gt; &lt;STRONG&gt;If&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Dim&lt;/STRONG&gt; m_Camera &lt;STRONG&gt;As&lt;/STRONG&gt; Inventor.Camera&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Dim&lt;/STRONG&gt; m_TO &lt;STRONG&gt;As&lt;/STRONG&gt; Inventor.TransientObjects&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;m_TO &lt;STRONG&gt;=&lt;/STRONG&gt; &lt;STRONG&gt;ThisApplication&lt;/STRONG&gt;.TransientObjects&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;oFileName &lt;STRONG&gt;=&lt;/STRONG&gt; &lt;STRONG&gt;ThisDoc&lt;/STRONG&gt;.&lt;STRONG&gt;FileName&lt;/STRONG&gt;&lt;STRONG&gt;(&lt;/STRONG&gt;False&lt;STRONG&gt;)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;m_Camera &lt;STRONG&gt;=&lt;/STRONG&gt; &lt;STRONG&gt;ThisApplication&lt;/STRONG&gt;.ActiveView.Camera&lt;/P&gt;&lt;P&gt;&lt;EM&gt;'m_Camera.Perspective = True&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;m_Camera.ViewOrientationType &lt;STRONG&gt;=&lt;/STRONG&gt; Inventor.ViewOrientationTypeEnum.kIsoTopLeftViewOrientation&lt;/P&gt;&lt;P&gt;m_Camera.Fit&lt;/P&gt;&lt;P&gt;m_Camera.ApplyWithoutTransition&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Dim&lt;/STRONG&gt; m_CV as Inventor.&lt;STRONG&gt;View&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;m_CV &lt;STRONG&gt;=&lt;/STRONG&gt; &lt;STRONG&gt;ThisApplication&lt;/STRONG&gt;.ActiveView&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Dim&lt;/STRONG&gt; m_PrevMode &lt;STRONG&gt;As&lt;/STRONG&gt; &lt;STRONG&gt;Integer&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Dim&lt;/STRONG&gt; m_Disp3D &lt;STRONG&gt;As&lt;/STRONG&gt; &lt;STRONG&gt;Boolean&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;m_PrevMode &lt;STRONG&gt;=&lt;/STRONG&gt; m_CV.DisplayMode&lt;/P&gt;&lt;P&gt;m_Disp3D &lt;STRONG&gt;=&lt;/STRONG&gt; &lt;STRONG&gt;ThisApplication&lt;/STRONG&gt;.DisplayOptions.Show3DIndicator&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;m_CV.DisplayMode &lt;STRONG&gt;=&lt;/STRONG&gt; Inventor.DisplayModeEnum.kSHADEDWITHEDGESRendering&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;ThisApplication&lt;/STRONG&gt;.DisplayOptions.Show3DIndicator &lt;STRONG&gt;=&lt;/STRONG&gt; False&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;m_CV.Update&lt;/P&gt;&lt;P&gt;m_Camera.SaveAsBitmap&lt;STRONG&gt;(&lt;/STRONG&gt;"T:\inventor workspace\inventor labels\"&lt;STRONG&gt;&amp;amp;&lt;/STRONG&gt; oFileName &lt;STRONG&gt;&amp;amp;&lt;/STRONG&gt;".bmp", &lt;STRONG&gt;800&lt;/STRONG&gt;, &lt;STRONG&gt;600&lt;/STRONG&gt;, m_TO.CreateColor&lt;STRONG&gt;(255&lt;/STRONG&gt;,&lt;STRONG&gt;255&lt;/STRONG&gt;,&lt;STRONG&gt;255))&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;m_CV.DisplayMode &lt;STRONG&gt;=&lt;/STRONG&gt; m_PrevMode&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;ThisApplication&lt;/STRONG&gt;.DisplayOptions.Show3DIndicator &lt;STRONG&gt;=&lt;/STRONG&gt; m_Disp3D&lt;/P&gt;&lt;P&gt;m_CV.Update&lt;/P&gt;</description>
      <pubDate>Tue, 14 Feb 2017 20:29:11 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-forum/ilogic-save-image-of-model/m-p/6877923#M291146</guid>
      <dc:creator>beth.maddux</dc:creator>
      <dc:date>2017-02-14T20:29:11Z</dc:date>
    </item>
    <item>
      <title>Re: iLogic save image of model</title>
      <link>https://forums.autodesk.com/t5/inventor-forum/ilogic-save-image-of-model/m-p/6877941#M291147</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/537534"&gt;@MjDeck&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;When you close a drawing, it will also close all its referenced model documents (unless they are open in a separate window).&lt;BR /&gt;Try adding this to the top of the rule:&lt;BR /&gt;&lt;BR /&gt;If ThisApplication.ActiveView.Document IsNot ThisDoc.Document Then Return&lt;/P&gt;
&lt;P&gt;(Note: IsNot is one word.)&lt;BR /&gt;&lt;BR /&gt;That will prevent the rule from&amp;nbsp;doing anything&amp;nbsp;when thw document is being closed from a drawing.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Hi MjDeck,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Ah-ha. So that helps me understand the Close Document event.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you close the model when the drawing is still open the Close Document event does not fire the rule, because the document is still open from Inventor's view point.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;However, even with the addition of the line you suggested I still see the error when I have both the model and the drawing open and I close the model, then close the drawing. Attached are some example file with the rule as an internal rule in the part.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I hope this helps.&lt;BR /&gt;Best of luck to you in all of your Inventor pursuits,&lt;BR /&gt;Curtis&lt;BR /&gt;&lt;A href="http://inventortrenches.blogspot.com" target="_blank"&gt;http://inventortrenches.blogspot.com&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 14 Feb 2017 20:37:00 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-forum/ilogic-save-image-of-model/m-p/6877941#M291147</guid>
      <dc:creator>Curtis_W</dc:creator>
      <dc:date>2017-02-14T20:37:00Z</dc:date>
    </item>
    <item>
      <title>Re: iLogic save image of model</title>
      <link>https://forums.autodesk.com/t5/inventor-forum/ilogic-save-image-of-model/m-p/6877967#M291148</link>
      <description>&lt;P&gt;Add another test to the top of the rule. Put the tests in this order:&lt;/P&gt;
&lt;P&gt;If ThisApplication.ActiveView Is Nothing Then Return&lt;BR /&gt;If ThisApplication.ActiveView.Document IsNot ThisDoc.Document Then Return&lt;/P&gt;</description>
      <pubDate>Tue, 14 Feb 2017 20:47:38 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-forum/ilogic-save-image-of-model/m-p/6877967#M291148</guid>
      <dc:creator>MjDeck</dc:creator>
      <dc:date>2017-02-14T20:47:38Z</dc:date>
    </item>
    <item>
      <title>Re: iLogic save image of model</title>
      <link>https://forums.autodesk.com/t5/inventor-forum/ilogic-save-image-of-model/m-p/6877979#M291149</link>
      <description>&lt;P&gt;okay that worked kind of.... So now I no longer get the error but how do I get it to run the rule in the model when I close that first? So I don't get the error anymore when I close the drawing but now its not running the rule on my model.&lt;/P&gt;</description>
      <pubDate>Tue, 14 Feb 2017 20:51:48 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-forum/ilogic-save-image-of-model/m-p/6877979#M291149</guid>
      <dc:creator>beth.maddux</dc:creator>
      <dc:date>2017-02-14T20:51:48Z</dc:date>
    </item>
    <item>
      <title>Re: iLogic save image of model</title>
      <link>https://forums.autodesk.com/t5/inventor-forum/ilogic-save-image-of-model/m-p/6878091#M291150</link>
      <description>&lt;P&gt;I don't think you can use the ActiveView if you want it to work from a drawing. But there's another way to set up a camera and capture an image, without using a View. See the attached rule. There are some differences in the way the display options work in this case. One difference: it uses the background color that you provide to SaveAsBitmap.&amp;nbsp;So the background&amp;nbsp;will be white (255, 255, 255). You can change that.&lt;/P&gt;</description>
      <pubDate>Tue, 14 Feb 2017 21:39:30 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-forum/ilogic-save-image-of-model/m-p/6878091#M291150</guid>
      <dc:creator>MjDeck</dc:creator>
      <dc:date>2017-02-14T21:39:30Z</dc:date>
    </item>
    <item>
      <title>Re: iLogic save image of model</title>
      <link>https://forums.autodesk.com/t5/inventor-forum/ilogic-save-image-of-model/m-p/6878241#M291151</link>
      <description>&lt;P&gt;Hi MjDeck,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;That version worked for me, hopefully it works for beth.maddux too.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;Curtis&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 14 Feb 2017 22:39:08 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-forum/ilogic-save-image-of-model/m-p/6878241#M291151</guid>
      <dc:creator>Curtis_W</dc:creator>
      <dc:date>2017-02-14T22:39:08Z</dc:date>
    </item>
    <item>
      <title>Re: iLogic save image of model</title>
      <link>https://forums.autodesk.com/t5/inventor-forum/ilogic-save-image-of-model/m-p/6883787#M291152</link>
      <description>&lt;P&gt;If you use&amp;nbsp;my version of the rule (not using ActiveView) then you can set the rule to run on the After Save Document event, instead of Close Document.&amp;nbsp;A problem&amp;nbsp;with Close Document is that it will occur even if the document has not been saved. So you could get a picture of the model in a state that doesn't match the saved version.&lt;/P&gt;</description>
      <pubDate>Thu, 16 Feb 2017 20:03:38 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-forum/ilogic-save-image-of-model/m-p/6883787#M291152</guid>
      <dc:creator>MjDeck</dc:creator>
      <dc:date>2017-02-16T20:03:38Z</dc:date>
    </item>
  </channel>
</rss>

