<?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 error in PDF Ilogic snippet in Inventor Programming - iLogic, Macros, AddIns &amp; Apprentice</title>
    <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/error-in-pdf-ilogic-snippet/m-p/9707766#M114967</link>
    <description>&lt;P&gt;I have upgradet to inventor 2019, better late than never, and have encounter this small problem.&lt;/P&gt;&lt;P&gt;When i run my PDF ilogic it shows a error message that says&amp;nbsp; that i use the wrong pointer, and i dont know why&lt;/P&gt;&lt;P&gt;The ilogic should make a pdf of every drw sheet and store it in the workspace with the name: filename + sheet x.pdf&lt;/P&gt;&lt;DIV class="mceNonEditable lia-copypaste-placeholder"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;PDF snippet code is here:&lt;/P&gt;&lt;PRE&gt;&lt;SPAN&gt;oPath&lt;/SPAN&gt; = &lt;SPAN&gt;ThisDoc&lt;/SPAN&gt;.&lt;SPAN&gt;Path&lt;/SPAN&gt;
&lt;SPAN&gt;oFileName&lt;/SPAN&gt; = &lt;SPAN&gt;ThisDoc&lt;/SPAN&gt;.&lt;SPAN&gt;FileName&lt;/SPAN&gt;(&lt;SPAN&gt;False&lt;/SPAN&gt;) &lt;SPAN&gt;'without extension&lt;/SPAN&gt;
&lt;SPAN&gt;oPDFAddIn&lt;/SPAN&gt; = &lt;SPAN&gt;ThisApplication&lt;/SPAN&gt;.&lt;SPAN&gt;ApplicationAddIns&lt;/SPAN&gt;.&lt;SPAN&gt;ItemById&lt;/SPAN&gt; _
(&lt;SPAN&gt;"{0AC6FD96-2F4D-42CE-8BE0-8AEA580399E4}"&lt;/SPAN&gt;)
&lt;SPAN&gt;oDocument&lt;/SPAN&gt; = &lt;SPAN&gt;ThisApplication&lt;/SPAN&gt;.&lt;SPAN&gt;ActiveDocument&lt;/SPAN&gt;
&lt;SPAN&gt;oContext&lt;/SPAN&gt; = &lt;SPAN&gt;ThisApplication&lt;/SPAN&gt;.&lt;SPAN&gt;TransientObjects&lt;/SPAN&gt;.&lt;SPAN&gt;CreateTranslationContext&lt;/SPAN&gt;
&lt;SPAN&gt;oContext&lt;/SPAN&gt;.&lt;SPAN&gt;Type&lt;/SPAN&gt; = &lt;SPAN&gt;IOMechanismEnum&lt;/SPAN&gt;.&lt;SPAN&gt;kFileBrowseIOMechanism&lt;/SPAN&gt;
&lt;SPAN&gt;oOptions&lt;/SPAN&gt; = &lt;SPAN&gt;ThisApplication&lt;/SPAN&gt;.&lt;SPAN&gt;TransientObjects&lt;/SPAN&gt;.&lt;SPAN&gt;CreateNameValueMap&lt;/SPAN&gt;
&lt;SPAN&gt;oDataMedium&lt;/SPAN&gt; = &lt;SPAN&gt;ThisApplication&lt;/SPAN&gt;.&lt;SPAN&gt;TransientObjects&lt;/SPAN&gt;.&lt;SPAN&gt;CreateDataMedium&lt;/SPAN&gt;


&lt;SPAN&gt;'Define the drawing &lt;/SPAN&gt;
&lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;oDrawing&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;DrawingDocument&lt;/SPAN&gt;
&lt;SPAN&gt;oDrawing&lt;/SPAN&gt; = &lt;SPAN&gt;ThisDoc&lt;/SPAN&gt;.&lt;SPAN&gt;Document&lt;/SPAN&gt;


&lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;oSheet&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;Sheet&lt;/SPAN&gt;
&lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;lPos&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;Long&lt;/SPAN&gt;
&lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;rPos&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;Long&lt;/SPAN&gt;
&lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;sLen&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;Long&lt;/SPAN&gt;
&lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;sSheetName&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;String&lt;/SPAN&gt;
&lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;iSheetNumber&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;Integer&lt;/SPAN&gt;


&lt;SPAN&gt;'step through each drawing sheet&lt;/SPAN&gt;
&lt;SPAN&gt;For&lt;/SPAN&gt; &lt;SPAN&gt;Each&lt;/SPAN&gt; &lt;SPAN&gt;oSheet&lt;/SPAN&gt; &lt;SPAN&gt;In&lt;/SPAN&gt; &lt;SPAN&gt;oDrawing&lt;/SPAN&gt;.&lt;SPAN&gt;Sheets&lt;/SPAN&gt;


&lt;SPAN&gt;'find the seperator in the sheet name:number&lt;/SPAN&gt;
&lt;SPAN&gt;lPos&lt;/SPAN&gt; = &lt;SPAN&gt;InStr&lt;/SPAN&gt;(&lt;SPAN&gt;oSheet&lt;/SPAN&gt;.&lt;SPAN&gt;Name&lt;/SPAN&gt;, &lt;SPAN&gt;":"&lt;/SPAN&gt;)
&lt;SPAN&gt;'find the number of characters in the sheet name&lt;/SPAN&gt;
&lt;SPAN&gt;sLen&lt;/SPAN&gt; = &lt;SPAN&gt;Len&lt;/SPAN&gt;(&lt;SPAN&gt;oSheet&lt;/SPAN&gt;.&lt;SPAN&gt;Name&lt;/SPAN&gt;)
&lt;SPAN&gt;'find the sheet name&lt;/SPAN&gt;
&lt;SPAN&gt;sSheetName&lt;/SPAN&gt; = &lt;SPAN&gt;Left&lt;/SPAN&gt;(&lt;SPAN&gt;oSheet&lt;/SPAN&gt;.&lt;SPAN&gt;Name&lt;/SPAN&gt;, &lt;SPAN&gt;lPos&lt;/SPAN&gt; -1)
&lt;SPAN&gt;'find the sheet number&lt;/SPAN&gt;
&lt;SPAN&gt;iSheetNumber&lt;/SPAN&gt; = &lt;SPAN&gt;Right&lt;/SPAN&gt;(&lt;SPAN&gt;oSheet&lt;/SPAN&gt;.&lt;SPAN&gt;Name&lt;/SPAN&gt;, &lt;SPAN&gt;sLen&lt;/SPAN&gt; -&lt;SPAN&gt;lPos&lt;/SPAN&gt;)


