Getting element belonging to a mesh - How to?

to all

I am looking for a way of getting all the elements belonging to a mesh but cannot find anything in teh 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

Been struggling with the same issue myself.
This isn't an elegant solution but technically you can loop through all the elements in the FEModel through the label map and for every element check its mesh's name. Something like this should give you the element's mesh name:
feModel.FeelementLabelMap.GetElement(elemLabel).Mesh.Name

This will work poorly in large models with high amount of elements. Still seeking for the right method to get elements from given mesh.

After some searching - there is a dedicated wrapper function in the UFSf -LocateElement. You'll have to define UF session to use it, but it gets you the tags of all the FEElements in the mesh given mesh tag. It will look something like:

Dim ufs As UFSession = UFSession.GetUFSession()
Dim theMesh As CAE.Mesh ' mesh object
Dim numOfElems As Integer
Dim elemTags() As Tag
ufs.sf.LocateElement(theMesh.Tag, numOfElems, elemTags)