Skip to main content

Mechanical scripting interface

Tree

Last update: 14.01.2025

class Ansys.ACT.Automation.Mechanical.Tree

Bases: object

Tree class.

Overview

Methods

Name Description
Activate selects an object in the tree.
ClearFilter Clears the current filter.
ClearSort Clears the current sort.
Filter Filter method.
Find Find method.
GetPathToFirstActiveObject Gets the full path that needs to be typed in order to go to the selected object.
Group Groups a list of objects together.
IsSorted Checks if the tree is currently sorted alphabetically.
Refresh Refreshes the tree.
Sort Sorts the tree objects based on given parameters.
Suspend Prevents the tree from being updated.
Ungroup Removes groupingFolder from the tree.

Properties

Name Description
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)

selects an object in the tree.

Tree.ClearFilter()

Clears the current filter.

Tree.ClearSort()

Clears the current sort.

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])

Filter method.

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

Find method.

Tree.GetPathToFirstActiveObject()

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

Tree.Group(dataModelObjects: Iterable)

Groups a list of objects together.

Tree.IsSorted()

Checks if the tree is currently sorted alphabetically.

Tree.Refresh()

Refreshes the tree.

Tree.Sort(type: Ansys.Mechanical.DataModel.Enums.SortingType, reverse: bool)

Sorts the tree objects based on given parameters.
type
reverse

Tree.Suspend()

Prevents the tree from being updated.

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

Removes groupingFolder from the tree.