Message 1 of 6
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
We have recently upgraded from Inventor 2017 to 2019. We skipped the 2018 upgrade. In doing so, our rule to export our drawings to PDF's no longer work and result in the following error:
Error in rule: GENERATE PDF - ALL SHEETS, in document: TAPESTRY CS NC_BOM.idw
Invalid pointer (Exception from HRESULT: 0x80004003 (E_POINTER))
Any help would be greatly appreciated! Code listed below. You will have to change the local directory for export...
'Save PDF with options
path_and_namePDF = ThisDoc.PathAndFileName(False)
oPDFAddIn = ThisApplication.ApplicationAddIns.ItemById("{0AC6FD96-2F4D-42CE-8BE0-8AEA580399E4}")
oOrderName = iProperties.Value("Custom", "ORDER NAME")
oOrderNumber = iProperties.Value("Custom", "ORDER NUMBER")
oDocument = ThisApplication.ActiveDocument
oContext = ThisApplication.TransientObjects.CreateTranslationContext
oContext.Type = IOMechanismEnum.kFileBrowseIOMechanism
oOptions = ThisApplication.TransientObjects.CreateNameValueMap
oDataMedium = ThisApplication.TransientObjects.CreateDataMedium
' Define folder browse dialog
Dim Dialog = New FolderBrowserDialog()
Dialog.SelectedPath = "T:\ENG 3D\JOBS"
Dialog.ShowNewFolderButton = True
Dialog.Description = "Choose Folder for Export..."
If DialogResult.OK = Dialog.ShowDialog() Then
ExportPath = Dialog.SelectedPath & "\"
Else
Exit Sub
End If
If Not oPDFAddIn.HasSaveCopyAsOptions(oDataMedium, oContext, oOptions) Then Exit Sub
oOptions.Value("All_Color_AS_Black") = 0
oOptions.Value("Remove_Line_Weights") = 1
oOptions.Value("Vector_Resolution") = 4800
oOptions.Value("Sheet_Range") = Inventor.PrintRangeEnum.kPrintAllSheets
oOptions.Value("Custom_Begin_Sheet") = 1
oOptions.Value("Custom_End_Sheet") = 100
If iProperties.Value("Project", "Revision Number") >= "1" Then
ExportPath = ExportPath & " R" & iProperties.Value("Project", "Revision Number")
End If
oDataMedium.FileName = ExportPath & oOrderName & " " & oOrderNumber & " BOM " & DateString & ".pdf"
Try
oPDFAddIn.SaveCopyAs(oDocument, oContext, oOptions, oDataMedium)
' Ask the user if he wants to open the file
question2 = MessageBox.Show("Open PDF file?", "Question",MessageBoxButtons.YesNo,MessageBoxIcon.Question)
If question2 = vbYes Then
ThisDoc.Launch(oDataMedium.FileName)
End If
Catch
MessageBox.Show("PDF not created, most likely someone else has it open.", "No PDF for you " & ThisApplication.GeneralOptions.UserName & "!")
End Try
Exit Sub
Thank you,
Brian
Solved! Go to Solution.

