The VB.NET add-in for 3D PDF generation works well and directly without issues. However, the C# API code throws an invalid arguments error at the Publish()
method. This is because the code uses late binding. This blog contains steps on how to resolve this error
Step 1:
As mentioned in this blog (here) set the Embed Interop Type to False under the Inventor Interop Assembly reference
Step 2:
Add the Microsoft.CSharp reference to your project then import the namespace in the code
Step 3:
Declare the PDF converter 3D ApplicationAddin Variable as dynamic as seen belowdynamic oPDFConvertor3D ;
oPDFConvertor3D = oPDFAddIn.Automation;
Step 4:
The Publish()
method takes two arguments, the first is of type Inventor document and the second is of Inventor NameValueMap type. Declare the variable of the type document as dynamic before parsing it to the method.
See the sample code below
dynamic oDocument;
oDocument = m_inventorApplication.ActiveDocument;
These steps should be able to resolve the error.
- Fidel