Skip to main content
10-Marble
April 18, 2024
Solved

How to export a creo model to JT (enable xtbrep) with Creo OTK Java / Jlink

  • April 18, 2024
  • 1 reply
  • 1045 views

How to export a creo model to JT (enable xtbrep) with Creo OTK Java / Jlink。 I use such code:

GeometryFlags geometryFlags = pfcExport.GeometryFlags_Create();
geometryFlags.SetAsQuilts(false);
geometryFlags.SetAsWireframe(false);
geometryFlags.SetAsSolids(true);
geometryFlags.SetAsSurfaces(true);
AssemblyConfiguration asmCfg = AssemblyConfiguration.EXPORT_ASM_SINGLE_FILE;
JT3DExportInstructions expJtIns= pfcExport.JT3DExportInstructions_Create(asmCfg,geometryFlags);

model.Export(jtFilePath,expJtIns);

 

recieive error :XInvalidInput

Best answer by remy

Hi the error returns XInvalidInput : 

Consequently you need to debug the inputs of the method individually and collectively. Meaning that some input combinations are unsupported for various reasons. One way to check the input aka flags validity is to run the export from Creo Paramtric UI.

Another way to run 

isGeomRepSupported 

 

Additionally the following article https://www.ptc.com/en/support/article/CS289580 recommends to ExportType.EXPORT_JT

 

You might as well find inspiration and derive code from this STEP export code sample : https://www.ptc.com/en/support/article/CS224527 

1 reply

remy21-Topaz IAnswer
21-Topaz I
April 18, 2024

Hi the error returns XInvalidInput : 

Consequently you need to debug the inputs of the method individually and collectively. Meaning that some input combinations are unsupported for various reasons. One way to check the input aka flags validity is to run the export from Creo Paramtric UI.

Another way to run 

isGeomRepSupported 

 

Additionally the following article https://www.ptc.com/en/support/article/CS289580 recommends to ExportType.EXPORT_JT

 

You might as well find inspiration and derive code from this STEP export code sample : https://www.ptc.com/en/support/article/CS224527