NX secondary development - to create a temporary coordinate system UF_CSYS_create_temp_csys

. 1 NX9 + VS2012
 2  
3  
. 4      #include <uf.h>
 . 5      #include <uf_csys.h>
 . 6      #include <uf_mtx.h>
 . 7  
. 8  
. 9      UF_initialize ();
 10  
. 11      // input vector Y outputs a vector X * 3 3 matrix 
12 is      Double XVEC [ . 3 ] = { 0.0 , 0.0 , 1.0 };
 13 is      Double Yvec [ . 3 ] = { 0.0 , 1.0 , 0.0 };
 14      Double Mtx [ . 9 ];
 15     UF_MTX3_initialize (XVEC, Yvec, Mtx);
 16  
. 17      // create a 3 x 3 matrix 
18 is      tag_t matrixID = NULL_TAG;
 . 19      UF_CSYS_create_matrix (Mtx, & matrixID);
 20 is  
21 is  
22 is      // or written 
23 is      Double MatrixValues [ . 9 ] = { 1.0 , 0.0 , 0.0 , 0.0 , 1.0 , 0.0 , 0.0 , 0.0 , 1.0 };
 24      tag_t MatrixID1 = NULL_TAG;
 25     UF_CSYS_create_matrix (MatrixValues, & MatrixID1);
 26 is  
27      // Create coordinate system CSYS 
28      Double CsysOrigin [ . 3 ] = { 0.0 , 0.0 , 0.0 };
 29      tag_t CsysId = NULL_TAG;
 30      UF_CSYS_create_csys (CsysOrigin, matrixID, & CsysId);
 31 is  
32      // Create temporary coordinate system (not shown in display) 
33 is      tag_t TempCsysId = NULL_TAG;
 34 is      UF_CSYS_create_temp_csys (CsysOrigin, matrixID, & TempCsysId);
 35  
36  
37 [      // set position WCS 
38     UF_CSYS_set_wcs(CsysId);
39 
40     UF_terminate();

 

Guess you like

Origin www.cnblogs.com/nxopen2018/p/10957181.html