<?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: Save PDF using iLogic and name after revision number? in Inventor Programming Forum</title>
    <link>https://forums.autodesk.com/t5/inventor-programming-forum/save-pdf-using-ilogic-and-name-after-revision-number/m-p/4356645#M140022</link>
    <description>&lt;P&gt;Curtis, it is great how you use ilogic and i used your code&amp;nbsp; to save each sheet as a single PDF into the same folder that the DWG/IDW resides in.&lt;/P&gt;&lt;P&gt;But i want to create a folder calded "PDF" in the same folder where the DWG resides in and put in de pfd's.&lt;/P&gt;&lt;P&gt;I hope you can help me out.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks, Jos&lt;/P&gt;</description>
    <pubDate>Wed, 07 Aug 2013 09:32:45 GMT</pubDate>
    <dc:creator>jostroopers</dc:creator>
    <dc:date>2013-08-07T09:32:45Z</dc:date>
    <item>
      <title>Save PDF using iLogic and name after revision number?</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/save-pdf-using-ilogic-and-name-after-revision-number/m-p/3083882#M139997</link>
      <description>&lt;P&gt;Hello!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My question: We want to use iLogic to save a PDF-file of the DWG-drawing every time we hit "save". We now use the following iLogic code:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;﻿﻿﻿﻿﻿﻿&lt;/P&gt;&lt;LI-SPOILER&gt;oPath = ThisDoc.Path PN = iProperties.Value("Project", "Part Number") PDFAddIn = ThisApplication.ApplicationAddIns.ItemById("{0AC6FD96-2F4D-42CE-8BE0-8AEA580399E4}") oDocument = ThisApplication.ActiveDocument oContext = ThisApplication.TransientObjects.CreateTranslationContext oContext.Type = IOMechanismEnum.kFileBrowseIOMechanism oOptions = ThisApplication.TransientObjects.CreateNameValueMap oDataMedium = ThisApplication.TransientObjects.CreateDataMedium&amp;nbsp; If PDFAddIn.HasSaveCopyAsOptions(oDataMedium, oContext, oOptions) Then oOptions.Value("All_Color_AS_Black") = 1 oOptions.Value("Remove_Line_Weights") = 1 oOptions.Value("Vector_Resolution") = 400 oOptions.Value("Sheet_Range") = Inventor.PrintRangeEnum.kPrintAllSheets 'oOptions.Value("Custom_Begin_Sheet") = 2 'oOptions.Value("Custom_End_Sheet") = 4 End If&amp;nbsp; 'Set the destination file name oDataMedium.FileName = oPath &amp;amp; "\" &amp;amp; PN &amp;amp; ".pdf"&amp;nbsp; 'Publish document PDFAddIn.SaveCopyAs(oDocument, oContext, oOptions,oDataMedium)&amp;nbsp; 'Confirmation message MessageBox.Show("PDF SAVED TO: " &amp;amp; oDataMedium.FileName ,"PDF Saved", MessageBoxButtons.OK)﻿&lt;/LI-SPOILER&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Question 1: Is it possible to save the PDF in a new folder that lies "one step up". For example: My DWG-file is placed in c:/drawings/thing4/DWG, I want the PDF to end up in c:/drawings/thing4/PDF. If I am in folder "c:/drawings/thing2/DWG" I want the PDF to end up in "c:/drawings/﻿thing2/PDF" etc. Possible?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Question 2: My DWG files is named "thing4.dwg" and it is the 2nd revision. I want the PDF-file to be named&lt;/P&gt;&lt;P&gt;"thing4 Ed2.pdf". Possible?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any help would be very appreciated!&lt;/P&gt;&lt;P&gt;/Gustav&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 07 Jul 2011 14:48:31 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/save-pdf-using-ilogic-and-name-after-revision-number/m-p/3083882#M139997</guid>
      <dc:creator>GustavStigsohn</dc:creator>
      <dc:date>2011-07-07T14:48:31Z</dc:date>
    </item>
    <item>
      <title>Re: Save PDF using iLogic and name after revision number?</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/save-pdf-using-ilogic-and-name-after-revision-number/m-p/3084572#M139998</link>
      <description>&lt;P&gt;1. Yes you can. You will just need to use a different path instead of oPath in this line: oDataMedium.FileName = oPath &amp;amp; "\" &amp;amp; PN &amp;amp; ".pdf"&amp;nbsp; 'Publish document ﻿&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;2. Yes this is possible. You will need to get the revision of the file using iProperties.value("Project, "Revision Number") and set it as a variable. Then in your code when you give the PDF the file name, you will need to append that to the file name.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So what you want to do can be done.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;BTW, this question may be best in the Inventor Customization forum.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Dan&lt;/P&gt;</description>
      <pubDate>Thu, 07 Jul 2011 21:11:26 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/save-pdf-using-ilogic-and-name-after-revision-number/m-p/3084572#M139998</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2011-07-07T21:11:26Z</dc:date>
    </item>
    <item>
      <title>Re: Save PDF using iLogic and name after revision number?</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/save-pdf-using-ilogic-and-name-after-revision-number/m-p/3084754#M139999</link>
      <description>&lt;P&gt;Hi GustavStigsohn﻿,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You can find an example rule at this link:&lt;/P&gt;&lt;P&gt;&lt;A target="_blank" href="http://inventortrenches.blogspot.com/2011/07/ilogic-to-save-pdf-files-to-new.html"&gt;http://inventortrenches.blogspot.com/2011/07/ilogic-to-save-pdf-files-to-new.html&lt;/A&gt;﻿&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I hope this helps,&lt;/P&gt;&lt;P&gt;Best of luck to you in all of your iLogic and Inventor pursuits,&lt;/P&gt;&lt;P&gt;Curtis&lt;/P&gt;&lt;P&gt;&lt;A href="http://inventortrenches.blogspot.com/" target="_blank" rel="nofollow"&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;</description>
      <pubDate>Fri, 08 Jul 2011 01:44:34 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/save-pdf-using-ilogic-and-name-after-revision-number/m-p/3084754#M139999</guid>
      <dc:creator>Curtis_W</dc:creator>
      <dc:date>2011-07-08T01:44:34Z</dc:date>
    </item>
    <item>
      <title>Re: Save PDF using iLogic and name after revision number?</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/save-pdf-using-ilogic-and-name-after-revision-number/m-p/3084846#M140000</link>
      <description>&lt;P&gt;Big thanks to you both! It works like a charm.&lt;/P&gt;</description>
      <pubDate>Fri, 08 Jul 2011 06:20:43 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/save-pdf-using-ilogic-and-name-after-revision-number/m-p/3084846#M140000</guid>
      <dc:creator>GustavStigsohn</dc:creator>
      <dc:date>2011-07-08T06:20:43Z</dc:date>
    </item>
    <item>
      <title>Re: Save PDF using iLogic and name after revision number?</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/save-pdf-using-ilogic-and-name-after-revision-number/m-p/3345415#M140001</link>
      <description>&lt;P&gt;Hi Curtis,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried the iLogic code from your link, and it works very well. I was able to modify the code to suit our pdf file naming conventions. Do you know how to change the code to get it to save a drawing to AutoCAD.dwg (2004) format as well?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;We also have quite a few Inventor drawings that have multiple drawing sheets per drawing file.&lt;/P&gt;&lt;P&gt;The drawing number for each sheet is taken from the Part Number field of the part or assembly detailed on that sheet. These different sheets have individual revisions, which is driven by the &amp;lt;Sheet Revision&amp;gt; property.&lt;/P&gt;&lt;P&gt;So we have an Inventor drawing file like this:&lt;/P&gt;&lt;P&gt;ABC-123.dwg, which contains drawing numbers:&lt;/P&gt;&lt;P&gt;ABC-123-01, ABC-123-02, ABC-123-03 etc.&lt;/P&gt;&lt;P&gt;It would be a real time saver if we could export all sheets in one iLogic rule to separate PDF's, i.e.:&lt;/P&gt;&lt;P&gt;ABC-123-01rev2.pdf&lt;/P&gt;&lt;P&gt;ABC-123-02rev1.pdf&lt;/P&gt;&lt;P&gt;ABC-123-03rev0.pdf&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm only just starting out with iLogic so am not yet equipped to take your code and customize to suit my needs.&lt;/P&gt;&lt;P&gt;Appreciate any help!&lt;/P&gt;</description>
      <pubDate>Fri, 24 Feb 2012 01:07:00 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/save-pdf-using-ilogic-and-name-after-revision-number/m-p/3345415#M140001</guid>
      <dc:creator>DVDM</dc:creator>
      <dc:date>2012-02-24T01:07:00Z</dc:date>
    </item>
    <item>
      <title>Re: Save PDF using iLogic and name after revision number?</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/save-pdf-using-ilogic-and-name-after-revision-number/m-p/3346385#M140002</link>
      <description>&lt;P&gt;Hi DCDM,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is an example rule that tranlsates an Inventor drawing to an AutoCAD 2004 DWG.&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 target="_blank" href="http://inventortrenches.blogspot.com"&gt;http://inventortrenches.blogspot.com&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;'------- start of iLogic code ------------------- 
