<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Export part document to 3d pdf with API in c# in Inventor Programming Forum</title>
    <link>https://forums.autodesk.com/t5/inventor-programming-forum/export-part-document-to-3d-pdf-with-api-in-c/m-p/12757026#M11413</link>
    <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/14881060"&gt;@manasi_patilESZTV&lt;/a&gt;&amp;nbsp;please see this link&lt;BR /&gt;&lt;A href="https://adndevblog.typepad.com/manufacturing/2022/08/sorting-invalid-arguments-error-in-c-add-in-code-for-generating-3d-pdf-in-inventor.html" target="_blank"&gt;https://adndevblog.typepad.com/manufacturing/2022/08/sorting-invalid-arguments-error-in-c-add-in-code-for-generating-3d-pdf-in-inventor.html&lt;/A&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 07 May 2024 05:42:50 GMT</pubDate>
    <dc:creator>jmacapagal2CD9H</dc:creator>
    <dc:date>2024-05-07T05:42:50Z</dc:date>
    <item>
      <title>Export part document to 3d pdf with API in c#</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/export-part-document-to-3d-pdf-with-api-in-c/m-p/12701281#M11411</link>
      <description>&lt;P&gt;&lt;SPAN&gt;The error occurs at line 31 when attempting to export a part document to a 3D PDF using the API in C#.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;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);

        }&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 15 Apr 2024 06:47:52 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/export-part-document-to-3d-pdf-with-api-in-c/m-p/12701281#M11411</guid>
      <dc:creator>manasi_patilESZTV</dc:creator>
      <dc:date>2024-04-15T06:47:52Z</dc:date>
    </item>
    <item>
      <title>Re: Export part document to 3d pdf with API in c#</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/export-part-document-to-3d-pdf-with-api-in-c/m-p/12731605#M11412</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/14881060"&gt;@manasi_patilESZTV&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://help.autodesk.com/view/INVNTOR/2024/ENU/?guid=ExportToPDF3D_Sample" target="_blank" rel="noopener"&gt;https://help.autodesk.com/view/INVNTOR/2024/ENU/?guid=ExportToPDF3D_Sample&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I was able to get a 3D PDF working by changing/verifying a few things with the NameValueMap. I have Inventor 2024.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The export template file path was slightly different from the one given in the example documentation where the template 3D PDF is further housed in the "en-US" folder (at least on my machine):&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;//oOptions.Value["ExportTemplate"] = @"C:\Users\Public\Documents\Autodesk\Inventor 2024\Templates\Sample Part Template.pdf";
oOptions.Value["ExportTemplate"] = @"C:\Users\Public\Documents\Autodesk\Inventor 2024\Templates\en-US\Sample Part Template.pdf";&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I also removed the "Master" view name from the namevaluemap and just kept the "View1". I see that you changed those names in your code so you already know, but in case someone else is looking here:&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;//String[] sDesignViews = new string[] { "Master", "View1" };
String[] sDesignViews = new string[] { "View1" };&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I also dialed down the dialed down the quality and turned off generating a STEP file. Maybe you'll experience this too, but during the program run, Inventor switched to the background for about a minute, and then came back in the taskbar (I watched in the Windows Task Manager). Maybe these tweaks will help with the issue happening on your end.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best,&lt;/P&gt;&lt;P&gt;Cody&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;All together C#:&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;static void Export3DPdf()
{
    Inventor.Application InvApp = //

    Inventor.ApplicationAddIn PDFAddin = null;

    foreach (ApplicationAddIn appAddin in InvApp.ApplicationAddIns)
    {
        if (appAddin.ClassIdString == "{3EE52B28-D6E0-4EA4-8AA6-C2A266DEBB88}")
        {
            PDFAddin = appAddin;
            break;
        }
    }

    dynamic pdfConvertor3d = PDFAddin.Automation;

    Document oDoc = InvApp.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"] = false;
    //oOptions.Value["ExportTemplate"] = @"C:\Users\Public\Documents\Autodesk\Inventor 2024\Templates\Sample Part Template.pdf";
    oOptions.Value["ExportTemplate"] = @"C:\Users\Public\Documents\Autodesk\Inventor 2024\Templates\en-US\Sample Part Template.pdf";
    oOptions.Value["VisualizationQuality"] = AccuracyEnum.kLow;

    //String[] sDesignViews = new string[] { "Master", "View1" };
    String[] sDesignViews = new string[] { "View1" };
    oOptions.Value["ExportDesignViewRepresentations"] = sDesignViews;

    pdfConvertor3d.Publish(oDoc, oOptions);
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2024-04-24 152912.png" style="width: 600px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1354343iF5C3E0A0AF2EAEA3/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Screenshot 2024-04-24 152912.png" alt="Screenshot 2024-04-24 152912.png" /&gt;&lt;/span&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 24 Apr 2024 19:54:51 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/export-part-document-to-3d-pdf-with-api-in-c/m-p/12731605#M11412</guid>
      <dc:creator>earl_cody</dc:creator>
      <dc:date>2024-04-24T19:54:51Z</dc:date>
    </item>
    <item>
      <title>Re: Export part document to 3d pdf with API in c#</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/export-part-document-to-3d-pdf-with-api-in-c/m-p/12757026#M11413</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/14881060"&gt;@manasi_patilESZTV&lt;/a&gt;&amp;nbsp;please see this link&lt;BR /&gt;&lt;A href="https://adndevblog.typepad.com/manufacturing/2022/08/sorting-invalid-arguments-error-in-c-add-in-code-for-generating-3d-pdf-in-inventor.html" target="_blank"&gt;https://adndevblog.typepad.com/manufacturing/2022/08/sorting-invalid-arguments-error-in-c-add-in-code-for-generating-3d-pdf-in-inventor.html&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 07 May 2024 05:42:50 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/export-part-document-to-3d-pdf-with-api-in-c/m-p/12757026#M11413</guid>
      <dc:creator>jmacapagal2CD9H</dc:creator>
      <dc:date>2024-05-07T05:42:50Z</dc:date>
    </item>
  </channel>
</rss>

