'Code Adapted from Inventor API samles with some twaeks by @ClintCadline 'Originally published On Cadline Community https://www.cadlinecommunity.co.uk/hc/en-us/articles/213505925 On Error Goto ClintsErrorTrapper: ' Get the 3D PDF Add-In. Dim oPDFAddIn As ApplicationAddIn Dim oAddin As ApplicationAddIn For Each oAddin In ThisApplication.ApplicationAddIns If oAddin.ClassIdString = "{3EE52B28-D6E0-4EA4-8AA6-C2A266DEBB88}" Then oPDFAddIn = oAddin Exit For End If Next If oPDFAddIn Is Nothing Then MsgBox ("Inventor 3D PDF Addin not loaded.") Exit Sub End If UserinputRequired = MessageBox.Show("You are about to publish a 3D PDF, this could take some time (depending on model complexity & accuracy level of the PDF)" & vbLf & vbLf & "Do you wish to Continue?" _ ,"Cadline - iLogic 3D PDF Export",MessageBoxButtons.YesNo,MessageBoxIcon.Information,MessageBoxDefaultButton.Button1) If UserinputRequired = vbNo Then Return Else Dim oPDFConvertor3D oPDFConvertor3D = oPDFAddIn.Automation 'a reference to the active document (the document to be published). Dim oDocument As Document oDocument = ThisApplication.ActiveDocument ' Create a NameValueMap object as Options Dim oOptions As NameValueMap oOptions = ThisApplication.TransientObjects.CreateNameValueMap ' Options oOptions.Value("FileOutputLocation") = ("c:\temp\"+ ThisDoc.FileName(False)+".pdf") oOptions.Value("ExportAnnotations") = 0 oOptions.Value("ExportWokFeatures") = 0 oOptions.Value("GenerateAndAttachSTEPFile") = False oOptions.Value("LimitToEntitiesInDVRs") = True oOptions.Value("ExportAllProperties") = True 'Accuracy - selection by Arraylist Dim MyArrayList As New ArrayList MyArrayList.add("Very High") MyArrayList.add("High") MyArrayList.add("Medium") MyArrayList.add("Low") ACCURACYinput = InputListBox("Select an Accuracy Level for the PDF -- If you do not select anything the default is set to *Low*", MyArrayList, d0, Title := "Set Accuracy", ListName := "List") If ACCURACYinput = "Very High" Then ACCURACYtoUSE = AccuracyEnum.kVeryHigh Else If ACCURACYinput ="High" Then ACCURACYtoUSE = AccuracyEnum.kHigh Else If ACCURACYinput ="Medium" Then ACCURACYtoUSE = AccuracyEnum.kMedium Else If ACCURACYinput ="Low" Then ACCURACYtoUSE = AccuracyEnum.kLow Else If ACCURACYinput ="" Then ACCURACYtoUSE = AccuracyEnum.kLow End If oOptions.Value("VisualizationQuality") = ACCURACYtoUSE ' the properties to export Dim sProps(0) As String sProps(0) = "{F29F85E0-4FF9-1068-AB91-08002B27B3D9}:Title" ' Title ' Export Current design view Dim sDesignViews(0) As String sDesignViews(0) = oDocument.ComponentDefinition.RepresentationsManager.ActiveDesignViewRepresentation.Name oOptions.Value("ExportDesignViewRepresentations") = sDesignViews ThisApplication.StatusBarText= "Exporting your 3D PDF --- This could take some time, depending on model size & complexity (as well as PDF accuracy), but it will be worth the wait --- We'll let you know when it's ready --- There is no progress bar" 'Publish document. Call oPDFConvertor3D.Publish(oDocument, oOptions) ThisApplication.StatusBarText= "Your 3D PDF is ready" i = MessageBox.Show("Preview the PDF?", "Cadline: iLogic - 3D PDF Publisher",MessageBoxButtons.YesNo) If i = vbYes Then : launchviewer = 1 : Else : launchviewer = 0 : End If If launchviewer = 1 Then ThisDoc.Launch("c:\temp\"+ ThisDoc.FileName(False)+".pdf") End If Return ClintsErrorTrapper: MessageBox.Show("There is a problem -- The PDF cannot be published -- Please ensure that you are in a Part or Assembly file -- Ensure that all parts (in Assemblies) are fully resolved, models with missing links cannot be used for publishing 3D PDF's","Cadline - iLogic 3D PDF Export")