Node Namespace Structure

Nodes are maintained in a hierarchical structure with the following predefined namespaces:

Node Namespace Structure

Namespace Description
Primitive Contains all primitives
Model Contains the object constructors for all library components that have been automatically loaded
Unit Contains all user-defined units of measure
User Contains all nodes created by the user

When a command is being executed at any namespace, DScript first looks in the current namespace for all of the nodes it needs to evaluate the command. If a required node is not found, the parent's namespace is searched, and then the parent's parent's namespace, and so on until all required nodes are found.

For example, if you use PI in a command in the User level, the software first searches the User namespace, then the Unit namespace, then the Model namespace, and finally the Primitive namespace before it finds a node named PI. If, however, you had created a node named PI in the User level, this version of PI would be the first found and the one applied in the current command.

In this case, library components still use the primitive definition for PI. Commands executed in the Model level know nothing about any nodes residing in the User level. Similarly, commands executing in the User level know nothing about any nodes in the Component1, Component2, and other dynamically-created levels. But, User namespace commands can access the object constructors of any component because the root is located in the Model namespace.

Temporary namespaces are created by evaluating an expression within braces { }. Nodes created in a temporary namespace are visible only to expressions also evaluated within the braces. These nodes are deleted when the end brace is encountered.

See About Nodes.

To execute a command in a particular namespace, use the primitive, model, unit, or user primitives.

See primitive.

See model.

See unit.

See user.