FxNodeID ​
This module contains functions for creating and working with NodeID lists.
Load ​
FxNodeID = require "FxNodeID";Functions ​
| Function | Description |
|---|---|
| Count (NodeID) | Returns the number of items in a list. |
| Create (NodeID) | Creates a node list. |
| FilterID (NodeID, Value) | Filters nodes. |
| FilterType (NodeID, NodeType) | Filters nodes of given type. |
| Get (NodeID, Index) | Returns the node from a node list at given index. |
| Merge (NodeID1, NodeID2) | Merges two node lists. |
| Remove (NodeID, RemoveID) | Removes a node from a list. |
| Reverse (NodeID) | Reverses a node list. |
| SortID (NodeID) | Sorts a node list by ID. |
Count (NodeID) ​
This function returns the number of nodes identified by the specified NodeID.
Parameters ​
- NodeID: The NodeID to identify the nodes of the list
Returns ​
The number of identified nodes
Errors ​
Possible errors include FX_REQUIRED_ASSET_UNAVAILABLE, FX_NODE_NOT_FOUND
Since ​
Version 1.0
Example ​
val = FxNodeID.Count("<layer1,layer2,layer3>");
-- returns 3
val = FxNodeID.Count("/s");
-- returns number of selected nodesCreate (NodeID) ​
This function returns a valid NodeID list identified by the given NodeID.
Parameters ​
- NodeID: The NodeID to identify the nodes of the list
Returns ​
A valid NodeID list without duplicates
Errors ​
Possible errors include FX_REQUIRED_ASSET_UNAVAILABLE, FX_NODE_NOT_FOUND
Since ​
Version 1.0
Example ​
-- create a list of all nodes
list = FxNodeID.Create("*");FilterID (NodeID, Value) ​
This function returns the nodes identified by the given NodeID that have the given value in their NodeID.
Parameters ​
- NodeID: The NodeID to identify the nodes of the list
- Value: The filter string
Returns ​
A valid NodeID list without duplicates
Errors ​
Possible errors include FX_REQUIRED_ASSET_UNAVAILABLE, FX_NODE_NOT_FOUND
Since ​
Version 1.0
Example ​
list = FxNodeID.FilterID("<layer1,layer2,group1>", "layer");
-- returns "<layer1,layer2>"FilterType (NodeID, NodeType) ​
This function returns the nodes identified by the given NodeID that are of the given type.
Parameters ​
Returns ​
A valid NodeID list without duplicates
Errors ​
Possible errors include FX_REQUIRED_ASSET_UNAVAILABLE, FX_NODE_NOT_FOUND, FX_TYPE_INVALID
Since ​
Version 1.0
Example ​
-- get list of voxel layer nodes
list = FxNodeID.FilterType("*", 11);Get (NodeID, Index) ​
This function returns the node at the given index from a list of nodes identified by the given NodeID. The index of the first item is 0.
Parameters ​
- NodeID: The NodeID to identify the nodes of the list
- Index: The list index
Returns ​
A single NodeID
Errors ​
Possible errors include FX_REQUIRED_ASSET_UNAVAILABLE, FX_NODE_NOT_FOUND, FX_VALUE_INVALID
Since ​
Version 1.0
Example ​
list = FxNodeID.Get("<dear,bear,fox", 2);
-- returns "fox"Merge (NodeID1, NodeID2) ​
This function merges the two identified NodeID lists and returns the new list.
Parameters ​
Returns ​
A valid NodeID list without duplicates
Errors ​
Possible errors include FX_REQUIRED_ASSET_UNAVAILABLE, FX_NODE_NOT_FOUND
Since ​
Version 1.0
Example ​
list = FxNodeID.Add("<layer1,layer2>", "layer3");
-- returns "<layer1,layer2,layer3>"Remove (NodeID, RemoveID) ​
This function takes the nodes identified by the given NodeID, removes all nodes identified by the given RemoveID, and returns the new list.
Parameters ​
- NodeID: The NodeID to identify the nodes of the list
- RemoveID: The NodeID to identify one or more nodes to remove from the list
Returns ​
A valid NodeID list without duplicates
Errors ​
Possible errors include FX_REQUIRED_ASSET_UNAVAILABLE, FX_NODE_NOT_FOUND
Since ​
Version 1.0
Example ​
list = "<bus,train,car>";
list = FxNodeID.Remove(list, "car");
-- returns "<bus,train>"Reverse (NodeID) ​
This function reverses the order of nodes identified by the given NodeID and returns the new list.
Parameters ​
- NodeID: The NodeID to identify the nodes of the list
Returns ​
A valid NodeID list without duplicates
Errors ​
Possible errors include FX_REQUIRED_ASSET_UNAVAILABLE, FX_NODE_NOT_FOUND
Since ​
Version 1.0
Example ​
list = "<one,two,three>";
list = FxNodeID.Reverse(list);
-- returns "<three,two,one>"SortID (NodeID) ​
This function takes the nodes identified by the given NodeID, sorts them alphabetically, and returns the new list.
Parameters ​
- NodeID: NodeID
Returns ​
A valid NodeID list without duplicates
Errors ​
Possible errors include FX_REQUIRED_ASSET_UNAVAILABLE, FX_NODE_NOT_FOUND
Since ​
Version 1.0
Example ​
list = "<fish,whale,shark>";
list = FxNodeID.SortID(list);
-- returns "<fish,shark,whale>"