&lt;SPAN&gt;'set PDF Options&lt;/SPAN&gt;
&lt;SPAN&gt;If&lt;/SPAN&gt; &lt;SPAN&gt;oPDFAddIn&lt;/SPAN&gt;.&lt;SPAN&gt;HasSaveCopyAsOptions&lt;/SPAN&gt;(&lt;SPAN&gt;oDataMedium&lt;/SPAN&gt;, &lt;SPAN&gt;oContext&lt;/SPAN&gt;, &lt;SPAN&gt;oOptions&lt;/SPAN&gt;) &lt;SPAN&gt;Then&lt;/SPAN&gt;
&lt;SPAN&gt;oOptions&lt;/SPAN&gt;.&lt;SPAN&gt;Value&lt;/SPAN&gt;(&lt;SPAN&gt;"All_Color_AS_Black"&lt;/SPAN&gt;) = 1
&lt;SPAN&gt;oOptions&lt;/SPAN&gt;.&lt;SPAN&gt;Value&lt;/SPAN&gt;(&lt;SPAN&gt;"Remove_Line_Weights"&lt;/SPAN&gt;) = 1
&lt;SPAN&gt;oOptions&lt;/SPAN&gt;.&lt;SPAN&gt;Value&lt;/SPAN&gt;(&lt;SPAN&gt;"Vector_Resolution"&lt;/SPAN&gt;) = 400
&lt;SPAN&gt;oOptions&lt;/SPAN&gt;.&lt;SPAN&gt;Value&lt;/SPAN&gt;(&lt;SPAN&gt;"Sheet_Range"&lt;/SPAN&gt;) = &lt;SPAN&gt;Inventor&lt;/SPAN&gt;.&lt;SPAN&gt;PrintRangeEnum&lt;/SPAN&gt;.&lt;SPAN&gt;kPrintAllSheets&lt;/SPAN&gt;
&lt;SPAN&gt;oOptions&lt;/SPAN&gt;.&lt;SPAN&gt;Value&lt;/SPAN&gt;(&lt;SPAN&gt;"Custom_Begin_Sheet"&lt;/SPAN&gt;) = &lt;SPAN&gt;iSheetNumber&lt;/SPAN&gt;
&lt;SPAN&gt;oOptions&lt;/SPAN&gt;.&lt;SPAN&gt;Value&lt;/SPAN&gt;(&lt;SPAN&gt;"Custom_End_Sheet"&lt;/SPAN&gt;) = &lt;SPAN&gt;iSheetNumber&lt;/SPAN&gt;
&lt;SPAN&gt;End&lt;/SPAN&gt; &lt;SPAN&gt;If&lt;/SPAN&gt;

&lt;SPAN&gt;'Set the PDF target file name&lt;/SPAN&gt;
&lt;SPAN&gt;'oDataMedium.FileName = oFolder &amp;amp; "\" &amp;amp; oFileName &amp;amp; " " &amp;amp; sSheetName &amp;amp; " " &amp;amp; iSheetNumber  &amp;amp; ".pdf"&lt;/SPAN&gt;
&lt;SPAN&gt;oDataMedium&lt;/SPAN&gt;.&lt;SPAN&gt;FileName&lt;/SPAN&gt; = &lt;SPAN&gt;oPath&lt;/SPAN&gt; &amp;amp; &lt;SPAN&gt;"\"&lt;/SPAN&gt; &amp;amp; &lt;SPAN&gt;oFileName&lt;/SPAN&gt; &amp;amp; &lt;SPAN&gt;"-"&lt;/SPAN&gt; &amp;amp; &lt;SPAN&gt;sSheetName&lt;/SPAN&gt; &amp;amp; &lt;SPAN&gt;"-"&lt;/SPAN&gt; &amp;amp; &lt;SPAN&gt;iSheetNumber&lt;/SPAN&gt;  &amp;amp; &lt;SPAN&gt;".pdf"&lt;/SPAN&gt;

&lt;SPAN&gt;'Publish document&lt;/SPAN&gt;
&lt;SPAN&gt;oPDFAddIn&lt;/SPAN&gt;.&lt;SPAN&gt;SaveCopyAs&lt;/SPAN&gt;(&lt;SPAN&gt;oDocument&lt;/SPAN&gt;, &lt;SPAN&gt;oContext&lt;/SPAN&gt;, &lt;SPAN&gt;oOptions&lt;/SPAN&gt;, &lt;SPAN&gt;oDataMedium&lt;/SPAN&gt;)


&lt;SPAN&gt;Next&lt;/SPAN&gt;
&lt;SPAN&gt;'------end of iLogic-------&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 24 Aug 2020 09:22:54 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2020-08-24T09:22:54Z</dc:date>
    <item>
      <title>error in PDF Ilogic snippet</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/error-in-pdf-ilogic-snippet/m-p/9707766#M114967</link>
      <description>&lt;P&gt;I have upgradet to inventor 2019, better late than never, and have encounter this small problem.&lt;/P&gt;&lt;P&gt;When i run my PDF ilogic it shows a error message that says&amp;nbsp; that i use the wrong pointer, and i dont know why&lt;/P&gt;&lt;P&gt;The ilogic should make a pdf of every drw sheet and store it in the workspace with the name: filename + sheet x.pdf&lt;/P&gt;&lt;DIV class="mceNonEditable lia-copypaste-placeholder"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;PDF snippet code is here:&lt;/P&gt;&lt;PRE&gt;&lt;SPAN&gt;oPath&lt;/SPAN&gt; = &lt;SPAN&gt;ThisDoc&lt;/SPAN&gt;.&lt;SPAN&gt;Path&lt;/SPAN&gt;
&lt;SPAN&gt;oFileName&lt;/SPAN&gt; = &lt;SPAN&gt;ThisDoc&lt;/SPAN&gt;.&lt;SPAN&gt;FileName&lt;/SPAN&gt;(&lt;SPAN&gt;False&lt;/SPAN&gt;) &lt;SPAN&gt;'without extension&lt;/SPAN&gt;
&lt;SPAN&gt;oPDFAddIn&lt;/SPAN&gt; = &lt;SPAN&gt;ThisApplication&lt;/SPAN&gt;.&lt;SPAN&gt;ApplicationAddIns&lt;/SPAN&gt;.&lt;SPAN&gt;ItemById&lt;/SPAN&gt; _
(&lt;SPAN&gt;"{0AC6FD96-2F4D-42CE-8BE0-8AEA580399E4}"&lt;/SPAN&gt;)
&lt;SPAN&gt;oDocument&lt;/SPAN&gt; = &lt;SPAN&gt;ThisApplication&lt;/SPAN&gt;.&lt;SPAN&gt;ActiveDocument&lt;/SPAN&gt;
&lt;SPAN&gt;oContext&lt;/SPAN&gt; = &lt;SPAN&gt;ThisApplication&lt;/SPAN&gt;.&lt;SPAN&gt;TransientObjects&lt;/SPAN&gt;.&lt;SPAN&gt;CreateTranslationContext&lt;/SPAN&gt;
&lt;SPAN&gt;oContext&lt;/SPAN&gt;.&lt;SPAN&gt;Type&lt;/SPAN&gt; = &lt;SPAN&gt;IOMechanismEnum&lt;/SPAN&gt;.&lt;SPAN&gt;kFileBrowseIOMechanism&lt;/SPAN&gt;
&lt;SPAN&gt;oOptions&lt;/SPAN&gt; = &lt;SPAN&gt;ThisApplication&lt;/SPAN&gt;.&lt;SPAN&gt;TransientObjects&lt;/SPAN&gt;.&lt;SPAN&gt;CreateNameValueMap&lt;/SPAN&gt;
&lt;SPAN&gt;oDataMedium&lt;/SPAN&gt; = &lt;SPAN&gt;ThisApplication&lt;/SPAN&gt;.&lt;SPAN&gt;TransientObjects&lt;/SPAN&gt;.&lt;SPAN&gt;CreateDataMedium&lt;/SPAN&gt;


&lt;SPAN&gt;'Define the drawing &lt;/SPAN&gt;
&lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;oDrawing&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;DrawingDocument&lt;/SPAN&gt;
&lt;SPAN&gt;oDrawing&lt;/SPAN&gt; = &lt;SPAN&gt;ThisDoc&lt;/SPAN&gt;.&lt;SPAN&gt;Document&lt;/SPAN&gt;


&lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;oSheet&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;Sheet&lt;/SPAN&gt;
&lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;lPos&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;Long&lt;/SPAN&gt;
&lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;rPos&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;Long&lt;/SPAN&gt;
&lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;sLen&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;Long&lt;/SPAN&gt;
&lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;sSheetName&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;String&lt;/SPAN&gt;
&lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;iSheetNumber&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;Integer&lt;/SPAN&gt;


