-
-
December 8, 2022 at 11:03 pm
Jason Newton
SubscriberI'd like to learn how to access the mesh metrics value arrays in python , also getting topology arrays such as vertex values and/or indices. There seems to be a lot of capability of interacting with the mesher's entities but I wasn't able to figure out where the data I would like to inspect lived.
When using the macro recorder I did notice with making selections that face IDs or edge IDs would be populated to supply to the selection APIs but I couldn't figure out any way to inspect the faces in other ways, say by visiting topology related arrays.
-
December 9, 2022 at 8:30 am
Erik Kostson
Ansys EmployeeHi
One can get and set the meshmetric (mesh) in the Mechanical UI.
To set the aspectratio:
mesh=ExtAPI.DataModel.Project.Model.Mesh
mesh.MeshMetric=MeshMetricType.AspectRatio
To get the maximum aspect ratio given in the mesh metric details in the UI:
El_qua_max=mesh.Maximum
Min:
El_qua_min=mesh.Minimum
Hope this is of helpErik
-
December 12, 2022 at 12:29 pm
Erik Kostson
Ansys EmployeeActually a faster way is to get these direct in the geometry tree:
geometry = ExtAPI.DataModel.Project.Model.Geometry
bodies = geometry.GetChildren(DataModelObjectCategory.Body, True)
for body in bodies:
name = body.Name
print(str(name)+"; ")
print(str(body.Minimum)+"; ")
print(str(body.Maximum)+"; ")
print(str(body.Average)+"; ") -
December 13, 2022 at 12:46 am
Jason Newton
SubscriberIs there any way to make a selection of meshed faces that have scores <= some threshold? I can see from the histogram panel for mesh metrics that if I click on it I get neighborhoods of the geometry where meshing did poorly and needs investigation. I'm opened to non python routes for that. Most typically it seems applying some sizing controls to these selected neighborhoods works pretty well and is part of my immediate goals to more or less capture that process in a script.
Baking up a step - is there any way to get the list of vertices, edges, and faces in python?
-
- You must be logged in to reply to this topic.

Earth Rescue – An Ansys Online Series
The climate crisis is here. But so is the human ingenuity to fight it. Earth Rescue reveals what visionary companies are doing today to engineer radical new ideas in the fight against climate change. Click here to watch the first episode.

Ansys Blog
Subscribe to the Ansys Blog to get great new content about the power of simulation delivered right to your email on a weekly basis. With content from Ansys experts, partners and customers you will learn about product development advances, thought leadership and trends and tips to better use Ansys tools. Sign up here.
- Saving & sharing of Working project files in .wbpz format
- An Unknown error occurred during solution. Check the Solver Output…..
- Understanding Force Convergence Solution Output
- Solver Pivot Warning in Beam Element Model
- Colors and Mesh Display
- How to calculate the residual stress on a coating by Vickers indentation?
- whether have the difference between using contact and target bodies
- What is the difference between bonded contact region and fixed joint
- The solver engine was unable to converge on a solution for the nonlinear problem as constrained.
- User manual
-
2524
-
2066
-
1279
-
1096
-
457
© 2023 Copyright ANSYS, Inc. All rights reserved.