I don't think the problem is C#. In the help files, there is a C# example on how to export 3D pdf files.
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 2019\Templates\Sample Part Template.pdf";
oOptions.Value["VisualizationQuality"] = AccuracyEnum.kHigh;
//string[] sProps = new string[1];
//sProps[0] = "{F29F85E0-4FF9-1068-AB91-08002B27B3D9}:Title";
//oOptions.Value["ExportAllProperties"] = false;
//oOptions.Value["ExportProperties"] = sProps;
String[] sDesignViews = new string[] { "Master", "View1" };
oOptions.Value["ExportDesignViewRepresentations"] = sDesignViews;
pdfConvertor3d.Publish(oDoc, oOptions);
}
In your code, I see some other options. Maybe one of those is the problem. Can you try to use only the options that are also in the help file?
Jelte de Jong
Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.

Blog: hjalte.nl - github.com