How to export a part or assembly to 3d pdf using vb API in creo 10
‎Dec 02, 2024
06:31 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
‎Dec 02, 2024
06:31 AM
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?
Solved! Go to Solution.
Labels:
- Labels:
-
Toolkit
ACCEPTED SOLUTION
Accepted Solutions
‎Dec 03, 2024
01:53 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
‎Dec 03, 2024
01:53 AM
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;
}
1 REPLY 1
‎Dec 03, 2024
01:53 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
‎Dec 03, 2024
01:53 AM
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;
}