Creo VB API PDF Export Code does not work after Upgrade from 3.0 to 7.0
Hello,
i have a Programm for exporting drawings to different formats (DWG, DXF and PDF). After Updating to Version 7.0 my code doesnt work anymore, although it works in Creo 3.0?
i get the ExportInstructions :
Dim exportPDFInstructions As IpfcPDFExportInstructions = getPDFInstructions3D(EpfcPDFExportMode.EpfcPDF_3D_AS_NAMED_VIEWS)
oExportInstructions = exportPDFInstructions
model.Export(exportSetting.sPath + "\" + sFilename + oFormat.Extension, oFormat.oExportInstructions)
Unfortunately in Creo 7 i get the following error:
"pfcExceptions::XToolkitInvalidType"
In Creo 3 it works without Problems, the Object Type is the same
Has anybody the same Problem and maybe a Solution?
Private Function getPDFInstructions3D(ByVal expMode As EpfcPDFExportMode) As IpfcPDFExportInstructions
Dim instructions As IpfcPDFExportInstructions
Dim opts As IpfcPDFOptions
Dim opt1 As IpfcPDFOption
Dim opt2 As IpfcPDFOption
Dim opt3 As IpfcPDFOption
Dim opt4 As IpfcPDFOption
Dim opt5 As IpfcPDFOption
opts = New CpfcPDFOptions
opt1 = (New CCpfcPDFOption).Create
opt1.OptionType = EpfcPDFOptionType.EpfcPDFOPT_LAUNCH_VIEWER
opt1.OptionValue = (New CMpfcArgument).CreateBoolArgValue(False)
opts.Append(opt1)
opt2 = (New CCpfcPDFOption).Create
opt2.OptionType = EpfcPDFOptionType.EpfcPDFOPT_EXPORT_MODE
opt2.OptionValue = (New CMpfcArgument).CreateIntArgValue(expMode)
opts.Append(opt2)
opt3 = (New CCpfcPDFOption).Create
opt3.OptionType = EpfcPDFOptionType.EpfcPDFOPT_ORIENTATION
opt3.OptionValue = (New CMpfcArgument).CreateIntArgValue(EpfcSheetOrientation.EpfcORIENT_LANDSCAPE)
opts.Append(opt3)
opt4 = (New CCpfcPDFOption).Create
opt4.OptionType = EpfcPDFOptionType.EpfcPDFOPT_EXPORT_MODE
opt4.OptionValue = (New CMpfcArgument).CreateIntArgValue(EpfcPDFExportMode.EpfcPDF_3D_AS_NAMED_VIEWS)
opts.Append(opt4)
opt5 = (New CCpfcPDFOption).Create
opt5.OptionType = EpfcPDFOptionType.EpfcPDFOPT_VIEW_TO_EXPORT
opt5.OptionValue = (New CMpfcArgument).CreateIntArgValue(EpfcPDFSelectedViewMode.EpfcPDF_VIEW_SELECT_CURRENT)
opts.Append(opt5)
instructions = (New CCpfcPDFExportInstructions).Create
'instructions.FilePath = sFile
instructions.Options = opts
Return (instructions)
End Function
Thank You!
Sebastian

