Professional Documents
Culture Documents
DS.Tree.FirstActiveBranch
DS.Tree
DS.Tree
DS.Tree.Branches
DS.Tree.Branches(1) == DS.Tree.FirstActiveBranch
DS.Tree.Projects
DS.Tree.Projects(1) == DS.Tree.FirstActiveBranch.Project
DS.Tree.FirstActiveBranch.Project.Models(1)
Project
Model
PrototypeGroup
CoordinateSystemGroup
MeshControlGroup
ComponentGroup
Environment
AnalysisSettings
Load
AnswerSet
4 © 2011 ANSYS, Inc. November 29, 2012 Result
Release 14.5
Children of Branch Object
branchObj = DS.Tree.FirstActiveBranch
branchObj.Project
branchObj.Model ==
branchObj.Project.Models(1)
branchObj.PrototypeGroup
branchObj.MeshControlGroup
branchObj (model
with current object)
branchObj.ComponentGroup
branchObj.Environment
branchObj.AnswerSet
• Typical properties:
– Name
– Results
• Results are accessed using “Item”
property
– Starts at 1 (not 0)
– …
Most of the scripts you will write will probably share this structure:
• Variable initialization
• Main part of the code
• Functions
• Comments wherever needed (highly recommended!)
Update the tree structure when you add entities through scripting
• DS.Script.fillTree();
• Below example shows procedure for accessing various parameters of “Force” and
specifying appropriate values/options
ListView.ActivateItem("Scoping Method");
ListView.ItemValue = "Named Selection";
ListView.ActivateItem("Named Selection");
ListView.ItemValue = “face";
12 © 2011 ANSYS, Inc. November 29, 2012 Release 14.5
Specifying parameters in Details pane (2)
DS.Script.lv.ActivateItem(“Define By");
DS.Script.lv.ItemValue = “Components";
DS.Script.lv.ActivateItem(“Coordinate System");
DS.Script.lv.ItemValue = " Global Coordinate System ";
DS.Script.lv.ActivateItem(“X Component");
DS.Script.lv.ItemValue = “1”;
DS.Script.lv.ActivateItem(“Y Component");
DS.Script.lv.ItemValue = “1";
DS.Script.lv.ActivateItem(“Z Component");
DS.Script.lv.ItemValue = “1”;
DS.Script.lv.ActivateItem(“Suppressed");
DS.Script.lv.ItemValue = “No”;
DS.Script.fillTree();