How to generate mesh on selected body with and without looping?

Chemsdine CHEMAI
Member, Employee Posts: 201
✭✭✭✭

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
-
At 24.2:
- import context_menu
- ExtAPI.DataModel.Tree.Activate(list_of_tree_objects_to_mesh)
- context_menu.DoModelPreviewMesh(ExtAPI)
0