&lt;SPAN&gt;'step through each drawing sheet&lt;/SPAN&gt;
&lt;SPAN&gt;For&lt;/SPAN&gt; &lt;SPAN&gt;Each&lt;/SPAN&gt; &lt;SPAN&gt;oSheet&lt;/SPAN&gt; &lt;SPAN&gt;In&lt;/SPAN&gt; &lt;SPAN&gt;oDrawing&lt;/SPAN&gt;.&lt;SPAN&gt;Sheets&lt;/SPAN&gt;


&lt;SPAN&gt;'find the seperator in the sheet name:number&lt;/SPAN&gt;
&lt;SPAN&gt;lPos&lt;/SPAN&gt; = &lt;SPAN&gt;InStr&lt;/SPAN&gt;(&lt;SPAN&gt;oSheet&lt;/SPAN&gt;.&lt;SPAN&gt;Name&lt;/SPAN&gt;, &lt;SPAN&gt;":"&lt;/SPAN&gt;)
&lt;SPAN&gt;'find the number of characters in the sheet name&lt;/SPAN&gt;
&lt;SPAN&gt;sLen&lt;/SPAN&gt; = &lt;SPAN&gt;Len&lt;/SPAN&gt;(&lt;SPAN&gt;oSheet&lt;/SPAN&gt;.&lt;SPAN&gt;Name&lt;/SPAN&gt;)
&lt;SPAN&gt;'find the sheet name&lt;/SPAN&gt;
&lt;SPAN&gt;sSheetName&lt;/SPAN&gt; = &lt;SPAN&gt;Left&lt;/SPAN&gt;(&lt;SPAN&gt;oSheet&lt;/SPAN&gt;.&lt;SPAN&gt;Name&lt;/SPAN&gt;, &lt;SPAN&gt;lPos&lt;/SPAN&gt; -1)
&lt;SPAN&gt;'find the sheet number&lt;/SPAN&gt;
&lt;SPAN&gt;iSheetNumber&lt;/SPAN&gt; = &lt;SPAN&gt;Right&lt;/SPAN&gt;(&lt;SPAN&gt;oSheet&lt;/SPAN&gt;.&lt;SPAN&gt;Name&lt;/SPAN&gt;, &lt;SPAN&gt;sLen&lt;/SPAN&gt; -&lt;SPAN&gt;lPos&lt;/SPAN&gt;)


&lt;SPAN&gt;'set PDF Options&lt;/SPAN&gt;
&lt;SPAN&gt;If&lt;/SPAN&gt; &lt;SPAN&gt;oPDFAddIn&lt;/SPAN&gt;.&lt;SPAN&gt;HasSaveCopyAsOptions&lt;/SPAN&gt;(&lt;SPAN&gt;oDataMedium&lt;/SPAN&gt;, &lt;SPAN&gt;oContext&lt;/SPAN&gt;, &lt;SPAN&gt;oOptions&lt;/SPAN&gt;) &lt;SPAN&gt;Then&lt;/SPAN&gt;
&lt;SPAN&gt;oOptions&lt;/SPAN&gt;.&lt;SPAN&gt;Value&lt;/SPAN&gt;(&lt;SPAN&gt;"All_Color_AS_Black"&lt;/SPAN&gt;) = 1
&lt;SPAN&gt;oOptions&lt;/SPAN&gt;.&lt;SPAN&gt;Value&lt;/SPAN&gt;(&lt;SPAN&gt;"Remove_Line_Weights"&lt;/SPAN&gt;) = 1
&lt;SPAN&gt;oOptions&lt;/SPAN&gt;.&lt;SPAN&gt;Value&lt;/SPAN&gt;(&lt;SPAN&gt;"Vector_Resolution"&lt;/SPAN&gt;) = 400
&lt;SPAN&gt;oOptions&lt;/SPAN&gt;.&lt;SPAN&gt;Value&lt;/SPAN&gt;(&lt;SPAN&gt;"Sheet_Range"&lt;/SPAN&gt;) = &lt;SPAN&gt;Inventor&lt;/SPAN&gt;.&lt;SPAN&gt;PrintRangeEnum&lt;/SPAN&gt;.&lt;SPAN&gt;kPrintAllSheets&lt;/SPAN&gt;
&lt;SPAN&gt;oOptions&lt;/SPAN&gt;.&lt;SPAN&gt;Value&lt;/SPAN&gt;(&lt;SPAN&gt;"Custom_Begin_Sheet"&lt;/SPAN&gt;) = &lt;SPAN&gt;iSheetNumber&lt;/SPAN&gt;
&lt;SPAN&gt;oOptions&lt;/SPAN&gt;.&lt;SPAN&gt;Value&lt;/SPAN&gt;(&lt;SPAN&gt;"Custom_End_Sheet"&lt;/SPAN&gt;) = &lt;SPAN&gt;iSheetNumber&lt;/SPAN&gt;
&lt;SPAN&gt;End&lt;/SPAN&gt; &lt;SPAN&gt;If&lt;/SPAN&gt;

&lt;SPAN&gt;'Set the PDF target file name&lt;/SPAN&gt;
&lt;SPAN&gt;'oDataMedium.FileName = oFolder &amp;amp; "\" &amp;amp; oFileName &amp;amp; " " &amp;amp; sSheetName &amp;amp; " " &amp;amp; iSheetNumber  &amp;amp; ".pdf"&lt;/SPAN&gt;
&lt;SPAN&gt;oDataMedium&lt;/SPAN&gt;.&lt;SPAN&gt;FileName&lt;/SPAN&gt; = &lt;SPAN&gt;oPath&lt;/SPAN&gt; &amp;amp; &lt;SPAN&gt;"\"&lt;/SPAN&gt; &amp;amp; &lt;SPAN&gt;oFileName&lt;/SPAN&gt; &amp;amp; &lt;SPAN&gt;"-"&lt;/SPAN&gt; &amp;amp; &lt;SPAN&gt;sSheetName&lt;/SPAN&gt; &amp;amp; &lt;SPAN&gt;"-"&lt;/SPAN&gt; &amp;amp; &lt;SPAN&gt;iSheetNumber&lt;/SPAN&gt;  &amp;amp; &lt;SPAN&gt;".pdf"&lt;/SPAN&gt;

&lt;SPAN&gt;'Publish document&lt;/SPAN&gt;
&lt;SPAN&gt;oPDFAddIn&lt;/SPAN&gt;.&lt;SPAN&gt;SaveCopyAs&lt;/SPAN&gt;(&lt;SPAN&gt;oDocument&lt;/SPAN&gt;, &lt;SPAN&gt;oContext&lt;/SPAN&gt;, &lt;SPAN&gt;oOptions&lt;/SPAN&gt;, &lt;SPAN&gt;oDataMedium&lt;/SPAN&gt;)


&lt;SPAN&gt;Next&lt;/SPAN&gt;
&lt;SPAN&gt;'------end of iLogic-------&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 24 Aug 2020 09:22:54 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/error-in-pdf-ilogic-snippet/m-p/9707766#M114967</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-08-24T09:22:54Z</dc:date>
    </item>
    <item>
      <title>Re: error in PDF Ilogic snippet</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/error-in-pdf-ilogic-snippet/m-p/9710037#M115038</link>
      <description>&lt;P&gt;@Anonymous&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please provide non confidential sample drawing document to test the iLogic code.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks and regards,&lt;/P&gt;</description>
      <pubDate>Tue, 25 Aug 2020 08:41:41 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/error-in-pdf-ilogic-snippet/m-p/9710037#M115038</guid>
      <dc:creator>chandra.shekar.g</dc:creator>
      <dc:date>2020-08-25T08:41:41Z</dc:date>
    </item>
    <item>
      <title>Re: error in PDF Ilogic snippet</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/error-in-pdf-ilogic-snippet/m-p/9710081#M115040</link>
      <description>&lt;P&gt;Hi @Anonymous&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;oPDFAddin.HasSaveCopyAsOptions takes the document as first argument, not DataMedium.&lt;/P&gt;&lt;P&gt;This should work &lt;img class="lia-deferred-image lia-image-emoji" src="https://forums.autodesk.com/html/@B4D44A73814D7FC0D950DEDFACB97081/emoticons/1f642.png" alt=":slightly_smiling_face:" title=":slightly_smiling_face:" /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;SPAN style="color: #800000;"&gt;oPath&lt;/SPAN&gt; = &lt;SPAN style="color: #800080;"&gt;ThisDoc&lt;/SPAN&gt;.&lt;SPAN style="color: #800080;"&gt;Path&lt;/SPAN&gt;
