Var – Defining variables in Soley Studio

Non-graph element parameters must be prefixed by the var or ref-keyword; A var type is one of the attribute types supported by Soley Studio. The primitive types require the var  prefix and are handed in by-value.

Example code:

//Find Part nodes in a set of Node nodes and add them to another set, both sets are input arguments 
1 procedure getPartsOutOfNodeset(ref nodesSet:set, ref partsSet:set) {
2    for(n:Node in nodesSet){										//Go through each node in nodesSet
3       if(typeof(n) >= Part){										//if the node is of type Part or a child class (>=)
4          partsSet.add((Part)n);									//then add the node to the set partsSet, casting to type Part required as the node is still considered to be of type Node
5       }
6    }
7    return ();														//return nothing, return statement is obligatory for procedure
8 }

How to use it:

More Examples can be found in these Packages:

Was this article helpful?

Related Articles