Tree#

class ansys.mechanical.stubs.v261.Ansys.ACT.Automation.Mechanical.Tree#

Bases: object

Overview#

GetTreeHandler

GetTreeHandler method.

IsObjInTreeView

IsObjInTreeView method.

OnActiveObjectChangedFwd

OnActiveObjectChangedFwd method.

add_OnActiveObjectChanged

add_OnActiveObjectChanged method.

remove_OnActiveObjectChanged

remove_OnActiveObjectChanged method.

Activate

selects an object in the tree.

CanAddTreeGroupingFolder

CanAddTreeGroupingFolder method.

ClearFilter

Clears the current filter.

ClearSort

Clears the current sort.

Click

Click method.

CreateObjRef

CreateObjRef method.

Equals

Equals method.

ExpandBranch

ExpandBranch method.

Filter

Filter method.

Find

Find method.

GetDataModelChanges

GetDataModelChanges method.

GetEnumerator

GetEnumerator method.

GetHashCode

GetHashCode method.

GetLifetimeService

GetLifetimeService method.

GetObjectsByName

Gets a list of all objects with the specified name.

GetObjectsByType

Gets a list of all objects with the specified type.

GetPathToFirstActiveObject

Gets the full path that needs to be typed in order to go to the selected object.

GetPathToObjectById

GetPathToObjectById method.

GetType

GetType method.

Group

Groups a list of objects together.

InitializeLifetimeService

InitializeLifetimeService method.

IsSorted

Checks if the tree is currently sorted alphabetically.

Refresh

Refreshes the tree.

Sort

Sorts the tree objects based on given parameters.

StartListening

StartListening method.

StopListening

StopListening method.

Suspend

Prevents the tree from being updated.

ToString

ToString method.

TryGetFolder

TryGetFolder method.

Ungroup

Removes groupingFolder from the tree.

ActiveObjects

Gets a list of all selected objects.

AllObjects

Gets a list of all objects available in the tree.

CurrentFilter

Gets the current filter applied on the tree.

CurrentSearchGraphics

Gets the current visibility.

CurrentSearchState

Gets the current search state.

CurrentSearchString

Gets the current search string (name/tag/propertyName/propertyValue).

FirstActiveObject

Gets the first object selected in the tree.

GroupingFoldersVisible

Controls whether or not group folders are visible.

Property detail#

property Tree.ActiveObjects: List[Ansys.Mechanical.DataModel.Interfaces.IDataModelObject] | None#

Gets a list of all selected objects.

property Tree.AllObjects: List[Ansys.Mechanical.DataModel.Interfaces.IDataModelObject] | None#

Gets a list of all objects available in the tree.

property Tree.CurrentFilter: Ansys.Common.Interop.DSObjectTypes.DSTreeSearchType | None#

Gets the current filter applied on the tree.

property Tree.CurrentSearchGraphics: Ansys.Mechanical.DataModel.Enums.VisibilityType | None#

Gets the current visibility.

property Tree.CurrentSearchState: Ansys.Mechanical.DataModel.Enums.ObjectState | None#

Gets the current search state.

property Tree.CurrentSearchString: str | None#

Gets the current search string (name/tag/propertyName/propertyValue).

property Tree.FirstActiveObject: Ansys.Mechanical.DataModel.Interfaces.IDataModelObject | None#

Gets the first object selected in the tree.

property Tree.GroupingFoldersVisible: bool | None#

Controls whether or not group folders are visible.

Method detail#

Tree.Activate(dataModelObject: Ansys.Mechanical.DataModel.Interfaces.IDataModelObject) None#

selects an object in the tree.

Tree.CanAddTreeGroupingFolder(dataModelObject: Ansys.Mechanical.DataModel.Interfaces.IDataModelObject) bool#

CanAddTreeGroupingFolder method.

Tree.ClearFilter() None#

Clears the current filter.

Tree.ClearSort() None#

Clears the current sort.

Tree.Click() None#

Click method.

Tree.CreateObjRef(requestedType: type) System.Runtime.Remoting.ObjRef#

CreateObjRef method.

Tree.Equals(obj: Any) bool#

Equals method.

Tree.ExpandBranch(objectId: int) None#

ExpandBranch method.

