CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   ANSYS Meshing & Geometry (https://www.cfd-online.com/Forums/ansys-meshing/)
-   -   [ANSYS Meshing] Select Geometry in script (https://www.cfd-online.com/Forums/ansys-meshing/163000-select-geometry-script.html)

Rekarth November 22, 2015 00:06

Select Geometry in script
 
Hi,

Scripting is not well documented, I need help with something.

I wish to select select the geometry body to apply mesh method and mesh sizing on it. How can I do it? Here is my code so far.

Thanks

Code:

var meshGroup = DS.Tree.FirstActiveBranch.MeshControlGroup;

DS.Script.changeActiveObject(meshGroup.ID);
DS.Script.doInsertMeshElementShape();
ListView.ActivateItem("Scoping Method");
ListView.ItemValue = "Geometry Selection";
ListView.ActivateItem("Method");
ListView.ItemValue = "MultiZone";

DS.Script.changeActiveObject(meshGroup.ID);
DS.Script.doInsertMeshSize();
ListView.ActivateItem("Scoping Method");
ListView.ItemValue = "Geometry Selection";
ListView.ActivateItem("Element Size");
ListView.ItemValue = "1";


Rekarth November 23, 2015 17:01

Found what I was looking for. Here is the code if someone eventually need it.

Code:

ListView.ActivateItem("Scoping Method");
ListView.ItemValue = "Geometry Selection";
SM.Clear();
SM.SelectAll();
ListView.ActivateItem("Geometry");
ListView.ItemValue = "Apply";



All times are GMT -4. The time now is 02:58.