&lt;SPAN style="color: #800000;"&gt;oFileName&lt;/SPAN&gt; = &lt;SPAN style="color: #800080;"&gt;ThisDoc&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;FileName&lt;/SPAN&gt;(&lt;SPAN style="color: #ff0000;"&gt;False&lt;/SPAN&gt;) &lt;SPAN style="color: #808080;"&gt;'without extension&lt;/SPAN&gt;
&lt;SPAN style="color: #800000;"&gt;oPDFAddIn&lt;/SPAN&gt; = &lt;SPAN style="color: #800080;"&gt;ThisApplication&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;ApplicationAddIns&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;ItemById&lt;/SPAN&gt; _
(&lt;SPAN style="color: #008080;"&gt;"{0AC6FD96-2F4D-42CE-8BE0-8AEA580399E4}"&lt;/SPAN&gt;)
&lt;SPAN style="color: #800000;"&gt;oDocument&lt;/SPAN&gt; = &lt;SPAN style="color: #800080;"&gt;ThisApplication&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;ActiveDocument&lt;/SPAN&gt;
&lt;SPAN style="color: #800000;"&gt;oContext&lt;/SPAN&gt; = &lt;SPAN style="color: #800080;"&gt;ThisApplication&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;TransientObjects&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;CreateTranslationContext&lt;/SPAN&gt;
&lt;SPAN style="color: #800000;"&gt;oContext&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;Type&lt;/SPAN&gt; = &lt;SPAN style="color: #800000;"&gt;IOMechanismEnum&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;kFileBrowseIOMechanism&lt;/SPAN&gt;
&lt;SPAN style="color: #800000;"&gt;oOptions&lt;/SPAN&gt; = &lt;SPAN style="color: #800080;"&gt;ThisApplication&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;TransientObjects&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;CreateNameValueMap&lt;/SPAN&gt;
&lt;SPAN style="color: #800000;"&gt;oDataMedium&lt;/SPAN&gt; = &lt;SPAN style="color: #800080;"&gt;ThisApplication&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;TransientObjects&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;CreateDataMedium&lt;/SPAN&gt;


&lt;SPAN style="color: #808080;"&gt;'Define the drawing &lt;/SPAN&gt;
&lt;SPAN style="color: #ff0000;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;oDrawing&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;DrawingDocument&lt;/SPAN&gt;
&lt;SPAN style="color: #800000;"&gt;oDrawing&lt;/SPAN&gt; = &lt;SPAN style="color: #800080;"&gt;ThisDoc&lt;/SPAN&gt;.&lt;SPAN style="color: #800080;"&gt;Document&lt;/SPAN&gt;


&lt;SPAN style="color: #ff0000;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;oSheet&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;Sheet&lt;/SPAN&gt;
&lt;SPAN style="color: #ff0000;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;lPos&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;Long&lt;/SPAN&gt;
&lt;SPAN style="color: #ff0000;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;rPos&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;Long&lt;/SPAN&gt;
&lt;SPAN style="color: #ff0000;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;sLen&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;Long&lt;/SPAN&gt;
&lt;SPAN style="color: #ff0000;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;sSheetName&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;String&lt;/SPAN&gt;
&lt;SPAN style="color: #ff0000;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;iSheetNumber&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;Integer&lt;/SPAN&gt;


&lt;SPAN style="color: #808080;"&gt;'step through each drawing sheet&lt;/SPAN&gt;
&lt;SPAN style="color: #ff0000;"&gt;For&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;Each&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;oSheet&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;In&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;oDrawing&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;Sheets&lt;/SPAN&gt;


&lt;SPAN style="color: #808080;"&gt;'find the seperator in the sheet name:number&lt;/SPAN&gt;
&lt;SPAN style="color: #800000;"&gt;lPos&lt;/SPAN&gt; = &lt;SPAN style="color: #800000;"&gt;InStr&lt;/SPAN&gt;(&lt;SPAN style="color: #800000;"&gt;oSheet&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;Name&lt;/SPAN&gt;, &lt;SPAN style="color: #008080;"&gt;":"&lt;/SPAN&gt;)
&lt;SPAN style="color: #808080;"&gt;'find the number of characters in the sheet name&lt;/SPAN&gt;
&lt;SPAN style="color: #800000;"&gt;sLen&lt;/SPAN&gt; = &lt;SPAN style="color: #800000;"&gt;Len&lt;/SPAN&gt;(&lt;SPAN style="color: #800000;"&gt;oSheet&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;Name&lt;/SPAN&gt;)
&lt;SPAN style="color: #808080;"&gt;'find the sheet name&lt;/SPAN&gt;
&lt;SPAN style="color: #800000;"&gt;sSheetName&lt;/SPAN&gt; = &lt;SPAN style="color: #800000;"&gt;Left&lt;/SPAN&gt;(&lt;SPAN style="color: #800000;"&gt;oSheet&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;Name&lt;/SPAN&gt;, &lt;SPAN style="color: #800000;"&gt;lPos&lt;/SPAN&gt; -1)
&lt;SPAN style="color: #808080;"&gt;'find the sheet number&lt;/SPAN&gt;
&lt;SPAN style="color: #800000;"&gt;iSheetNumber&lt;/SPAN&gt; = &lt;SPAN style="color: #800000;"&gt;Right&lt;/SPAN&gt;(&lt;SPAN style="color: #800000;"&gt;oSheet&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;Name&lt;/SPAN&gt;, &lt;SPAN style="color: #800000;"&gt;sLen&lt;/SPAN&gt; -&lt;SPAN style="color: #800000;"&gt;lPos&lt;/SPAN&gt;)


&lt;SPAN style="color: #808080;"&gt;'set PDF Options&lt;/SPAN&gt;
&lt;SPAN style="color: #ff0000;"&gt;If&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;oPDFAddIn&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;HasSaveCopyAsOptions&lt;/SPAN&gt;(&lt;SPAN style="color: #800000;"&gt;oDrawing&lt;/SPAN&gt;, &lt;SPAN style="color: #800000;"&gt;oContext&lt;/SPAN&gt;, &lt;SPAN style="color: #800000;"&gt;oOptions&lt;/SPAN&gt;) &lt;SPAN style="color: #ff0000;"&gt;Then&lt;/SPAN&gt;
&lt;SPAN style="color: #800000;"&gt;oOptions&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;Value&lt;/SPAN&gt;(&lt;SPAN style="color: #008080;"&gt;"All_Color_AS_Black"&lt;/SPAN&gt;) = 1
&lt;SPAN style="color: #800000;"&gt;oOptions&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;Value&lt;/SPAN&gt;(&lt;SPAN style="color: #008080;"&gt;"Remove_Line_Weights"&lt;/SPAN&gt;) = 1
&lt;SPAN style="color: #800000;"&gt;oOptions&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;Value&lt;/SPAN&gt;(&lt;SPAN style="color: #008080;"&gt;"Vector_Resolution"&lt;/SPAN&gt;) = 400
&lt;SPAN style="color: #800000;"&gt;oOptions&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;Value&lt;/SPAN&gt;(&lt;SPAN style="color: #008080;"&gt;"Sheet_Range"&lt;/SPAN&gt;) = &lt;SPAN style="color: #800000;"&gt;Inventor&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;PrintRangeEnum&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;kPrintAllSheets&lt;/SPAN&gt;
&lt;SPAN style="color: #800000;"&gt;oOptions&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;Value&lt;/SPAN&gt;(&lt;SPAN style="color: #008080;"&gt;"Custom_Begin_Sheet"&lt;/SPAN&gt;) = &lt;SPAN style="color: #800000;"&gt;iSheetNumber&lt;/SPAN&gt;
&lt;SPAN style="color: #800000;"&gt;oOptions&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;Value&lt;/SPAN&gt;(&lt;SPAN style="color: #008080;"&gt;"Custom_End_Sheet"&lt;/SPAN&gt;) = &lt;SPAN style="color: #800000;"&gt;iSheetNumber&lt;/SPAN&gt;
&lt;SPAN style="color: #ff0000;"&gt;End&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;If&lt;/SPAN&gt;

