Showing results for 
Search instead for 
Do you mean 
Reply
Solved! Go to solution

Bodies transform matrix

Hello everybody. i am new to programming with UG.

i am writing a program that in one of her steps the user can choose body or component from an assembly.

after i get from the user the selected TaggedObjects i check if they are typeof component or body.

i am trying to get the transform matrix for the component or the body that the user choose.

 

i saw that for component i can use the - .GetPosition to get the transform matrix, but i can not understand how i can find the transform matrix for bodies. i saw the AskTransformOfOcc function but i do not know if:

1.this the function i need to use for bodies (i did not found any example of this or UF_ASSEM_ask_transform_of_occ functions)

2. if this is the function i need why i get 4X4 matrix and not 3X3 matrix? what is the value in every place in the matrix?

3. is there any other way to get the transform matrix of body?

 

 Many thanks in advance.

 
3 REPLIES
Solution
Solution
Accepted by topic author Ran
‎06-13-2017 04:26 AM

Re: Bodies transform matrix

Have you installed the NXOpen API documentation, which is mandatory?

Have you checked the C header files in %UGII_BASE_DIR%\UGOPEN, especially the uf_assem.h file, which includes the description of the UF call in question?

Stefan Pendl, Systemmanager CAx, HAIDLMAIR GmbH
Production: NX10.0.3, VERICUT 8.0, FBM, MRL 3.1.4 | TcUA 10.1 MP7 Patch 0 (10.1.7.0) | TcVis 10.1
Development: VB.NET, Tcl/Tk    Testing: NX11.0 EAP, NX12.0 EAP

How to Get the Most from Your Signature in the Community

Re: Bodies transform matrix

Hi Stefan,

 

thank for the quick response.

 

i know the NXOpen API documentation but i did not know that the C header files contain more explanations about the functions.

 

i found in uf_assem.h description about the transform matrix that i get from UF_ASSEM_ask_transform_of_occ and it solve my problem.

 

thanks for the help!

Re: Bodies transform matrix

[ Edited ]

Generally, bodies don't have transformations. If you create a cylinder with axis along the vector (1,1,1), then that axis vector is stored as part of the cylinder.

 

Another approach would to have a cylinder in some "standard" position, and then store a transformation that moves this standard cylinder as desired. But that's not how NX works..

山田
yamada