Cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted

CAE bodies and CAE faces

Creator
Creator

Hi,

 

Please any one suggest me how do i get cae bodies and corresponding cae faces from fem work part using c++ nxopen API.

 

 

Thanks

 

6 REPLIES

Re: CAE bodies and CAE faces

Siemens Phenom Siemens Phenom
Siemens Phenom

Use UF_SF_ask_all_polygon_bodies() to get all of the bodies. You can then iterate through the bodies and use methods like UF_SF_body_ask_faces(), UF_SF_body_ask_edges(), UF_SF_face_ask_edges(), etc. to get other geometry.

Re: CAE bodies and CAE faces

Creator
Creator

Thanks JimB.

 

It is helpful.

Re: CAE bodies and CAE faces

Valued Contributor
Valued Contributor

Hello, JimB.

 

Naturally, if I try to use UF_SF_ask_all_polygon_bodies() in VB journal just like

Dim bodyArray() as NXOpen.Body = UF_SF_ask_all_polygon_bodies(workfempart)

i get error.

How would one use those functions with vb?

Can you please give an example. 

 

Thanks a lot in advance.  

Re: CAE bodies and CAE faces

Siemens Phenom Siemens Phenom
Siemens Phenom

You need to reference the documentation, which will detail the appropriate signature for the method:

 

https://docs.plm.automation.siemens.com/data_services/resources/nx/12/nx_api/custom/en_US/nxopen_net...

 

In this case:

 

VB. NET Docs:

unsafe void NXOpen.UF.UFSf.AskAllPolygonBodies ( out int  num_polygon_bodies,
    out NXOpen.Tag[]  polygon_bodies 
  )    

Wrapper method for UF_SF_ask_all_polygon_bodies

Refer to UF_SF_ask_all_polygon_bodies for documentation 
Mapping Help 

License requirements:None

 

The "Refer to" link for all wrapped C functions will point back to the Open C docs:

 

https://docs.plm.automation.siemens.com/data_services/resources/nx/12/nx_api/custom/en_US/ugopen_doc...

 

UF_SF_ask_all_polygon_bodies (view source)
 

Defined in: uf_sf.h
 
Overview
This function will get all polygon bodies in the part. 

Environment
Internal and External 

History
Originally released in NX4.0


 

int UF_SF_ask_all_polygon_bodies
(
int * num_polygon_bodies, 
tag_t * * polygon_bodies 
)
int * num_polygon_bodies Output Number of polygon bodies in the fem
tag_t * * polygon_bodies Output to UF_*free* Tags of polygon bodies


 

 

Open C functions will not use or return NX Open objects directlt. They typically work with object tags (or arrays of object tags)

 

 

See Chapter 5 in Getting Started with NX Open. Pay particular attention to the articles "More About NXOpen.UF" and "Objects and Tags"

Re: CAE bodies and CAE faces

Gears Esteemed Contributor Gears Esteemed Contributor
Gears Esteemed Contributor

In addition to @JimB's comments, note that you cannot call the function directly as shown in your post. You will need a reference to the UF session and make the call through that object. Something like below:

 

'the UF session variable, I usually make this a module level (global) variable
Dim theUfSession As UFSession = UFSession.GetUFSession()


Dim numPolyBodies As Integer
Dim polyBodyTags() As Tag
theUfSession.Sf.AskAllPolygonBodies(numPolyBodies, polyBodyTags)

You can then use the NX object manager to "convert" from tags to objects.

Re: CAE bodies and CAE faces

Valued Contributor
Valued Contributor

@JimB@cowski1, thank you both so much for your help.