&lt;SPAN style="color: #808080;"&gt;'Set the PDF target file name&lt;/SPAN&gt;
&lt;SPAN style="color: #808080;"&gt;'oDataMedium.FileName = oFolder &amp;amp; "\" &amp;amp; oFileName &amp;amp; " " &amp;amp; sSheetName &amp;amp; " " &amp;amp; iSheetNumber  &amp;amp; ".pdf"&lt;/SPAN&gt;
&lt;SPAN style="color: #800000;"&gt;oDataMedium&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;FileName&lt;/SPAN&gt; = &lt;SPAN style="color: #800000;"&gt;oPath&lt;/SPAN&gt; &amp;amp; &lt;SPAN style="color: #008080;"&gt;"\"&lt;/SPAN&gt; &amp;amp; &lt;SPAN style="color: #800000;"&gt;oFileName&lt;/SPAN&gt; &amp;amp; &lt;SPAN style="color: #008080;"&gt;"-"&lt;/SPAN&gt; &amp;amp; &lt;SPAN style="color: #800000;"&gt;sSheetName&lt;/SPAN&gt; &amp;amp; &lt;SPAN style="color: #008080;"&gt;"-"&lt;/SPAN&gt; &amp;amp; &lt;SPAN style="color: #800000;"&gt;iSheetNumber&lt;/SPAN&gt;  &amp;amp; &lt;SPAN style="color: #008080;"&gt;".pdf"&lt;/SPAN&gt;

&lt;SPAN style="color: #808080;"&gt;'Publish document&lt;/SPAN&gt;
&lt;SPAN style="color: #800000;"&gt;oPDFAddIn&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;SaveCopyAs&lt;/SPAN&gt;(&lt;SPAN style="color: #800000;"&gt;oDocument&lt;/SPAN&gt;, &lt;SPAN style="color: #800000;"&gt;oContext&lt;/SPAN&gt;, &lt;SPAN style="color: #800000;"&gt;oOptions&lt;/SPAN&gt;, &lt;SPAN style="color: #800000;"&gt;oDataMedium&lt;/SPAN&gt;)


&lt;SPAN style="color: #ff0000;"&gt;Next&lt;/SPAN&gt;
&lt;SPAN style="color: #808080;"&gt;'------end of iLogic-------&lt;/SPAN&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 25 Aug 2020 09:10:04 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/error-in-pdf-ilogic-snippet/m-p/9710081#M115040</guid>
      <dc:creator>JhoelForshav</dc:creator>
      <dc:date>2020-08-25T09:10:04Z</dc:date>
    </item>
    <item>
      <title>Re: error in PDF Ilogic snippet</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/error-in-pdf-ilogic-snippet/m-p/9710112#M115041</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/5330176"&gt;@JhoelForshav&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So I should substitute oDataMedium with oDrawing&amp;nbsp; in the entire snippet.&lt;/P&gt;&lt;P&gt;Excuse for my ignorance. I build this several years ago from different snippets by trial and error as I have no programming experience.&lt;/P&gt;&lt;P&gt;BTW I am amazed that i got an answer, because Yesterday my post did dissappear, and the forum support couldnt find any trace of it &lt;img class="lia-deferred-image lia-image-emoji" src="https://forums.autodesk.com/html/@B4D44A73814D7FC0D950DEDFACB97081/emoticons/1f642.png" alt=":slightly_smiling_face:" title=":slightly_smiling_face:" /&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 25 Aug 2020 09:31:42 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/error-in-pdf-ilogic-snippet/m-p/9710112#M115041</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-08-25T09:31:42Z</dc:date>
    </item>
    <item>
      <title>Re: error in PDF Ilogic snippet</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/error-in-pdf-ilogic-snippet/m-p/9710126#M115042</link>
      <description>&lt;P&gt;Hi @Anonymous&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;No, only in this line:&lt;/P&gt;&lt;PRE&gt;&lt;SPAN style="color: #ff0000;"&gt;If&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;oPDFAddIn&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;HasSaveCopyAsOptions&lt;/SPAN&gt;(&lt;SPAN style="color: #800000;"&gt;oDataMedium&lt;/SPAN&gt;, &lt;SPAN style="color: #800000;"&gt;oContext&lt;/SPAN&gt;, &lt;SPAN style="color: #800000;"&gt;oOptions&lt;/SPAN&gt;) &lt;SPAN style="color: #ff0000;"&gt;Then&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;It should be:&lt;/P&gt;&lt;PRE&gt;&lt;SPAN style="color: #ff0000;"&gt;If&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;oPDFAddIn&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;HasSaveCopyAsOptions&lt;/SPAN&gt;(&lt;SPAN style="color: #800000;"&gt;oDrawing&lt;/SPAN&gt;, &lt;SPAN style="color: #800000;"&gt;oContext&lt;/SPAN&gt;, &lt;SPAN style="color: #800000;"&gt;oOptions&lt;/SPAN&gt;) &lt;SPAN style="color: #ff0000;"&gt;Then&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;Like I did in the code I posted in my first reply &lt;img class="lia-deferred-image lia-image-emoji" src="https://forums.autodesk.com/html/@B4D44A73814D7FC0D950DEDFACB97081/emoticons/1f642.png" alt=":slightly_smiling_face:" title=":slightly_smiling_face:" /&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 25 Aug 2020 09:38:43 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/error-in-pdf-ilogic-snippet/m-p/9710126#M115042</guid>
      <dc:creator>JhoelForshav</dc:creator>
      <dc:date>2020-08-25T09:38:43Z</dc:date>
    </item>
    <item>
      <title>Re: error in PDF Ilogic snippet</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/error-in-pdf-ilogic-snippet/m-p/9710165#M115047</link>
      <description>&lt;P&gt;I tried that, but it didnt work.&lt;/P&gt;&lt;P&gt;I have attached the error message and the info to it&lt;/P&gt;</description>
      <pubDate>Tue, 25 Aug 2020 10:00:33 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/error-in-pdf-ilogic-snippet/m-p/9710165#M115047</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-08-25T10:00:33Z</dc:date>
    </item>
    <item>
      <title>Re: error in PDF Ilogic snippet</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/error-in-pdf-ilogic-snippet/m-p/9710181#M115048</link>
      <description>Is the drawing saved?&lt;BR /&gt;</description>
      <pubDate>Tue, 25 Aug 2020 10:12:09 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/error-in-pdf-ilogic-snippet/m-p/9710181#M115048</guid>
      <dc:creator>JhoelForshav</dc:creator>
      <dc:date>2020-08-25T10:12:09Z</dc:date>
    </item>
    <item>
      <title>Re: error in PDF Ilogic snippet</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/error-in-pdf-ilogic-snippet/m-p/9710215#M115051</link>
      <description>&lt;P&gt;Yes&lt;/P&gt;</description>
      <pubDate>Tue, 25 Aug 2020 10:33:17 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/error-in-pdf-ilogic-snippet/m-p/9710215#M115051</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-08-25T10:33:17Z</dc:date>
    </item>
    <item>
      <title>Re: error in PDF Ilogic snippet</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/error-in-pdf-ilogic-snippet/m-p/9710261#M115053</link>
      <description>&lt;P&gt;@Anonymous&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm sorry, but did you really run this rule?&lt;/P&gt;&lt;PRE&gt;&lt;SPAN style="color: #800000;"&gt;oPath&lt;/SPAN&gt; = &lt;SPAN style="color: #800080;"&gt;ThisDoc&lt;/SPAN&gt;.&lt;SPAN style="color: #800080;"&gt;Path&lt;/SPAN&gt;
