Message 1 of 3
Export part document to 3d pdf with API in c#
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
The error occurs at line 31 when attempting to export a part document to a 3D PDF using the API in C#.
public void Export3DPdf()
{
Inventor.Application InvApp = mApp;
Inventor.ApplicationAddIn PDFAddin = null ;
foreach (ApplicationAddIn appAddin in mApp.ApplicationAddIns )
{
if (appAddin.ClassIdString == "{3EE52B28-D6E0-4EA4-8AA6-C2A266DEBB88}")
{
PDFAddin = appAddin;
break;
}
}
dynamic pdfConvertor3d = PDFAddin.Automation;
Document oDoc = mApp.ActiveDocument;
// Create a NameValueMap object
Inventor.NameValueMap oOptions = InvApp.TransientObjects.CreateNameValueMap();
oOptions.Value["FileOutputLocation"] = @"c:\temp\3DPDF.pdf";
oOptions.Value["ExportAllProperties"] = true;
oOptions.Value["GenerateAndAttachSTEPFile"] = true ;
oOptions.Value["ExportTemplate"] = @"C:\Users\Public\Documents\Autodesk\Inventor 2025\Templates\Sample Part Template.pdf";
oOptions.Value["VisualizationQuality"] = AccuracyEnum.kHigh;
String[] sDesignViews = new string[] { "Front", "Top" };
oOptions.Value["ExportDesignViewRepresentations"] = sDesignViews;
pdfConvertor3d.Publish(oDoc, oOptions);
}