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.
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.
You need to reference the documentation, which will detail the appropriate signature for the method:
In this case:
VB. NET Docs:
The "Refer to" link for all wrapped C functions will point back to the Open C docs:
UF_SF_ask_all_polygon_bodies (view source)
|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"
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
You can then use the NX object manager to "convert" from tags to objects.