&lt;SPAN style="color: #800000;"&gt;oFileName&lt;/SPAN&gt; = &lt;SPAN style="color: #800080;"&gt;ThisDoc&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;FileName&lt;/SPAN&gt;(&lt;SPAN style="color: #ff0000;"&gt;False&lt;/SPAN&gt;) &lt;SPAN style="color: #808080;"&gt;'without extension&lt;/SPAN&gt;
&lt;SPAN style="color: #800000;"&gt;oPDFAddIn&lt;/SPAN&gt; = &lt;SPAN style="color: #800080;"&gt;ThisApplication&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;ApplicationAddIns&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;ItemById&lt;/SPAN&gt; _
(&lt;SPAN style="color: #008080;"&gt;"{0AC6FD96-2F4D-42CE-8BE0-8AEA580399E4}"&lt;/SPAN&gt;)
&lt;SPAN style="color: #800000;"&gt;oDocument&lt;/SPAN&gt; = &lt;SPAN style="color: #800080;"&gt;ThisApplication&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;ActiveDocument&lt;/SPAN&gt;
&lt;SPAN style="color: #800000;"&gt;oContext&lt;/SPAN&gt; = &lt;SPAN style="color: #800080;"&gt;ThisApplication&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;TransientObjects&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;CreateTranslationContext&lt;/SPAN&gt;
&lt;SPAN style="color: #800000;"&gt;oContext&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;Type&lt;/SPAN&gt; = &lt;SPAN style="color: #800000;"&gt;IOMechanismEnum&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;kFileBrowseIOMechanism&lt;/SPAN&gt;
&lt;SPAN style="color: #800000;"&gt;oOptions&lt;/SPAN&gt; = &lt;SPAN style="color: #800080;"&gt;ThisApplication&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;TransientObjects&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;CreateNameValueMap&lt;/SPAN&gt;
&lt;SPAN style="color: #800000;"&gt;oDataMedium&lt;/SPAN&gt; = &lt;SPAN style="color: #800080;"&gt;ThisApplication&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;TransientObjects&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;CreateDataMedium&lt;/SPAN&gt;


&lt;SPAN style="color: #808080;"&gt;'Define the drawing &lt;/SPAN&gt;
&lt;SPAN style="color: #ff0000;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;oDrawing&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;DrawingDocument&lt;/SPAN&gt;
&lt;SPAN style="color: #800000;"&gt;oDrawing&lt;/SPAN&gt; = &lt;SPAN style="color: #800080;"&gt;ThisDoc&lt;/SPAN&gt;.&lt;SPAN style="color: #800080;"&gt;Document&lt;/SPAN&gt;


&lt;SPAN style="color: #ff0000;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;oSheet&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;Sheet&lt;/SPAN&gt;
&lt;SPAN style="color: #ff0000;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;lPos&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;Long&lt;/SPAN&gt;
&lt;SPAN style="color: #ff0000;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;rPos&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;Long&lt;/SPAN&gt;
&lt;SPAN style="color: #ff0000;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;sLen&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;Long&lt;/SPAN&gt;
&lt;SPAN style="color: #ff0000;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;sSheetName&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;String&lt;/SPAN&gt;
&lt;SPAN style="color: #ff0000;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;iSheetNumber&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;Integer&lt;/SPAN&gt;


&lt;SPAN style="color: #808080;"&gt;'step through each drawing sheet&lt;/SPAN&gt;
&lt;SPAN style="color: #ff0000;"&gt;For&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;Each&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;oSheet&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;In&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;oDrawing&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;Sheets&lt;/SPAN&gt;


&lt;SPAN style="color: #808080;"&gt;'find the seperator in the sheet name:number&lt;/SPAN&gt;
&lt;SPAN style="color: #800000;"&gt;lPos&lt;/SPAN&gt; = &lt;SPAN style="color: #800000;"&gt;InStr&lt;/SPAN&gt;(&lt;SPAN style="color: #800000;"&gt;oSheet&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;Name&lt;/SPAN&gt;, &lt;SPAN style="color: #008080;"&gt;":"&lt;/SPAN&gt;)
&lt;SPAN style="color: #808080;"&gt;'find the number of characters in the sheet name&lt;/SPAN&gt;
&lt;SPAN style="color: #800000;"&gt;sLen&lt;/SPAN&gt; = &lt;SPAN style="color: #800000;"&gt;Len&lt;/SPAN&gt;(&lt;SPAN style="color: #800000;"&gt;oSheet&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;Name&lt;/SPAN&gt;)
&lt;SPAN style="color: #808080;"&gt;'find the sheet name&lt;/SPAN&gt;
&lt;SPAN style="color: #800000;"&gt;sSheetName&lt;/SPAN&gt; = &lt;SPAN style="color: #800000;"&gt;Left&lt;/SPAN&gt;(&lt;SPAN style="color: #800000;"&gt;oSheet&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;Name&lt;/SPAN&gt;, &lt;SPAN style="color: #800000;"&gt;lPos&lt;/SPAN&gt; -1)
&lt;SPAN style="color: #808080;"&gt;'find the sheet number&lt;/SPAN&gt;
&lt;SPAN style="color: #800000;"&gt;iSheetNumber&lt;/SPAN&gt; = &lt;SPAN style="color: #800000;"&gt;Right&lt;/SPAN&gt;(&lt;SPAN style="color: #800000;"&gt;oSheet&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;Name&lt;/SPAN&gt;, &lt;SPAN style="color: #800000;"&gt;sLen&lt;/SPAN&gt; -&lt;SPAN style="color: #800000;"&gt;lPos&lt;/SPAN&gt;)


&lt;SPAN style="color: #808080;"&gt;'Set PDF Options&lt;/SPAN&gt;
&lt;SPAN style="color: #ff0000;"&gt;If&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;oPDFAddIn&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;HasSaveCopyAsOptions&lt;/SPAN&gt;(&lt;SPAN style="color: #800000;"&gt;oDrawing&lt;/SPAN&gt;, &lt;SPAN style="color: #800000;"&gt;oContext&lt;/SPAN&gt;, &lt;SPAN style="color: #800000;"&gt;oOptions&lt;/SPAN&gt;) &lt;SPAN style="color: #ff0000;"&gt;Then&lt;/SPAN&gt;
&lt;SPAN style="color: #800000;"&gt;oOptions&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;Value&lt;/SPAN&gt;(&lt;SPAN style="color: #008080;"&gt;"All_Color_AS_Black"&lt;/SPAN&gt;) = 1
&lt;SPAN style="color: #800000;"&gt;oOptions&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;Value&lt;/SPAN&gt;(&lt;SPAN style="color: #008080;"&gt;"Remove_Line_Weights"&lt;/SPAN&gt;) = 1
&lt;SPAN style="color: #800000;"&gt;oOptions&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;Value&lt;/SPAN&gt;(&lt;SPAN style="color: #008080;"&gt;"Vector_Resolution"&lt;/SPAN&gt;) = 400
&lt;SPAN style="color: #800000;"&gt;oOptions&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;Value&lt;/SPAN&gt;(&lt;SPAN style="color: #008080;"&gt;"Sheet_Range"&lt;/SPAN&gt;) = &lt;SPAN style="color: #800000;"&gt;Inventor&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;PrintRangeEnum&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;kPrintAllSheets&lt;/SPAN&gt;
&lt;SPAN style="color: #800000;"&gt;oOptions&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;Value&lt;/SPAN&gt;(&lt;SPAN style="color: #008080;"&gt;"Custom_Begin_Sheet"&lt;/SPAN&gt;) = &lt;SPAN style="color: #800000;"&gt;iSheetNumber&lt;/SPAN&gt;
&lt;SPAN style="color: #800000;"&gt;oOptions&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;Value&lt;/SPAN&gt;(&lt;SPAN style="color: #008080;"&gt;"Custom_End_Sheet"&lt;/SPAN&gt;) = &lt;SPAN style="color: #800000;"&gt;iSheetNumber&lt;/SPAN&gt;
&lt;SPAN style="color: #ff0000;"&gt;End&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;If&lt;/SPAN&gt;

