10-25-2017
01:42 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
10-25-2017
01:42 AM
Hi @AlanBrock9115,
Successfully PDF published and opened in Adode Acrobat DC with little changes in iLogic code.
Currently, I am using Inventor 2018.1.2
trigger = iTrigger0
Dim oDrawing As DrawingDocument
oDrawing = ThisApplication.ActiveDocument
Dim osheet As Sheet
'oPath = iProperties.Value("Summary", "Subject")
oFileName = ThisDoc.FileName(False) 'without extension
oRevNum = iProperties.Value("Project", "Revision Number")
oDescription = iProperties.Value("Project", "Description")
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
oMySheetCount = oDrawing.Sheets.Count
oOptions.Value("All_Color_AS_Black") = 0
oOptions.Value("Remove_Line_Weights") = 1
oOptions.Value("Vector_Resolution") = 400
oOptions.Value("Sheet_Range") = Inventor.PrintRangeEnum.kPrintAllSheets
oOptions.Value("Custom_Begin_Sheet") = iPageNumber
oOptions.Value("Custom_End_Sheet") = iPageNumber
oOptions.Value("Custom_Begin_Sheet") = 2
oOptions.Value("Custom_End_Sheet") = 4
'get PDF target folder path
'oFolder = Left(oPath, InStrRev(oPath, "\"))' & "2521-Arapuni Diversion Gate Upgrade"
'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 = "C:\Temp\Exacmple2.pdf"
On Error Goto handlePDFLock
'Publish document
oPDFAddIn.SaveCopyAs(oDocument, oContext, oOptions, oDataMedium)
'ThisApplication.CommandManager.ControlDefinitions.?Item("AppFilePrintCmd").Execute
Exit Sub
handlePDFLock: MessageBox.Show("PDF could not be saved, most likely someone has it open ", "No PDF for you " & ThisApplication.GeneralOptions.UserName & "!")
Resume Next
handleXLSLock: MessageBox.Show("No XLS", "iLogic")
Resume Next
Go through the following video for more details.
Please feel free to contact if there is any queries.
If solves problem, click on "Accept as solution" / give a "Kudo".
Thanks and regards,
CHANDRA SHEKAR G
Developer Advocate
Autodesk Developer Network
