This page contains reference documentation for the Parent function. This function returns a node's parent.
Group Parent()
Examples are as follows:
// Copy the path to any node to a string.
function string GetPathToNode( Node node )
{
string path = "/" + node.Name;
node = node.Parent();
while ( node && node.Parent() )
{
path = "/" + node.Name + path;
node = node.Parent();
}
return path;
}
// Construct the parent and grandparent for a node.
Node parentNode = node.Parent();
Node grandParent = parentNode.Parent();
For sample code: