Message 1 of 4
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi folks,
I found this ilogic code this week and have it used it for a specific project. I was able to direct the PDF to save to a specific project folder for that purpose, but now I want to modify the code to save the PDF to whatever folder the model and drawing are saved to.
I added the "ThisDoc.Path" snippet in the 3rd line from the bottom to see if it would work, but it doesn't.
Any assistance would be appreciated ....
'' Get the PDF translator Add-In. Dim PDFAddIn As TranslatorAddIn PDFAddIn = ThisApplication.ApplicationAddIns.ItemById("{0AC6FD96-2F4D-42CE-8BE0-8AEA580399E4}") '' Set a reference to the active document (the document to be published). Dim oDocument As Document oDocument = ThisApplication.ActiveDocument Dim oContext As TranslationContext oContext = ThisApplication.TransientObjects.CreateTranslationContext oContext.Type = 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 PDFAddIn.HasSaveCopyAsOptions(oDocument, oContext, oOptions) Then ' ' Options for drawings... oOptions.Value("All_Color_AS_Black") = 0 oOptions.Value("Remove_Line_Weights") = 0 oOptions.Value("Vector_Resolution") = 600 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 = ThisDoc.Path & ThisDoc.FileName & ".pdf" '' Publish document. Call PDFAddIn.SaveCopyAs(oDocument, oContext, oOptions, oDataMedium)
---------------------------------------------------
It's not easy maintaining this level of insanity !!!!!
Solved! Go to Solution.