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
Solved! Go to Solution.
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.
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
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()
The attached example does a lot of things; walking the AFEM hierarchy is one of them. Hopefully not too confusing for this purpose.