Tree.SetVisible

Tree.SetVisible ( 

string  ObjectName,

boolean Visible = true )

Example 1

Tree.SetVisible("Tree3", true);

Makes the "Tree3" tree object visible.

Example 2

Tree.SetVisible("Tree1", false);

Hides the tree object named "Tree1."

Example 3

Tree.SetVisible( "Oak", not Tree.IsVisible("Oak") );

Toggles the visibility of the tree object named "Oak." In other words, if "Oak" is visible, hide it; and if it's not visible, show it.

Note: The not operator is used in this example to convert the result of the Tree.IsVisible action to its logical opposite. If Tree.IsVisible returns true, the not converts that true into a false; if Tree.IsVisible returns false, the not converts that false into a true. The result is then used as the second parameter in our Tree.SetVisible action. So, the Tree.SetVisible action sets the visibility of "Oak" to true or false, based on whether "Oak" is currently visible or not, essentially toggling its visibility between on or off.

See also:  Related Actions