How to get the unmeshed parts by script?
If mesh status is not Solved, how to get the unmeshed parts by script in Mechanical, Ansys Ls-dyna?
Best Answer
-
Hi @Louis , I'd loop on the different bodies and check those who have 0 elements (or 0 nodes) attached to them:
bodies = ExtAPI.DataModel.Project.Model.Geometry.GetChildren(DataModelObjectCategory.Body, True) for body in bodies: if body.Suppressed is False: if body.Elements == 0: print ('Mesh was no generated for body named: '+str(body.Name))
0
Answers
-
Pernelle,
It works, thank you very much!
1 -
FYI you can also look at the body object status in Mechanical. Below is a snippet of two bodies. One is meshed and the other is not. FullyDefined is the non-meshed body, while the one with a defined mesh has state of "Meshed"
Object state is a good property for detailed state info on all objects.
print Bodies[0].ObjectState
FullyDefinedprint Bodies[1].ObjectState
Meshed1 -
Hello Michael,
I've not seen your response (plenty of bounced emails), but the solution works!
Failed mesh -> Fully defined
Meshed ok -> Meshed0