<?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 Betreff: Save as jpeg in Inventor Programming Forum</title>
    <link>https://forums.autodesk.com/t5/inventor-programming-forum/save-as-jpeg/m-p/11311184#M34932</link>
    <description>&lt;P&gt;Hi Tom,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;didn't know you are trying to create an iLogic.&lt;BR /&gt;Try this rule. I just tested it and it works for me.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="general"&gt;Dim saveName As String
Dim oDoc As PartDocument
oDoc = ThisApplication.ActiveDocument
Dim oActiveView As View
oActiveView = ThisApplication.ActiveView
Dim oCamera As Camera	
oCamera = oActiveView.Camera
oCamera.ViewOrientationType = kTopViewOrientation
oCamera.Apply
ThisApplication.ActiveView.Fit

saveName = Left$(oDoc.FullDocumentName, Len(oDoc.FullDocumentName) - 4)

Call oActiveView.SaveAsBitmap(saveName &amp;amp; ".jpg", 1000, 800)&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The filename contains the full path. Therefor it will safe the jpg at same location and same name as the assembly/part.&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;Greetings,&lt;/P&gt;</description>
    <pubDate>Thu, 21 Jul 2022 11:31:19 GMT</pubDate>
    <dc:creator>fullevent</dc:creator>
    <dc:date>2022-07-21T11:31:19Z</dc:date>
    <item>
      <title>Save as jpeg</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/save-as-jpeg/m-p/11311121#M34929</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Sometimes If I have an assembly or a part opened I export it as a jpeg file to get a picture of it.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I assume it is possible to do this via code?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Therefore,&amp;nbsp; 1. File -&amp;gt; Export Assembly/Part -&amp;gt; Image -&amp;gt; Jpeg files (.jpg)&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 2. Location: same location where assembly/part is saved.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;That code would be really cool to have, so if anyone knows the code, please let me know.&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Tom&lt;/P&gt;</description>
      <pubDate>Thu, 21 Jul 2022 10:52:49 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/save-as-jpeg/m-p/11311121#M34929</guid>
      <dc:creator>tomislav.peran</dc:creator>
      <dc:date>2022-07-21T10:52:49Z</dc:date>
    </item>
    <item>
      <title>Betreff: Save as jpeg</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/save-as-jpeg/m-p/11311131#M34930</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/12193321"&gt;@tomislav.peran&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I made once this function to do exactly that. It's for IPTs but that could be adjusted.&lt;BR /&gt;Maybe that will help you &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="general"&gt;Private Sub create_jpg(saveName As String)
    Dim oPartDoc As PartDocument
    Set oPartDoc = ThisApplication.ActiveDocument
    Dim oActiveView As View
    Set oActiveView = ThisApplication.ActiveView
    Dim oCamera As Camera
    Set oCamera = oActiveView.Camera
    oCamera.ViewOrientationType = kTopViewOrientation
    oCamera.Apply
    ThisApplication.ActiveView.Fit
    Dim oWorkAxes As WorkAxes
    Set oWorkAxes = oPartDoc.ComponentDefinition.WorkAxes
    oWorkAxes.Item(1).Visible = True
    oWorkAxes.Item(2).Visible = True
    Call oActiveView.SaveAsBitmap(saveName &amp;amp; ".jpg", 1000, 800)
    oWorkAxes.Item(1).Visible = False
    oWorkAxes.Item(2).Visible = False
End Sub&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;Edit:&lt;BR /&gt;To get the saveName I have this line somewhere&lt;/P&gt;
&lt;LI-CODE lang="general"&gt;Left$(oPartDoc.FullDocumentName, Len(oPartDoc.FullDocumentName) - 4)&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best regards,&lt;/P&gt;</description>
      <pubDate>Thu, 21 Jul 2022 11:04:05 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/save-as-jpeg/m-p/11311131#M34930</guid>
      <dc:creator>fullevent</dc:creator>
      <dc:date>2022-07-21T11:04:05Z</dc:date>
    </item>
    <item>
      <title>Betreff: Save as jpeg</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/save-as-jpeg/m-p/11311161#M34931</link>
      <description>&lt;P&gt;Hi fullevent,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for the code. This idea is exactly what I want. &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; Top view with axes.&lt;/P&gt;&lt;P&gt;However, I get an error when it wants to save as jpg:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;Call oActiveView.SaveAsBitmap(saveName &amp;amp; ".jpg", 1000, 800)&lt;/PRE&gt;&lt;P&gt;Error on line 16 in rule: Rule0, in document: MyPart.ipt&lt;/P&gt;&lt;P&gt;Klasse is niet geregistreerd&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;SaveName -&amp;gt; is it the same as the given document name? And will it save it at the same location as part/assy?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have also removed "set" at the start of the lines. I use code in Inventor and it does not want to have "set" in the code.&lt;/P&gt;&lt;P&gt;Also, It wants me to change Prive Sub to Sub main.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Tom&lt;/P&gt;</description>
      <pubDate>Thu, 21 Jul 2022 11:16:09 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/save-as-jpeg/m-p/11311161#M34931</guid>
      <dc:creator>tomislav.peran</dc:creator>
      <dc:date>2022-07-21T11:16:09Z</dc:date>
    </item>
    <item>
      <title>Betreff: Save as jpeg</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/save-as-jpeg/m-p/11311184#M34932</link>
      <description>&lt;P&gt;Hi Tom,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;didn't know you are trying to create an iLogic.&lt;BR /&gt;Try this rule. I just tested it and it works for me.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="general"&gt;Dim saveName As String
Dim oDoc As PartDocument
oDoc = ThisApplication.ActiveDocument
Dim oActiveView As View
oActiveView = ThisApplication.ActiveView
Dim oCamera As Camera	
oCamera = oActiveView.Camera
oCamera.ViewOrientationType = kTopViewOrientation
oCamera.Apply
ThisApplication.ActiveView.Fit

saveName = Left$(oDoc.FullDocumentName, Len(oDoc.FullDocumentName) - 4)

Call oActiveView.SaveAsBitmap(saveName &amp;amp; ".jpg", 1000, 800)&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The filename contains the full path. Therefor it will safe the jpg at same location and same name as the assembly/part.&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;Greetings,&lt;/P&gt;</description>
      <pubDate>Thu, 21 Jul 2022 11:31:19 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/save-as-jpeg/m-p/11311184#M34932</guid>
      <dc:creator>fullevent</dc:creator>
      <dc:date>2022-07-21T11:31:19Z</dc:date>
    </item>
    <item>
      <title>Betreff: Save as jpeg</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/save-as-jpeg/m-p/11311190#M34933</link>
      <description>&lt;P&gt;Hi fullevent,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Works perfect. Thank you a lot!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Tom&lt;/P&gt;</description>
      <pubDate>Thu, 21 Jul 2022 11:34:37 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/save-as-jpeg/m-p/11311190#M34933</guid>
      <dc:creator>tomislav.peran</dc:creator>
      <dc:date>2022-07-21T11:34:37Z</dc:date>
    </item>
    <item>
      <title>Betreff: Save as jpeg</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/save-as-jpeg/m-p/11311218#M34934</link>
      <description>&lt;P&gt;Greate, you're welcome &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 21 Jul 2022 11:50:11 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/save-as-jpeg/m-p/11311218#M34934</guid>
      <dc:creator>fullevent</dc:creator>
      <dc:date>2022-07-21T11:50:11Z</dc:date>
    </item>
  </channel>
</rss>

