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

How to SetReferenceSystem on model.Export

MichelH
9-Granite

How to SetReferenceSystem on model.Export

Hello,

inside J-Link I've been trying to set a specific coordinate system for IGES export without success. Following code is taken from the J-Link examples (blue code is added by me):

ExportInstructions instrs;
GeometryFlags flags = pfcExport.GeometryFlags_Create();
flags.SetAsSolids(true);
IGES3DNewExportInstructions igesInstrs = pfcExport.IGES3DNewExportInstructions_Create(AssemblyConfiguration.EXPORT_ASM_SINGLE_FILE, flags);
igesInstrs.SetReferenceSystem();
Features csystems = ((Solid) model).ListFeaturesByType(Boolean.FALSE, FeatureType.FEATTYPE_COORD_SYS);
Feature secondCsys = csystems.get(1);
igesInstrs.SetReferenceSystem(pfcSelect.CreateModelItemSelection(secondCsys, null));
instrs = igesInstrs;
String outputPath = model.GetInstanceName().toLowerCase() + ".igs";
model.Export(outputPath, instrs);

Even though I specify the second coordinate system inside the IGES3DNewExportInstructions instance (no errors, debugging shows coordinate system) the IGES export has the first coordinate system.

 

I appreciate any idea and help.

 

Thank you and kind regards

Michael

1 ACCEPTED SOLUTION

Accepted Solutions
MichelH
9-Granite
(To:MichelH)

Hi,

I did not test it yet but I think I have found the solution:

"The selection passed to Export3DInstructions.SetReferenceSystem() must reference the CSYS geometry and not the CSYS feature." (see How to select a CSYS when exporting to STEP with Creo OTK Java / Jlink)

 

Kind regards

Michael

View solution in original post

2 REPLIES 2
MichelH
9-Granite
(To:MichelH)

Hi,

I did not test it yet but I think I have found the solution:

"The selection passed to Export3DInstructions.SetReferenceSystem() must reference the CSYS geometry and not the CSYS feature." (see How to select a CSYS when exporting to STEP with Creo OTK Java / Jlink)

 

Kind regards

Michael

View solution in original post

Great solution, had the same issue but now using CSYS geometry reference it works like a charm.

Thank you @MichelH 

Announcements