Message 1 of 48
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello!
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:
Spoiler
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 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 'Set the destination file name oDataMedium.FileName = oPath & "\" & PN & ".pdf" 'Publish document PDFAddIn.SaveCopyAs(oDocument, oContext, oOptions,oDataMedium) 'Confirmation message MessageBox.Show("PDF SAVED TO: " & oDataMedium.FileName ,"PDF Saved", MessageBoxButtons.OK)
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?
Question 2: My DWG files is named "thing4.dwg" and it is the 2nd revision. I want the PDF-file to be named
"thing4 Ed2.pdf". Possible?
Any help would be very appreciated!
/Gustav
Solved! Go to Solution.