Skip to main content
1-Visitor
January 16, 2020
Question

Is there any creo toolkit API to create default coordinate system (global coordinate system)?

  • January 16, 2020
  • 2 replies
  • 2774 views

Hi All,

 

I have a model in which no default coordinate system present.

Is there any way to get or create default coordinate system(global coordinate system) using toolkit API?

2 replies

21-Topaz I
January 16, 2020

There is not direct API / function to create a CSYS with Toolkit.

 

When you search create CSYS toolkit in the knowledge one can find this article :

https://www.ptc.com/en/support/article?n=CS221868 

 

Basically the methodology relies on Element Tree. 

17-Peridot
January 16, 2020

in case lots of low level code is not your thing here are some options:

 

ProMacroLoad( L"~ Command `ProCmdDefDatumCsys`");
ProMacroExecute(); 

 would get you default coordinate systems...

 

Otherwise making a UDF from default csys feature and using ProUdfCreate(...) would require less code...

 

Another option is to make an XML out of a default csys elemtree and to use it with ProElemtreeFromXMLCreate(...) - still less typing and code maintenance...

 

HIH.

FV.

17-Peridot
January 17, 2020

Eike,

Are you sure this code is valid for wildfire and creo releases?

PRO_E_CSYS_METHOD element had been obsolete for quite some time now...

Below is a feature tree for default csys (creo variety).

😀FV.

Element tree
============

FEATURE_TREE (COMPOUND) 
 |---FEATURE_TYPE VALUE (INT) = 979
 |---STD_FEATURE_NAME VALUE (WSTRING) = CS1
 |---CSYS_ORIGIN_CONSTRS (ARRAY) 
 |---CSYS_OFFSET_TYPE VALUE (INT) = 0
 |---CSYS_ONSURF_TYPE VALUE (INT) = 0
 |---CSYS_DIM_CONSTRS (ARRAY) 
 |---CSYS_ORIENTMOVES (ARRAY) 
 |---CSYS_NORMAL_TO_SCREEN VALUE (INT) = 0
 |---CSYS_ORIENT_BY_METHOD VALUE (INT) = 0
 |---CSYS_ORIENTSELAXIS1_REF VALUE (SELECTION) = 

 |---CSYS_ORIENTSELAXIS1_REF_OPT VALUE (INT) = 0
 |---CSYS_ORIENTSELAXIS1_OPT VALUE (INT) = 0
 |---CSYS_ORIENTSELAXIS1_FLIP VALUE (INT) = 0
 |---CSYS_ORIENTSELAXIS2_REF VALUE (SELECTION) = 

 |---CSYS_ORIENTSELAXIS2_REF_OPT VALUE (INT) = 0
 |---CSYS_ORIENTSELAXIS2_OPT VALUE (INT) = 0
 |---CSYS_ORIENTSELAXIS2_FLIP VALUE (INT) = 0
 |---CSYS_ORIENTSELAXIS2_ROT_OPT VALUE (INT) = 0
 |---CSYS_ORIENTSELAXIS2_ROT VALUE (DOUBLE) = 0.000000
 |---CSYS_TYPE_MECH VALUE (INT) = 0
 |---CSYS_FOLLOW_SRF_OPT VALUE (INT) = 0
 |---CSYS_NAME_DISPLAY_OPT VALUE (INT) = 1
 |---CSYS_DISPLAY_ZOOM_DEP_OPT VALUE (INT) = 0
 |---CSYS_AXIS_LENGTH VALUE (DOUBLE) = 0.000000

 

17-Peridot
January 16, 2020

Might be easier to fire off a Mapkey to get that done.