' Get the DWG translator Add-In. 
Dim DWGAddIn As TranslatorAddIn 
DWGAddIn = ThisApplication.ApplicationAddIns.ItemById _
("{C24E3AC4-122E-11D5-8E91-0010B541CD80}") 

'Set a reference to the active document 
Dim oDocument As Document 
oDocument = ThisApplication.ActiveDocument 
Dim oContext As TranslationContext 
oContext = ThisApplication.TransientObjects.CreateTranslationContext 
oContext.Type = IOMechanismEnum.kFileBrowseIOMechanism 
' Create a NameValueMap object 
Dim oOptions As NameValueMap 
oOptions = ThisApplication.TransientObjects.CreateNameValueMap 

' Create a DataMedium object 
Dim oDataMedium As DataMedium 
oDataMedium = ThisApplication.TransientObjects.CreateDataMedium 

' Check whether the translator has 'SaveCopyAs' options 
If DWGAddIn.HasSaveCopyAsOptions(oDocument, oContext, oOptions) Then 
    ' DWG version.
    ' 23 = ACAD 2000
    ' 25 = ACAD 2004
    ' 27 = ACAD 2007
    ' 29 = ACAD 2010 
    oOptions.Value("DwgVersion") = 25
Dim strIniFile As String 
strIniFile = "C:\temp\DWGout.ini" 
' Create the name-value that specifies the ini file to use. 
oOptions.Value("Export_Acad_IniFile") = strIniFile 
End If 

'get path and file name
path_and_name = ThisDoc.PathAndFileName(False) ' without extension

