Cancel
Showing results for 
Search instead for 
Did you mean: 

Getting element belonging to a mesh - How to?

Phenom
Phenom

to all

I am looking for a way of getting all the elements belonging to a mesh but cannot find anything in the doc. It seems that CAE.FEElement has a property mesh which returns the mesh for this element but nothing the other way around. I am looking to code something along these lines

 

For Each myMeshCollector As CAE.IMeshCollector In              themeshManager.GetMeshCollectors()
If myMeshCollector.CollectorType = 1D
 themeshes = myMeshCollector.GetMeshes()
 For Each mesh As CAE.Mesh In themeshes
   For Each elm In mesh
     ‘Do something
  Next elm
 Next mesh
 End if
Next myMeshCols

 

 

Thanks

Regards

JXB

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

Re: Getting element belonging to a mesh - How to?

Siemens Phenom Siemens Phenom
Siemens Phenom

 Use the SmartSelectionManager:

 

femPart.SmartSelectionMgr.CreateRelatedElementMethod(mesh).GetElements

 

Re: Getting element belonging to a mesh - How to?

Phenom
Phenom
Thanks JimB. Much appreciated
Production: NX9.0.3.4, NX10.0.2.6
Development: VB.NET (amateur level !)

Re: Getting element belonging to a mesh - How to?

Siemens Pioneer Siemens Pioneer
Siemens Pioneer

Remember all old UF style methods can be used in vb.

 

Dim ufs As UF.UFSession = UF.UFSession.GetUFSession()
Dim ufsf As UF.UFsf = ufs.Sf()
Dim workFemPart As CAE.FemPart = CType(theSession.Parts.BaseWork, CAE.FemPart)
Dim fEModel1 As CAE.FEModel = CType(workFemPart.FindObject("FEModel"), CAE.FEModel)
Dim elemTags As Tag()
Dim numElem As Integer

'Assume you have the mesh object here.
ufsf.LocateElement(meshObject.Tag(), numElem, elemTags)

MAYAHTT
www.mayahtt.com