&lt;SPAN style="color: #808080;"&gt;'Set the PDF target file name&lt;/SPAN&gt;
&lt;SPAN style="color: #808080;"&gt;'oDataMedium.FileName = oFolder &amp;amp; "\" &amp;amp; oFileName &amp;amp; " " &amp;amp; sSheetName &amp;amp; " " &amp;amp; iSheetNumber  &amp;amp; ".pdf"&lt;/SPAN&gt;
&lt;SPAN style="color: #800000;"&gt;oDataMedium&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;FileName&lt;/SPAN&gt; = &lt;SPAN style="color: #800000;"&gt;oPath&lt;/SPAN&gt; &amp;amp; &lt;SPAN style="color: #008080;"&gt;"\"&lt;/SPAN&gt; &amp;amp; &lt;SPAN style="color: #800000;"&gt;oFileName&lt;/SPAN&gt; &amp;amp; &lt;SPAN style="color: #008080;"&gt;"-"&lt;/SPAN&gt; &amp;amp; &lt;SPAN style="color: #800000;"&gt;sSheetName&lt;/SPAN&gt; &amp;amp; &lt;SPAN style="color: #008080;"&gt;"-"&lt;/SPAN&gt; &amp;amp; &lt;SPAN style="color: #800000;"&gt;iSheetNumber&lt;/SPAN&gt;  &amp;amp; &lt;SPAN style="color: #008080;"&gt;".pdf"&lt;/SPAN&gt;

&lt;SPAN style="color: #808080;"&gt;'Publish document&lt;/SPAN&gt;
&lt;SPAN style="color: #800000;"&gt;oPDFAddIn&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;SaveCopyAs&lt;/SPAN&gt;(&lt;SPAN style="color: #800000;"&gt;oDocument&lt;/SPAN&gt;, &lt;SPAN style="color: #800000;"&gt;oContext&lt;/SPAN&gt;, &lt;SPAN style="color: #800000;"&gt;oOptions&lt;/SPAN&gt;, &lt;SPAN style="color: #800000;"&gt;oDataMedium&lt;/SPAN&gt;)


&lt;SPAN style="color: #ff0000;"&gt;Next&lt;/SPAN&gt;
&lt;SPAN style="color: #808080;"&gt;'------end of iLogic-------&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;Because the error message you attached is the error message you get if you don't replace oDataMedium with oDrawing in oPDFAddIn.HasSaveCopyAsOptions....&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You could also run it like this...&lt;/P&gt;&lt;PRE&gt;&lt;SPAN style="color: #800000;"&gt;oPath&lt;/SPAN&gt; = &lt;SPAN style="color: #800080;"&gt;ThisDoc&lt;/SPAN&gt;.&lt;SPAN style="color: #800080;"&gt;Path&lt;/SPAN&gt;
&lt;SPAN style="color: #800000;"&gt;oFileName&lt;/SPAN&gt; = &lt;SPAN style="color: #800080;"&gt;ThisDoc&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;FileName&lt;/SPAN&gt;(&lt;SPAN style="color: #ff0000;"&gt;False&lt;/SPAN&gt;) &lt;SPAN style="color: #808080;"&gt;'without extension&lt;/SPAN&gt;
&lt;SPAN style="color: #800000;"&gt;oPDFAddIn&lt;/SPAN&gt; = &lt;SPAN style="color: #800080;"&gt;ThisApplication&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;ApplicationAddIns&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;ItemById&lt;/SPAN&gt; _
(&lt;SPAN style="color: #008080;"&gt;"{0AC6FD96-2F4D-42CE-8BE0-8AEA580399E4}"&lt;/SPAN&gt;)
&lt;SPAN style="color: #800000;"&gt;oDocument&lt;/SPAN&gt; = &lt;SPAN style="color: #800080;"&gt;ThisApplication&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;ActiveDocument&lt;/SPAN&gt;
&lt;SPAN style="color: #800000;"&gt;oContext&lt;/SPAN&gt; = &lt;SPAN style="color: #800080;"&gt;ThisApplication&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;TransientObjects&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;CreateTranslationContext&lt;/SPAN&gt;
&lt;SPAN style="color: #800000;"&gt;oContext&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;Type&lt;/SPAN&gt; = &lt;SPAN style="color: #800000;"&gt;IOMechanismEnum&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;kFileBrowseIOMechanism&lt;/SPAN&gt;
&lt;SPAN style="color: #800000;"&gt;oOptions&lt;/SPAN&gt; = &lt;SPAN style="color: #800080;"&gt;ThisApplication&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;TransientObjects&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;CreateNameValueMap&lt;/SPAN&gt;
&lt;SPAN style="color: #800000;"&gt;oDataMedium&lt;/SPAN&gt; = &lt;SPAN style="color: #800080;"&gt;ThisApplication&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;TransientObjects&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;CreateDataMedium&lt;/SPAN&gt;


&lt;SPAN style="color: #808080;"&gt;'Define the drawing &lt;/SPAN&gt;
&lt;SPAN style="color: #ff0000;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;oDrawing&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;DrawingDocument&lt;/SPAN&gt;
&lt;SPAN style="color: #800000;"&gt;oDrawing&lt;/SPAN&gt; = &lt;SPAN style="color: #800080;"&gt;ThisDoc&lt;/SPAN&gt;.&lt;SPAN style="color: #800080;"&gt;Document&lt;/SPAN&gt;


&lt;SPAN style="color: #ff0000;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;oSheet&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;Sheet&lt;/SPAN&gt;
&lt;SPAN style="color: #ff0000;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;lPos&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;Long&lt;/SPAN&gt;
&lt;SPAN style="color: #ff0000;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;rPos&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;Long&lt;/SPAN&gt;
&lt;SPAN style="color: #ff0000;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;sLen&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;Long&lt;/SPAN&gt;
&lt;SPAN style="color: #ff0000;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;sSheetName&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;String&lt;/SPAN&gt;
&lt;SPAN style="color: #ff0000;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;iSheetNumber&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;Integer&lt;/SPAN&gt;


&lt;SPAN style="color: #808080;"&gt;'step through each drawing sheet&lt;/SPAN&gt;
&lt;SPAN style="color: #ff0000;"&gt;For&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;Each&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;oSheet&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;In&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;oDrawing&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;Sheets&lt;/SPAN&gt;


