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

Community Tip - Stay updated on what is happening on the PTC Community by subscribing to PTC Community Announcements. X

How to SetReferenceSystem on model.Export

MichelH
12-Amethyst

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
12-Amethyst
(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
12-Amethyst
(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

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

Thank you @MichelH 

Top Tags