'Set the DWG target file name
oDataMedium.FileName = path_and_name &amp;amp; ".DWG"
DWGAddIn.SaveCopyAs(oDocument, oContext, oOptions, oDataMedium) 
'------- end of iLogic code ------------------- &lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 24 Feb 2012 16:24:29 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/save-pdf-using-ilogic-and-name-after-revision-number/m-p/3346385#M140002</guid>
      <dc:creator>Curtis_W</dc:creator>
      <dc:date>2012-02-24T16:24:29Z</dc:date>
    </item>
    <item>
      <title>Re: Save PDF using iLogic and name after revision number?</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/save-pdf-using-ilogic-and-name-after-revision-number/m-p/3346513#M140003</link>
      <description>&lt;P&gt;Hi DVDM,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is a rule that will write out each sheet to a PDF following the naming scheme you mentioned. But I wasn't able to find the hook to use the Sheet Revision property. Maybe someone will have a look and point us to it. In the mean time this should get you started.&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 target="_blank" href="http://inventortrenches.blogspot.com"&gt;http://inventortrenches.blogspot.com&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;'------start of iLogic-------
oPath = ThisDoc.Path
oFileName = ThisDoc.FileName(False) 'without extension
oPDFAddIn = ThisApplication.ApplicationAddIns.ItemById _
("{0AC6FD96-2F4D-42CE-8BE0-8AEA580399E4}")
oDocument = ThisApplication.ActiveDocument
oContext = ThisApplication.TransientObjects.CreateTranslationContext
oContext.Type = IOMechanismEnum.kFileBrowseIOMechanism
oOptions = ThisApplication.TransientObjects.CreateNameValueMap
oDataMedium = ThisApplication.TransientObjects.CreateDataMedium

'Define the drawing 
Dim oDrawing As DrawingDocument
oDrawing = ThisDrawing.Document
'Count the sheets
Dim intNumSheets As Integer
intNumSheets = oDrawing.Sheets.Count
Dim intIndex As Integer
For intIndex = 1 To intNumSheets
&lt;BR /&gt;If oPDFAddIn.HasSaveCopyAsOptions(oDataMedium, oContext, oOptions) Then
oOptions.Value("All_Color_AS_Black") = 1
oOptions.Value("Remove_Line_Weights") = 1
oOptions.Value("Vector_Resolution") = 400
oOptions.Value("Sheet_Range") = Inventor.PrintRangeEnum.kPrintSheetRange
oOptions.Value("Custom_Begin_Sheet") = intIndex
oOptions.Value("Custom_End_Sheet") = intIndex
End If

