Component Functions

Component functions allow groups of nodes to be created as reusable components, rather than copying and pasting the nodes. These are similar to functions in normal programming.

See image below for an example. In this example, a reusable component has been created between the Component Start and Component End nodes. The start and end nodes define the boundary of the component. The Component Start node can only receive incoming data from a nodegroup node, which combines the incoming nodes into a single feed.

Once inside the component, the nodeungroup() function allows the modeller to split the node group into individual entries. The overall component will run once per node group. So in this example, the component will run twice. The nodes feeding into the component end can be retrieved using a componentresult() function.

Component Calculation Grouping Component Calculation Grouping

Functions

Dynamic Function Notes
x componentstart() This is the main entry point to the component. Only nodegroups can be connected to the component start. It is possible to add another component start within an existing component but this may create unforseen issues and errors and therefore only one componentstart/component end should be used.
This only supports dynamically linked nodes. It is not necessary to type in the names of the node group node.
x componentend([componentstart]) The componentend calculation indicates the end point of the component. Every input to the component runs once between the componentstart and componentend. This only supports dynamically linked nodes. Only the componentstart node is required.
componentresult([componentend], run_index, "calculated_node") This calculation fetches the result for the selected run index. The run index is the index of the node group that is passed into component start, as they are ordered on the driver model canvas - first by the y-axis, then by the x-axis.
If there are multiple calculated values to fetch, then the calculated node can be optionally added. If the calculated node is not included in the expression, it defaults to the first calculated node connected to componentend.
The run_index can be a fixed number referencing the index (x, y ordered) of the run, or the name of the node group that feeds into the componentstart. Note that the name of the node group should be double quoted, rather than enclosed in square brackets.
x nodegroup() Groups a set of nodes for use in calculations, such as components or arrays
x nodeungroup(index, [componentstart]) Gets the node based on the index for use in calculations.