Cancel
Showing results for 
Search instead for 
Did you mean: 

create 1 group for each part in an .afm?

Phenom
Phenom

To all,

 

Nx has the option to create 'Automatic Groups'. I'd like to create 1 group for each part/fem attached to an.afm containing all the elements (and mesh?) making up this part

 

Is there a simple command to access the elements making up this part?

in a .afm

For each FEModel In theAFM

   get all the elements

   create group

Next FEModel

 

Thanks

Regards

 

Production: NX9.0.3.4, NX10.0.2.6
Development: VB.NET (amateur level !)
8 REPLIES

Re: create 1 group for each part in an .afm?

Siemens Phenom Siemens Phenom
Siemens Phenom

I would ask what the intended use of the group is. Do you really need a group of all of the elements in each fem, or would a group of all of the meshes meet your needs.

 

In large models, groups of elements can be heavy and slow processing times. Groups of meshes are more lightweight.

 

You can easily get the meshes from the MeshManager

 

If you really need elements, get the meshes first, then use the RelatedElemMethod to get the elements related to the mesh. The alternative is to get the FEElementLabelMap and loop through it to get all elements

 

If this is for boundary conditions, etc. BC distribution will handle the objects in the target set appropriately. If the target set contains a mesh and the BC needs to be generated on an element, the BC will distribute the load to each element in the selected mesh.

Re: create 1 group for each part in an .afm?

Phenom
Phenom

The group approach is for post processing. To be able to turn on/off a part to display a result/animation.

If you manually create a group (be it mesh-based or element based) if you change the FEM then the group will be only automatically updated if the meshes are the same. If you add more meshes (because you split a body for example) then the group is partially complete and you need to update the group. If one has only a couple of part then no big deal but getting a bit annyoing when you have quite a few parts

 

i was simpel thinkign of a way of automating the group creation/update

 

Yes 'Mesh' could work too and I would most likely start with that if there is no existing method in Nx and I need to write my own programme

 

Thanks

Regards

Production: NX9.0.3.4, NX10.0.2.6
Development: VB.NET (amateur level !)

Re: create 1 group for each part in an .afm?

Siemens Phenom Siemens Phenom
Siemens Phenom

For display control like this, you definitely want to group the meshes in the FEM component, not the elements.

Re: create 1 group for each part in an .afm?

Phenom
Phenom
Noted
Need to see if I have something in my "library" of examples to get the FEM attached to a .afm
I suspect he work flow will be something like

for each theAttachedFEM In theAFM
get theAttachedFEM.name
get all the mesh in theAttachedFEM
create a group will all the meshes
next
Production: NX9.0.3.4, NX10.0.2.6
Development: VB.NET (amateur level !)

Re: create 1 group for each part in an .afm?

Solution Partner Genius Solution Partner Genius
Solution Partner Genius

Note that the meshes and elements will be an occurrence and not the prototype objects

Re: create 1 group for each part in an .afm?

Phenom
Phenom

you'll have to enlighten further on this one!
I am currently looking at something along these lines

 

Dim theAFM As NXOpen.CAE.AssyFEModel = CType(workAssyFemPart.FindObject("AssyFEModel"), NXOpen.CAE.AssyFEModel)
     For Each theFEModelOccur As CAE.FEModelOccurrence In theAFM.GetChildren()

 

 

Production: NX9.0.3.4, NX10.0.2.6
Development: VB.NET (amateur level !)

Re: create 1 group for each part in an .afm?

Siemens Phenom Siemens Phenom
Siemens Phenom

The attached example does a lot of things; walking the AFEM hierarchy is one of them. Hopefully not too confusing for this purpose.

Re: create 1 group for each part in an .afm?

Phenom
Phenom

Thanks. Will have a look and no doubt wil learn a lot

Production: NX9.0.3.4, NX10.0.2.6
Development: VB.NET (amateur level !)