&lt;SPAN style="color: #808080;"&gt;'find the seperator in the sheet name:number&lt;/SPAN&gt;
&lt;SPAN style="color: #800000;"&gt;lPos&lt;/SPAN&gt; = &lt;SPAN style="color: #800000;"&gt;InStr&lt;/SPAN&gt;(&lt;SPAN style="color: #800000;"&gt;oSheet&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;Name&lt;/SPAN&gt;, &lt;SPAN style="color: #008080;"&gt;":"&lt;/SPAN&gt;)
&lt;SPAN style="color: #808080;"&gt;'find the number of characters in the sheet name&lt;/SPAN&gt;
&lt;SPAN style="color: #800000;"&gt;sLen&lt;/SPAN&gt; = &lt;SPAN style="color: #800000;"&gt;Len&lt;/SPAN&gt;(&lt;SPAN style="color: #800000;"&gt;oSheet&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;Name&lt;/SPAN&gt;)
&lt;SPAN style="color: #808080;"&gt;'find the sheet name&lt;/SPAN&gt;
&lt;SPAN style="color: #800000;"&gt;sSheetName&lt;/SPAN&gt; = &lt;SPAN style="color: #800000;"&gt;Left&lt;/SPAN&gt;(&lt;SPAN style="color: #800000;"&gt;oSheet&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;Name&lt;/SPAN&gt;, &lt;SPAN style="color: #800000;"&gt;lPos&lt;/SPAN&gt; -1)
&lt;SPAN style="color: #808080;"&gt;'find the sheet number&lt;/SPAN&gt;
&lt;SPAN style="color: #800000;"&gt;iSheetNumber&lt;/SPAN&gt; = &lt;SPAN style="color: #800000;"&gt;Right&lt;/SPAN&gt;(&lt;SPAN style="color: #800000;"&gt;oSheet&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;Name&lt;/SPAN&gt;, &lt;SPAN style="color: #800000;"&gt;sLen&lt;/SPAN&gt; -&lt;SPAN style="color: #800000;"&gt;lPos&lt;/SPAN&gt;)


&lt;SPAN style="color: #808080;"&gt;'Set PDF Options&lt;/SPAN&gt;

&lt;SPAN style="color: #800000;"&gt;oOptions&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;Value&lt;/SPAN&gt;(&lt;SPAN style="color: #008080;"&gt;"All_Color_AS_Black"&lt;/SPAN&gt;) = 1
&lt;SPAN style="color: #800000;"&gt;oOptions&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;Value&lt;/SPAN&gt;(&lt;SPAN style="color: #008080;"&gt;"Remove_Line_Weights"&lt;/SPAN&gt;) = 1
&lt;SPAN style="color: #800000;"&gt;oOptions&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;Value&lt;/SPAN&gt;(&lt;SPAN style="color: #008080;"&gt;"Vector_Resolution"&lt;/SPAN&gt;) = 400
&lt;SPAN style="color: #800000;"&gt;oOptions&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;Value&lt;/SPAN&gt;(&lt;SPAN style="color: #008080;"&gt;"Sheet_Range"&lt;/SPAN&gt;) = &lt;SPAN style="color: #800000;"&gt;Inventor&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;PrintRangeEnum&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;kPrintAllSheets&lt;/SPAN&gt;
&lt;SPAN style="color: #800000;"&gt;oOptions&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;Value&lt;/SPAN&gt;(&lt;SPAN style="color: #008080;"&gt;"Custom_Begin_Sheet"&lt;/SPAN&gt;) = &lt;SPAN style="color: #800000;"&gt;iSheetNumber&lt;/SPAN&gt;
&lt;SPAN style="color: #800000;"&gt;oOptions&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;Value&lt;/SPAN&gt;(&lt;SPAN style="color: #008080;"&gt;"Custom_End_Sheet"&lt;/SPAN&gt;) = &lt;SPAN style="color: #800000;"&gt;iSheetNumber&lt;/SPAN&gt;


&lt;SPAN style="color: #808080;"&gt;'Set the PDF target file name&lt;/SPAN&gt;
&lt;SPAN style="color: #808080;"&gt;'oDataMedium.FileName = oFolder &amp;amp; "\" &amp;amp; oFileName &amp;amp; " " &amp;amp; sSheetName &amp;amp; " " &amp;amp; iSheetNumber  &amp;amp; ".pdf"&lt;/SPAN&gt;
&lt;SPAN style="color: #800000;"&gt;oDataMedium&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;FileName&lt;/SPAN&gt; = &lt;SPAN style="color: #800000;"&gt;oPath&lt;/SPAN&gt; &amp;amp; &lt;SPAN style="color: #008080;"&gt;"\"&lt;/SPAN&gt; &amp;amp; &lt;SPAN style="color: #800000;"&gt;oFileName&lt;/SPAN&gt; &amp;amp; &lt;SPAN style="color: #008080;"&gt;"-"&lt;/SPAN&gt; &amp;amp; &lt;SPAN style="color: #800000;"&gt;sSheetName&lt;/SPAN&gt; &amp;amp; &lt;SPAN style="color: #008080;"&gt;"-"&lt;/SPAN&gt; &amp;amp; &lt;SPAN style="color: #800000;"&gt;iSheetNumber&lt;/SPAN&gt;  &amp;amp; &lt;SPAN style="color: #008080;"&gt;".pdf"&lt;/SPAN&gt;

&lt;SPAN style="color: #808080;"&gt;'Publish document&lt;/SPAN&gt;
&lt;SPAN style="color: #800000;"&gt;oPDFAddIn&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;SaveCopyAs&lt;/SPAN&gt;(&lt;SPAN style="color: #800000;"&gt;oDocument&lt;/SPAN&gt;, &lt;SPAN style="color: #800000;"&gt;oContext&lt;/SPAN&gt;, &lt;SPAN style="color: #800000;"&gt;oOptions&lt;/SPAN&gt;, &lt;SPAN style="color: #800000;"&gt;oDataMedium&lt;/SPAN&gt;)


&lt;SPAN style="color: #ff0000;"&gt;Next&lt;/SPAN&gt;
&lt;SPAN style="color: #808080;"&gt;'------end of iLogic-------&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 25 Aug 2020 10:59:58 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/error-in-pdf-ilogic-snippet/m-p/9710261#M115053</guid>
      <dc:creator>JhoelForshav</dc:creator>
      <dc:date>2020-08-25T10:59:58Z</dc:date>
    </item>
    <item>
      <title>Re: error in PDF Ilogic snippet</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/error-in-pdf-ilogic-snippet/m-p/9710272#M115054</link>
      <description>&lt;P&gt;That solved my problem.&lt;/P&gt;&lt;P&gt;I used you solution 2 without the&lt;/P&gt;&lt;PRE&gt;&lt;SPAN&gt;If&lt;/SPAN&gt; &lt;SPAN&gt;oPDFAddIn&lt;/SPAN&gt;.&lt;SPAN&gt;HasSaveCopyAsOptions&lt;/SPAN&gt;(&lt;SPAN&gt;oDrawing&lt;/SPAN&gt;, &lt;SPAN&gt;oContext&lt;/SPAN&gt;, &lt;SPAN&gt;oOptions&lt;/SPAN&gt;) &lt;SPAN&gt;Then &lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;and the end if&lt;/P&gt;</description>
      <pubDate>Tue, 25 Aug 2020 11:05:37 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/error-in-pdf-ilogic-snippet/m-p/9710272#M115054</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-08-25T11:05:37Z</dc:date>
    </item>
    <item>
      <title>Re: error in PDF Ilogic snippet</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/error-in-pdf-ilogic-snippet/m-p/9710275#M115056</link>
      <description>&lt;P&gt;Thanks a lot. You were most helpfull&lt;/P&gt;&lt;P&gt;Tack så mycket&lt;/P&gt;</description>
      <pubDate>Tue, 25 Aug 2020 11:07:47 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/error-in-pdf-ilogic-snippet/m-p/9710275#M115056</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-08-25T11:07:47Z</dc:date>
    </item>
  </channel>
</rss>

