Goal: Refresh the Mechanical tree. This is needed for certain operations that visually appear only after an update of the tree.
Code:
Tree.Refresh()
The Tree.Refresh() method accepts a boolean value
that controls whether the states of data model objects are recomputed before the tree is
refreshed. This boolean has a default value of False. For
more information on updating the state of the data model, see Recompute the State of Data Model Objects.
Pause the Tree
You can also pause the tree from updating while doing a long-running script, such as
the your-script example below.
Code:
with Transaction(): your-script