'get PDF target folder path
oFolder = Left(oPath, InStrRev(oPath, "\")) &amp;amp; "PDF"

'Check for the PDF folder and create it if it does not exist
If Not System.IO.Directory.Exists(oFolder) Then
    System.IO.Directory.CreateDirectory(oFolder)
End If

 'Set the PDF target file name
oDataMedium.FileName = oFolder &amp;amp; "\" &amp;amp; oFileName &amp;amp; "-0" &amp;amp; intIndex &amp;amp; ".pdf"

'Publish document
oPDFAddIn.SaveCopyAs(oDocument, oContext, oOptions, oDataMedium)

Next

'------end of iLogic-------&lt;/PRE&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;</description>
      <pubDate>Fri, 24 Feb 2012 17:14:21 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/save-pdf-using-ilogic-and-name-after-revision-number/m-p/3346513#M140003</guid>
      <dc:creator>Curtis_W</dc:creator>
      <dc:date>2012-02-24T17:14:21Z</dc:date>
    </item>
    <item>
      <title>Re: Save PDF using iLogic and name after revision number?</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/save-pdf-using-ilogic-and-name-after-revision-number/m-p/3347797#M140004</link>
      <description>&lt;P&gt;Hi Curtis,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for those, very much appreciated!&lt;/P&gt;&lt;P&gt;I've tested both, and both work pretty well, but would like to do a bit of finetuning, and ask you a few more questions.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The save to dwg rule doesn't seem to save to Acad 2004 format, but to 2010 format (which is the default setting for the exporter), so it ignores the Options.Value setting from your rule. I checked by looking at the file header which is AC1024, which should be AC1018 for Acad 2004 format.&lt;/P&gt;&lt;P&gt;Your rule packs the drawings into a zip file, but by default this 'pack and go' option is unticked. So the questions is, how are these options controlled? Does the C:\temp\DWGout.ini file play a role in this? I don't actually know what this file currently does, or how to store configuration settings in it if possible.&lt;/P&gt;&lt;P&gt;The one other niggle is that during the export the filename gets the addition of a _ in the filename (i.e. ABC-123_-01.DWG), but as it's done by the built in exporter and not the rule that invokes it this might not be possible to change?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Your export to pdf works very well, but would like to finetune the naming convention. For example:&lt;/P&gt;&lt;P&gt;ABC-123.dwg contains:&lt;/P&gt;&lt;P&gt;ABC-123-01, ABC-123-02, ......, up to ABC-123-99&lt;/P&gt;&lt;P&gt;This currently saves out to ABC-123-01, ABC-123-02,......, ABC-123-099. You add the "-0" to the filename, but after 10 sheets the "-0" should no longer apply.&lt;/P&gt;&lt;P&gt;But this is only when we have a fully sequential set of sheets without any gaps.&lt;/P&gt;&lt;P&gt;Say we have a 3 sheet drawing like this:&lt;/P&gt;&lt;P&gt;ABC-123-05, ABC-123-10, ABC-123-34&lt;/P&gt;&lt;P&gt;This currently saves out to ABC-123-01, ABC-123-02, ABC-123-03.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This could be solved two different ways. The way the "Export to dwg" tool does it would work quite well, by using the sheet name. We name our sheets like this: -05, -10, -34, so in the model tree for the drawing you see: -05:1, -10:2, -34:3. If this value could be used to append the filename that would be the most straightforward fix.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The drawing number also matches the part number of the component detailed. The title block picks up the &amp;lt;Part Number&amp;gt; value of the model, so this one drawing file with 3 sheets would be detailing ABC-123-05.iam, ABC-123-10.ipt &amp;amp; ABC-123-34.ipt.&lt;/P&gt;&lt;P&gt;Since a sheet can contain many base views to different parts and assemblies you wouldn't be able to establish which one to use, unless it would be able to pick it based on the first view placed, similar to how the title block knows to pick to &amp;lt;Part Number&amp;gt; from the first view.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've only just started learning how to use iLogic last week, so wouldn't be able to write anything this complex with VB in it. Reading through the code I'm able to get an idea what's going on, and can imagine being able to do something like that once I know VB myself. One thing that puzzles me though is the&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;ItemById _
("{0AC6FD96-2F4D-42CE-8BE0-8AEA580399E4}")&lt;/PRE&gt;&lt;P&gt;code. Where are you supposed to find something like that?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Appreciate your help!&lt;/P&gt;</description>
      <pubDate>Mon, 27 Feb 2012 01:31:21 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/save-pdf-using-ilogic-and-name-after-revision-number/m-p/3347797#M140004</guid>
      <dc:creator>DVDM</dc:creator>
      <dc:date>2012-02-27T01:31:21Z</dc:date>
    </item>
    <item>
      <title>Re: Save PDF using iLogic and name after revision number?</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/save-pdf-using-ilogic-and-name-after-revision-number/m-p/3347835#M140005</link>
      <description>&lt;P&gt;I figured out how to get that ini file to work:&lt;/P&gt;&lt;P&gt;&lt;A target="_blank" href="http://forums.autodesk.com/t5/Autodesk-Inventor-Customization/Export-sheet-to-DWG/td-p/3341737"&gt;http://forums.autodesk.com/t5/Autodesk-Inventor-Customization/Export-sheet-to-DWG/td-p/3341737&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So I'd be able to set up different ini files, that are called upon by different iLogic rules, that'll be pretty handy.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 27 Feb 2012 03:51:21 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/save-pdf-using-ilogic-and-name-after-revision-number/m-p/3347835#M140005</guid>
      <dc:creator>DVDM</dc:creator>
      <dc:date>2012-02-27T03:51:21Z</dc:date>
    </item>
    <item>
      <title>Re: Save PDF using iLogic and name after revision number?</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/save-pdf-using-ilogic-and-name-after-revision-number/m-p/3348839#M140006</link>
      <description>&lt;P&gt;Hi DVDM,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Let's focus on just the PDF part of this for now and come back to the DWG export. If I understand correctly, this rule should output the PDF's per sheet as such:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;A drawing has 3 sheets:&lt;/P&gt;&lt;P&gt;&lt;EM&gt;ABC-123-05:1 &lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;ABC-123-10:2&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;ABC-123-34:3&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;the rule writes out 3 PDF's:&lt;/P&gt;&lt;P&gt;&lt;EM&gt;ABC-123-05.pdf&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;ABC-123-10.pdf&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;ABC-123-34.pdf&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;and places them in a folder named PDF that resides next to the drawing file:&lt;/P&gt;&lt;P&gt;C:\Temp\&lt;EM&gt;ABC-123-05.dwg&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;C:\Temp\&lt;EM&gt;PDF\&lt;EM&gt;ABC-123-05.pdf&lt;/EM&gt;&lt;/EM&gt;&lt;BR /&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;C:\Temp\&lt;EM&gt;PDF\&lt;EM&gt;ABC-123-10.pdf&lt;/EM&gt;&lt;/EM&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;C:\Temp\&lt;EM&gt;PDF\&lt;EM&gt;ABC-123-34.pdf&lt;/EM&gt;&lt;/EM&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Let me know if this is what you're after.&lt;EM&gt;&lt;EM&gt;&lt;EM&gt;&lt;BR /&gt;&lt;/EM&gt;&lt;/EM&gt;&lt;/EM&gt;&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 target="_blank" href="http://inventortrenches.blogspot.com"&gt;http://inventortrenches.blogspot.com&lt;/A&gt;&lt;EM&gt;&lt;EM&gt;&lt;EM&gt;&lt;BR /&gt;&lt;/EM&gt;&lt;/EM&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;'------start of iLogic-------
oPath = ThisDoc.Path
oFileName = ThisDoc.FileName(False) 'without extension
oPDFAddIn = ThisApplication.ApplicationAddIns.ItemById _
("{0AC6FD96-2F4D-42CE-8BE0-8AEA580399E4}")
oDocument = ThisApplication.ActiveDocument
oContext = ThisApplication.TransientObjects.CreateTranslationContext
oContext.Type = IOMechanismEnum.kFileBrowseIOMechanism
oOptions = ThisApplication.TransientObjects.CreateNameValueMap
oDataMedium = ThisApplication.TransientObjects.CreateDataMedium

'Define the drawing 
Dim oDrawing As DrawingDocument
oDrawing = ThisDoc.Document

Dim oSheet As Sheet
Dim lPos As Long
Dim rPos As Long
Dim sLen As Long
Dim sSheetName As String
Dim sSheetNumber As String 

'step through each drawing sheet&lt;BR /&gt;For Each oSheet In oDrawing.Sheets

'find the seperator in the sheet name:number
lPos = InStr(oSheet.Name, ":")
'find the number of characters in the sheet name
sLen = Len(oSheet.Name)
'find the sheet name
sSheetName = Left(oSheet.Name, lPos -1)
'find the sheet number
sSheetNumber = Right(oSheet.Name, sLen -lPos )

'set PDF Options
If oPDFAddIn.HasSaveCopyAsOptions(oDataMedium, oContext, oOptions) Then
oOptions.Value("All_Color_AS_Black") = 1
oOptions.Value("Remove_Line_Weights") = 1
oOptions.Value("Vector_Resolution") = 400
oOptions.Value("Sheet_Range") = Inventor.PrintRangeEnum.kPrintSheetRange
oOptions.Value("Custom_Begin_Sheet") = sSheetNumber 
oOptions.Value("Custom_End_Sheet") = sSheetNumber 
End If

'get PDF target folder path
oFolder = Left(oPath, InStrRev(oPath, "\")) &amp;amp; "PDF"

'Check for the PDF folder and create it if it does not exist
If Not System.IO.Directory.Exists(oFolder) Then
    System.IO.Directory.CreateDirectory(oFolder)
End If

'Set the PDF target file name
oDataMedium.FileName = oFolder &amp;amp; "\" &amp;amp; sSheetName &amp;amp; ".pdf"

'Publish document
oPDFAddIn.SaveCopyAs(oDocument, oContext, oOptions, oDataMedium)

Next
'------end of iLogic-------&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 27 Feb 2012 18:45:01 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/save-pdf-using-ilogic-and-name-after-revision-number/m-p/3348839#M140006</guid>
      <dc:creator>Curtis_W</dc:creator>
      <dc:date>2012-02-27T18:45:01Z</dc:date>
    </item>
    <item>
      <title>Re: Save PDF using iLogic and name after revision number?</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/save-pdf-using-ilogic-and-name-after-revision-number/m-p/3349433#M140007</link>
      <description>&lt;P&gt;Hi Curtis,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Fantastic, thanks for that!&lt;/P&gt;&lt;P&gt;It didn't work straight up, but all the clues were there for me to edit the code to get it to work the way it should, and give me the satisfaction of having achieved something myself, however small it may have been &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Basically, what I have is this:&lt;/P&gt;&lt;P&gt;ABC-123.dwg&lt;/P&gt;&lt;P&gt;Containing sheets:&lt;/P&gt;&lt;P&gt;-05:1&lt;/P&gt;&lt;P&gt;-10:2&lt;/P&gt;&lt;P&gt;-34:3&lt;/P&gt;&lt;P&gt;And want as a result:&lt;/P&gt;&lt;P&gt;ABC-123-05.pdf&lt;/P&gt;&lt;P&gt;ABC-123-10.pdf&lt;/P&gt;&lt;P&gt;ABC-123-34.pdf&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;First I changed the code for the PDF target file as per below:&lt;/P&gt;&lt;PRE&gt;&lt;SPAN&gt;'&lt;/SPAN&gt;&lt;SPAN&gt;Set the PDF target file name&lt;/SPAN&gt;&lt;SPAN&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN&gt;oDataMedium&lt;/SPAN&gt;.&lt;SPAN&gt;FileName&lt;/SPAN&gt; &lt;SPAN&gt;=&lt;/SPAN&gt; &lt;SPAN&gt;oFolder&lt;/SPAN&gt; &lt;SPAN&gt;&amp;amp;&lt;/SPAN&gt; &lt;SPAN&gt;"&lt;/SPAN&gt;&lt;SPAN&gt;\&lt;/SPAN&gt;&lt;SPAN&gt;"&lt;/SPAN&gt; &lt;SPAN&gt;&amp;amp;&lt;/SPAN&gt; &lt;SPAN&gt;oFileName&lt;/SPAN&gt; &lt;SPAN&gt;&amp;amp;&lt;/SPAN&gt; &lt;SPAN&gt;sSheetName&lt;/SPAN&gt; &lt;SPAN&gt;&amp;amp;&lt;/SPAN&gt; &lt;SPAN&gt;"&lt;/SPAN&gt;&lt;SPAN&gt;.pdf&lt;/SPAN&gt;&lt;SPAN&gt;"&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Now all the filenames were written correctly, but for some reason, all files were a print of the first sheet.&lt;/P&gt;&lt;P&gt;It took me some digging around to figure that one out. In the code I added a message box to return what the value for sSheetNumber was, and the correct values appeared. Yet I changed the code to just print sheet 3, it printed sheet 3, so why not when sSheetNumber had value 3? I realized it was because sSheetNumber was declared as String. I changed it to Integer, and it worked perfect this time around.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So the end result was this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt; '------start of iLogic-------&lt;BR /&gt;oPath = ThisDoc.Path&lt;BR /&gt;oFileName = ThisDoc.FileName(False) 'without extension&lt;BR /&gt;oPDFAddIn = ThisApplication.ApplicationAddIns.ItemById _&lt;BR /&gt;("{0AC6FD96-2F4D-42CE-8BE0-8AEA580399E4}")&lt;BR /&gt;oDocument = ThisApplication.ActiveDocument&lt;BR /&gt;oContext = ThisApplication.TransientObjects.CreateTranslationContext&lt;BR /&gt;oContext.Type = IOMechanismEnum.kFileBrowseIOMechanism&lt;BR /&gt;oOptions = ThisApplication.TransientObjects.CreateNameValueMap&lt;BR /&gt;oDataMedium = ThisApplication.TransientObjects.CreateDataMedium&lt;BR /&gt;&lt;BR /&gt;'Define the drawing &lt;BR /&gt;Dim oDrawing As DrawingDocument&lt;BR /&gt;oDrawing = ThisDoc.Document&lt;BR /&gt;&lt;BR /&gt;Dim oSheet As Sheet&lt;BR /&gt;Dim lPos As Long&lt;BR /&gt;Dim rPos As Long&lt;BR /&gt;Dim sLen As Long&lt;BR /&gt;Dim sSheetName As String&lt;BR /&gt;Dim sSheetNumber As Integer&lt;BR /&gt;&lt;BR /&gt;'step through each drawing sheet&lt;BR /&gt;For Each oSheet In oDrawing.Sheets&lt;BR /&gt;&lt;BR /&gt;'find the seperator in the sheet name:number&lt;BR /&gt;lPos = InStr(oSheet.Name, ":")&lt;BR /&gt;'find the number of characters in the sheet name&lt;BR /&gt;sLen = Len(oSheet.Name)&lt;BR /&gt;'find the sheet name&lt;BR /&gt;sSheetName = Left(oSheet.Name, lPos -1)&lt;BR /&gt;'find the sheet number&lt;BR /&gt;sSheetNumber = Right(oSheet.Name, sLen -lPos)&lt;BR /&gt;&lt;BR /&gt;'set PDF Options&lt;BR /&gt;If oPDFAddIn.HasSaveCopyAsOptions(oDataMedium, oContext, oOptions) Then&lt;BR /&gt;oOptions.Value("All_Color_AS_Black") = 1&lt;BR /&gt;oOptions.Value("Remove_Line_Weights") = 1&lt;BR /&gt;oOptions.Value("Vector_Resolution") = 400&lt;BR /&gt;oOptions.Value("Sheet_Range") = Inventor.PrintRangeEnum.kPrintSheetRange&lt;BR /&gt;oOptions.Value("Custom_Begin_Sheet") = sSheetNumber&lt;BR /&gt;oOptions.Value("Custom_End_Sheet") = sSheetNumber&lt;BR /&gt;End If&lt;BR /&gt;&lt;BR /&gt;'get PDF target folder path&lt;BR /&gt;oFolder = Left(oPath, InStrRev(oPath, "\")) &amp;amp; "PDF"&lt;BR /&gt;&lt;BR /&gt;'Check for the PDF folder and create it if it does not exist&lt;BR /&gt;If Not System.IO.Directory.Exists(oFolder) Then&lt;BR /&gt;    System.IO.Directory.CreateDirectory(oFolder)&lt;BR /&gt;End If&lt;BR /&gt;&lt;BR /&gt;'Set the PDF target file name&lt;BR /&gt;oDataMedium.FileName = oFolder &amp;amp; "\" &amp;amp; oFileName &amp;amp; sSheetName &amp;amp; ".pdf"&lt;BR /&gt;&lt;BR /&gt;'Publish document&lt;BR /&gt;oPDFAddIn.SaveCopyAs(oDocument, oContext, oOptions, oDataMedium)&lt;BR /&gt;&lt;BR /&gt;Next&lt;BR /&gt;'------end of iLogic-------&lt;/PRE&gt;&lt;P&gt;Really appreciate your time in this, and trying to pick your code apart was a great learning curve.&lt;/P&gt;&lt;P&gt;I am still interested in how it would be possible to manipulate the filename for the dwg export.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 28 Feb 2012 02:11:24 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/save-pdf-using-ilogic-and-name-after-revision-number/m-p/3349433#M140007</guid>
      <dc:creator>DVDM</dc:creator>
      <dc:date>2012-02-28T02:11:24Z</dc:date>
    </item>
    <item>
      <title>Re: Save PDF using iLogic and name after revision number?</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/save-pdf-using-ilogic-and-name-after-revision-number/m-p/3350933#M140008</link>
      <description>&lt;P&gt;Hi DVDM,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Congrats to you for catching my mistake and making this work for your needs, and sorry for the confusion concerning the string/integer variable. You're spot on, I checked what I was outputting and had the same result that you reported. I just hadn't opned the PDFs to look closely and notice ( I was just watching the file names in the output folder).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So, now on to the DWG rule. Do you want this to work just as your last PDF rule works, then?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You I have:&lt;/P&gt;&lt;P&gt;ABC-123.dwg&lt;/P&gt;&lt;P&gt;Containing sheets:&lt;/P&gt;&lt;P&gt;-05:1&lt;/P&gt;&lt;P&gt;-10:2&lt;/P&gt;&lt;P&gt;-34:3&lt;/P&gt;&lt;P&gt;And want as a result:&lt;/P&gt;&lt;P&gt;ABC-123-05.dwg (ACAD 2004 format)&lt;/P&gt;&lt;P&gt;ABC-123-10.dwg (ACAD 2004 format)&lt;/P&gt;&lt;P&gt;ABC-123-34.dwg (ACAD 2004 format)&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 target="_blank" href="http://inventortrenches.blogspot.com"&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;</description>
      <pubDate>Tue, 28 Feb 2012 21:33:42 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/save-pdf-using-ilogic-and-name-after-revision-number/m-p/3350933#M140008</guid>
      <dc:creator>Curtis_W</dc:creator>
      <dc:date>2012-02-28T21:33:42Z</dc:date>
    </item>
    <item>
      <title>Re: Save PDF using iLogic and name after revision number?</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/save-pdf-using-ilogic-and-name-after-revision-number/m-p/3351067#M140009</link>
      <description>&lt;P&gt;Hi Curtis,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;That's the goal, to have it output two file types with identical filenames, so I can have one rule that runs the two external rules for PDF and DWG&lt;/P&gt;&lt;P&gt;What I have currently is close, so as output I'll get:&lt;/P&gt;&lt;P&gt;ABC-123_-05.dwg&lt;/P&gt;&lt;P&gt;ABC-123_-10.dwg&lt;/P&gt;&lt;P&gt;ABC-123_-34.dwg&lt;/P&gt;&lt;P&gt;ABC-123-05.pdf&lt;/P&gt;&lt;P&gt;ABC-123-10.pdf&lt;/P&gt;&lt;P&gt;ABC-123-34.pdf&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But from what I can tell the '_' is just an automatic addition by the DWG export function, and probably needs more in depth knowledge to change this.&lt;/P&gt;&lt;P&gt;If it's possible at all, because if the Sheet revision is a hidden or non-accessible property, who knows what else is.&lt;/P&gt;</description>
      <pubDate>Tue, 28 Feb 2012 23:26:42 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/save-pdf-using-ilogic-and-name-after-revision-number/m-p/3351067#M140009</guid>
      <dc:creator>DVDM</dc:creator>
      <dc:date>2012-02-28T23:26:42Z</dc:date>
    </item>
    <item>
      <title>Re: Save PDF using iLogic and name after revision number?</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/save-pdf-using-ilogic-and-name-after-revision-number/m-p/3353471#M140010</link>
      <description>&lt;P&gt;Can somebody change the ilogic to save the PDF in the same folder as the DWG/IDW?&lt;/P&gt;</description>
      <pubDate>Thu, 01 Mar 2012 12:01:02 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/save-pdf-using-ilogic-and-name-after-revision-number/m-p/3353471#M140010</guid>
      <dc:creator>james.nahani</dc:creator>
      <dc:date>2012-03-01T12:01:02Z</dc:date>
    </item>
    <item>
      <title>Re: Save PDF using iLogic and name after revision number?</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/save-pdf-using-ilogic-and-name-after-revision-number/m-p/3353857#M140011</link>
      <description>&lt;P&gt;Hi james.rammos,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here are a couple of rules that will do this.&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 target="_blank" href="http://inventortrenches.blogspot.com"&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;You can use this rule to save each sheet individually into the same folder that the DWG/IDW resides in:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt; '------start of iLogic-------
oPath = ThisDoc.Path
oFileName = ThisDoc.FileName(False) 'without extension
oPDFAddIn = ThisApplication.ApplicationAddIns.ItemById _
("{0AC6FD96-2F4D-42CE-8BE0-8AEA580399E4}")
oDocument = ThisApplication.ActiveDocument
oContext = ThisApplication.TransientObjects.CreateTranslationContext
oContext.Type = IOMechanismEnum.kFileBrowseIOMechanism
oOptions = ThisApplication.TransientObjects.CreateNameValueMap
oDataMedium = ThisApplication.TransientObjects.CreateDataMedium

'Define the drawing 
Dim oDrawing As DrawingDocument
oDrawing = ThisDoc.Document

Dim oSheet As Sheet
Dim lPos As Long
Dim rPos As Long
Dim sLen As Long
Dim sSheetName As String
Dim iSheetNumber As Integer

'step through each drawing sheet
For Each oSheet In oDrawing.Sheets

'find the seperator in the sheet name:number
lPos = InStr(oSheet.Name, ":")
'find the number of characters in the sheet name
sLen = Len(oSheet.Name)
'find the sheet name
sSheetName = Left(oSheet.Name, lPos -1)
'find the sheet number
sSheetNumber = Right(oSheet.Name, sLen -lPos)

'set PDF Options
If oPDFAddIn.HasSaveCopyAsOptions(oDataMedium, oContext, oOptions) Then
oOptions.Value("All_Color_AS_Black") = 1
oOptions.Value("Remove_Line_Weights") = 1
oOptions.Value("Vector_Resolution") = 400
oOptions.Value("Sheet_Range") = Inventor.PrintRangeEnum.kPrintSheetRange
oOptions.Value("Custom_Begin_Sheet") = sSheetNumber
oOptions.Value("Custom_End_Sheet") = sSheetNumber
End If

'Set the PDF target file name
oDataMedium.FileName = oPath &amp;amp; "\" &amp;amp; oFileName &amp;amp; "_" &amp;amp; sSheetName &amp;amp; sSheetNumber &amp;amp; ".pdf"

'Publish document
oPDFAddIn.SaveCopyAs(oDocument, oContext, oOptions, oDataMedium)

Next
'------end of iLogic-------&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And you can use this rule to save each sheet as a single PDF into the same folder that the DWG/IDW resides in:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt; '------start of iLogic-------
oPath = ThisDoc.Path
oFileName = ThisDoc.FileName(False) 'without extension
oPDFAddIn = ThisApplication.ApplicationAddIns.ItemById _
("{0AC6FD96-2F4D-42CE-8BE0-8AEA580399E4}")
oDocument = ThisApplication.ActiveDocument
oContext = ThisApplication.TransientObjects.CreateTranslationContext
oContext.Type = IOMechanismEnum.kFileBrowseIOMechanism
oOptions = ThisApplication.TransientObjects.CreateNameValueMap
oDataMedium = ThisApplication.TransientObjects.CreateDataMedium

'Define the drawing 
Dim oDrawing As DrawingDocument
oDrawing = ThisDoc.Document

'set PDF Options
If oPDFAddIn.HasSaveCopyAsOptions(oDataMedium, oContext, oOptions) Then
oOptions.Value("All_Color_AS_Black") = 1
oOptions.Value("Remove_Line_Weights") = 1
oOptions.Value("Vector_Resolution") = 400
oOptions.Value("Sheet_Range") = Inventor.PrintRangeEnum.kPrintAllSheets
End If

'Set the PDF target file name
oDataMedium.FileName = oPath &amp;amp; "\" &amp;amp; oFileName &amp;amp;  ".pdf"

'Publish document
oPDFAddIn.SaveCopyAs(oDocument, oContext, oOptions, oDataMedium)

'------end of iLogic-------&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 01 Mar 2012 15:23:10 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/save-pdf-using-ilogic-and-name-after-revision-number/m-p/3353857#M140011</guid>
      <dc:creator>Curtis_W</dc:creator>
      <dc:date>2012-03-01T15:23:10Z</dc:date>
    </item>
    <item>
      <title>Re: Save PDF using iLogic and name after revision number?</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/save-pdf-using-ilogic-and-name-after-revision-number/m-p/3354351#M140012</link>
      <description>&lt;P&gt;Thank you Curtis,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I will try it as soon as i get back to the office.&lt;/P&gt;</description>
      <pubDate>Thu, 01 Mar 2012 19:21:27 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/save-pdf-using-ilogic-and-name-after-revision-number/m-p/3354351#M140012</guid>
      <dc:creator>james.nahani</dc:creator>
      <dc:date>2012-03-01T19:21:27Z</dc:date>
    </item>
    <item>
      <title>Re: Save PDF using iLogic and name after revision number?</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/save-pdf-using-ilogic-and-name-after-revision-number/m-p/3794664#M140013</link>
      <description>&lt;P&gt;Old thread, but I hope I will get a sponse since I`ve been doing the same.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I took your code Curtis and added the revision number into the filename.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But I'm wondering, is it possible to decide where in the filename the rev number shall appear?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Example: 12345-100 Rev 02 - Module 1 - Details&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The .idw would in that case be named 12345-100 - Module 1 - Details&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;'------- start of iLogic code ------------------- 
' Get the DWG translator Add-In. 
Dim DWGAddIn As TranslatorAddIn 
DWGAddIn = ThisApplication.ApplicationAddIns.ItemById _
("{C24E3AC4-122E-11D5-8E91-0010B541CD80}") 

'Set a reference to the active document 
Dim oDocument As Document 
oDocument = ThisApplication.ActiveDocument 
Dim oContext As TranslationContext 
oContext = ThisApplication.TransientObjects.CreateTranslationContext 
oContext.Type = IOMechanismEnum.kFileBrowseIOMechanism 
' Create a NameValueMap object 
Dim oOptions As NameValueMap 
oOptions = ThisApplication.TransientObjects.CreateNameValueMap 
oRevNum = iProperties.Value("Project", "Revision Number")
oFileName = ThisDoc.FileName(False) 'without extension

' Create a DataMedium object 
Dim oDataMedium As DataMedium 
oDataMedium = ThisApplication.TransientObjects.CreateDataMedium

' Check whether the translator has 'SaveCopyAs' options 
If DWGAddIn.HasSaveCopyAsOptions(oDocument, oContext, oOptions) Then 
    ' DWG version.
    ' 23 = ACAD 2000
    ' 25 = ACAD 2004
    ' 27 = ACAD 2007
    ' 29 = ACAD 2010 
    oOptions.Value("DwgVersion") = 29
Dim strIniFile As String 
strIniFile = "C:\temp\DWGout.ini" 
' Create the name-value that specifies the ini file to use. 
oOptions.Value("Export_Acad_IniFile") = strIniFile 
End If 

oFolder = ThisDoc.Path

'Set the DWG target file name
oDataMedium.FileName = oFolder &amp;amp; "\" &amp;amp; oFileName &amp;amp; _
" Rev " &amp;amp; oRevNum &amp;amp; ".dwg"
DWGAddIn.SaveCopyAs(oDocument, oContext, oOptions, oDataMedium) 
'------- end of iLogic code ------------------- &lt;/PRE&gt;&lt;P&gt;lection: 314&lt;/P&gt;</description>
      <pubDate>Sun, 03 Mar 2013 10:40:24 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/save-pdf-using-ilogic-and-name-after-revision-number/m-p/3794664#M140013</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2013-03-03T10:40:24Z</dc:date>
    </item>
    <item>
      <title>Re: Save PDF using iLogic and name after revision number?</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/save-pdf-using-ilogic-and-name-after-revision-number/m-p/3799955#M140014</link>
      <description>&lt;P&gt;Not sure if you got an answer to this or not but you will have insert the rev into the file name string. You will need the location in the string. You can get the location by finding it based on a character or you can specified the exact location. Both example are show below. Then use the insert method to place in the "Rev" and the oRevNum. Have this before you save the file. hope that helps.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;'find the location based on the first space in the string&lt;BR /&gt;'Dim intIndex As Integer = oFileName.IndexOf(" ")&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;'use a specified location&lt;BR /&gt;Dim intIndex As Integer = 9&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;oFileName = oFileName.Insert(intIndex, " Rev " &amp;amp; oRevNum)&lt;/P&gt;</description>
      <pubDate>Fri, 08 Mar 2013 16:09:01 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/save-pdf-using-ilogic-and-name-after-revision-number/m-p/3799955#M140014</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2013-03-08T16:09:01Z</dc:date>
    </item>
    <item>
      <title>Re: Save PDF using iLogic and name after revision number?</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/save-pdf-using-ilogic-and-name-after-revision-number/m-p/3805631#M140015</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tryed to put in the rule for DWG export and i keep getting error message. (see picture below)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Anybody knows how to fix this?&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;</description>
      <pubDate>Fri, 15 Mar 2013 09:42:56 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/save-pdf-using-ilogic-and-name-after-revision-number/m-p/3805631#M140015</guid>
      <dc:creator>james.nahani</dc:creator>
      <dc:date>2013-03-15T09:42:56Z</dc:date>
    </item>
    <item>
      <title>Re: Save PDF using iLogic and name after revision number?</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/save-pdf-using-ilogic-and-name-after-revision-number/m-p/3805995#M140016</link>
      <description>&lt;P&gt;post up the code you have. The code from Curtis should work.&lt;/P&gt;</description>
      <pubDate>Fri, 15 Mar 2013 15:56:07 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/save-pdf-using-ilogic-and-name-after-revision-number/m-p/3805995#M140016</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2013-03-15T15:56:07Z</dc:date>
    </item>
  </channel>
</rss>

