Query Methods

When you are using IfElse statements in a Shape Script, the condition is usually that the object has a certain tag or property, and possibly if that tag or property has a particular value. You can set up the conditional statement to check for the property and value using one of the two query methods described below.

Queries

Method

Description

See also

boolean HasTag(
 string tagname,
 ( string tagvalue ) )

Evaluates to true if the associated element has a tag with the name tagname.

If the second parameter tagvalue is provided, the tag tagname must be present, and the value of the tag has to be equal to tagvalue for the method to evaluate to true.

 

Tagged Values

boolean HasProperty(
 string propertyname,
 ( string propertyvalue ) )

Evaluates to true if the associated element has a property with the name propertyname.

If the second parameter propertyvalue is provided, the property must be present, and the value of the property has to be equal to propertyvalue for the method to evaluate to true.

 

Display Element/Connector Properties

Learn more