Tree.Filter(name: str, tag: str, state: Ansys.Mechanical.DataModel.Enums.ObjectState, visibility: Ansys.Mechanical.DataModel.Enums.VisibilityType, type: Ansys.Mechanical.DataModel.Enums.TreeFilterObjectClass, coordinateSystem: Ansys.ACT.Automation.Mechanical.CoordinateSystem, model: str, environment: Ansys.ACT.Automation.Mechanical.Analysis, scoping: Ansys.Mechanical.DataModel.Enums.TreeFilterScopingType, filterState: Ansys.Mechanical.DataModel.Enums.TreeFilterObjectState, propertyName: str, propertyValue: str, invertSearchResults: System.Nullable[bool]) None#

Filter method.

Tree.Find(name: str, func: System.Func[Ansys.Mechanical.DataModel.Interfaces.IDataModelObject, bool], tag: str, state: Ansys.Mechanical.DataModel.Enums.ObjectState) Iterable[Ansys.Mechanical.DataModel.Interfaces.IDataModelObject]#

Find method.

Tree.GetDataModelChanges(added: List[Ansys.Mechanical.DataModel.Interfaces.IDataModelObject], modified: List[Ansys.Mechanical.DataModel.Interfaces.IDataModelObject], removed: List[Ansys.Mechanical.DataModel.Interfaces.IDataModelObject]) None#

GetDataModelChanges method.

Tree.GetEnumerator() Ansys.ACT.Automation.Mechanical.TreeObjects#

GetEnumerator method.

Tree.GetHashCode() int#

GetHashCode method.

Tree.GetLifetimeService() Any#

GetLifetimeService method.

Tree.GetObjectsByName(name: str) List[Ansys.Mechanical.DataModel.Interfaces.IDataModelObject]#

Gets a list of all objects with the specified name.

Tree.GetObjectsByType(type: Tree.GetObjectsByType.type) List[Ansys.Mechanical.DataModel.Interfaces.IDataModelObject]#

Gets a list of all objects with the specified type.

Tree.GetPathToFirstActiveObject() str#

Gets the full path that needs to be typed in order to go to the selected object.

Tree.GetPathToObjectById(objectId: int) str#

GetPathToObjectById method.

classmethod Tree.GetTreeHandler() Ansys.Common.Interop.SimulationUIHandlers.ISimulationTreeHandler#

GetTreeHandler method.

Tree.GetType() type#

GetType method.

Tree.Group(dataModelObjects: Iterable) Ansys.ACT.Automation.Mechanical.TreeGroupingFolder#

Groups a list of objects together.

Tree.InitializeLifetimeService() Any#

InitializeLifetimeService method.

classmethod Tree.IsObjInTreeView(dataModelObj: Ansys.Mechanical.DataModel.Interfaces.IDataModelObject) bool#

IsObjInTreeView method.

Tree.IsSorted() bool#

Checks if the tree is currently sorted alphabetically.

classmethod Tree.OnActiveObjectChangedFwd(sender: Any, args: Any) None#

OnActiveObjectChangedFwd method.

Tree.Refresh(recomputeStates: bool) None#

Refreshes the tree.

Tree.Sort(type: Ansys.Mechanical.DataModel.Enums.SortingType, reverse: bool) None#
Sorts the tree objects based on given parameters.
Type of sorting to apply.
Wheter to sort in reverse order.

Note that all parameters of Sort are optional.
type: Defaults to alphabetical
reverse: Defaults to false

sorting in reverse order is currently not supported

 Usage example - sort alphabetically
ExtAPI.DataModel.Tree.Sort()

 Usage example - sort alphabetically
ExtAPI.DataModel.Tree.Sort(type=SortingType.Alphabetical, reverse=False)
Tree.StartListening() None#

StartListening method.

Tree.StopListening() None#

StopListening method.

Tree.Suspend() System.IDisposable#

Prevents the tree from being updated.

Tree.ToString() str#

ToString method.

Tree.TryGetFolder(obj: Ansys.Mechanical.DataModel.Interfaces.IDataModelObject) Ansys.ACT.Automation.Mechanical.TreeGroupingFolder#

TryGetFolder method.

Tree.Ungroup(groupingFolder: Ansys.ACT.Automation.Mechanical.TreeGroupingFolder) None#

Removes groupingFolder from the tree.

classmethod Tree.add_OnActiveObjectChanged(value: System.EventHandler[Ansys.ACT.Automation.Mechanical.ActiveObjectChangedEventArgs]) None#

add_OnActiveObjectChanged method.

classmethod Tree.remove_OnActiveObjectChanged(value: System.EventHandler[Ansys.ACT.Automation.Mechanical.ActiveObjectChangedEventArgs]) None#

remove_OnActiveObjectChanged method.