How to generate mesh on selected body with and without looping?
![Chemsdine CHEMAI](https://us.v-cdn.net/6037473/uploads/userpics/HOASSR4JKKCB/n9UQV1R9L217U.png)
Chemsdine CHEMAI
Member, Employee Posts: 201
✭✭✭✭
![Ansys Employee](https://us.v-cdn.net/6037473/uploads/badges/RVRDV39KPJ91.png)
![Solution Developer Community of Practice Member](https://us.v-cdn.net/6037473/uploads/badges/274G8C56SBE6.png)
Best Answer
-
While looping one can use the following code :
currentIds = ExtAPI.SelectionManager.CurrentSelection.Ids for id in currentIds : geoBody = ExtAPI.DataModel.GeoData.GeoEntityById(id) treeBody = ExtAPI.DataModel.Project.Model.Geometry.GetBody(geoBody) treeBody.GenerateMesh()
and without looping (after activating all tree objects) :
cmd="""DS.Script.doModelPreviewMesh();""" ds=ExtAPI.Application.ScriptByName("jscript").ExecuteCommand(cmd)
0
Answers
-
Hi @Chemsdine CHEMAI . It seems this method is no longer available at 24.2:
DS.Script.doModelPreviewMesh();Any JS method at 24.2?
0