cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Learn all about the Community Ranking System, a fun gamification element of the PTC Community. X

How to export a part or assembly to 3d pdf using vb API in creo 10

sahmeds
10-Marble

How to export a part or assembly to 3d pdf using vb API in creo 10

Hi,

 

I'm using Creo 10 and i'm trying to export the model to 3d PDF using VB COM API in C#.

i tried below 2 options and getting exceptions.

 

 

 

 

 

  var instructions = new CCpfcPDFExportInstructions().Create();
   model.Export(pdfFilePath,(IpfcExportInstructions) instructions);

   model.ExportIntf3D(pdfFilePath, (int)EpfcExportType.EpfcEXPORT_PDF,null);

 

 

 

 

 

 

can you please provide some code sample to guide me through?

ACCEPTED SOLUTION

Accepted Solutions
sahmeds
10-Marble
(To:sahmeds)

 

Solved it!.

 

 

        private IpfcPDFExportInstructions GetPDFInstructions3D(EpfcPDFExportMode expMode)
        {

            var opts = new CpfcPDFOptions();

            var opt1 = new CCpfcPDFOption().Create();
            opt1.OptionType = EpfcPDFOptionType.EpfcPDFOPT_LAUNCH_VIEWER;
            opt1.set_OptionValue(new CMpfcArgument().CreateBoolArgValue(false));
            opts.Append(opt1);

            var opt2 = new CCpfcPDFOption().Create();
            opt2.OptionType = EpfcPDFOptionType.EpfcPDFOPT_EXPORT_MODE;
            opt2.set_OptionValue(new CMpfcArgument().CreateIntArgValue((int)expMode));
            opts.Append(opt2);

            var opt3 = new CCpfcPDFOption().Create();
            opt3.OptionType = EpfcPDFOptionType.EpfcPDFOPT_ORIENTATION;
            opt3.set_OptionValue(new CMpfcArgument().CreateIntArgValue((int)EpfcSheetOrientation.EpfcORIENT_LANDSCAPE));
            opts.Append(opt3);

            var opt5 = new CCpfcPDFOption().Create();
            opt5.OptionType = EpfcPDFOptionType.EpfcPDFOPT_VIEW_TO_EXPORT;
            opt5.set_OptionValue(new CMpfcArgument().CreateIntArgValue((int)EpfcPDFSelectedViewMode.EpfcPDF_VIEW_SELECT_CURRENT));
            opts.Append(opt5);

            var instructions = new CCpfcPDFExportInstructions().Create();
            instructions.set_Options(opts);

            return instructions;
        }

 

 

 

View solution in original post

1 REPLY 1
sahmeds
10-Marble
(To:sahmeds)

 

Solved it!.

 

 

        private IpfcPDFExportInstructions GetPDFInstructions3D(EpfcPDFExportMode expMode)
        {

            var opts = new CpfcPDFOptions();

            var opt1 = new CCpfcPDFOption().Create();
            opt1.OptionType = EpfcPDFOptionType.EpfcPDFOPT_LAUNCH_VIEWER;
            opt1.set_OptionValue(new CMpfcArgument().CreateBoolArgValue(false));
            opts.Append(opt1);

            var opt2 = new CCpfcPDFOption().Create();
            opt2.OptionType = EpfcPDFOptionType.EpfcPDFOPT_EXPORT_MODE;
            opt2.set_OptionValue(new CMpfcArgument().CreateIntArgValue((int)expMode));
            opts.Append(opt2);

            var opt3 = new CCpfcPDFOption().Create();
            opt3.OptionType = EpfcPDFOptionType.EpfcPDFOPT_ORIENTATION;
            opt3.set_OptionValue(new CMpfcArgument().CreateIntArgValue((int)EpfcSheetOrientation.EpfcORIENT_LANDSCAPE));
            opts.Append(opt3);

            var opt5 = new CCpfcPDFOption().Create();
            opt5.OptionType = EpfcPDFOptionType.EpfcPDFOPT_VIEW_TO_EXPORT;
            opt5.set_OptionValue(new CMpfcArgument().CreateIntArgValue((int)EpfcPDFSelectedViewMode.EpfcPDF_VIEW_SELECT_CURRENT));
            opts.Append(opt5);

            var instructions = new CCpfcPDFExportInstructions().Create();
            instructions.set_Options(opts);

            return instructions;
        }

 

 

 

Announcements


Top Tags