Group Parameters¶
Complex hierarchies of parameters are possible, by nesting parameters under group parameters. For example, to create a new PrimitiveCreate node, and add a number parameter nested under a group parameter:
# Get the root node
rootNode = NodegraphAPI.GetRootNode()
# Add a PrimitiveCreate node at root level
primNode = NodegraphAPI.CreateNode('PrimitiveCreate', rootNode)
# Get the PrimitiveCreate node's root parameter
rootParam = primNode.getParameters()
# Add a group parameter under the root parameter
groupParam = rootParam.createChildGroup("yourGroup")
# Add a number parameter under the group
numberParam = groupParam.createChildNumber("yourNumber", 123.00)
- Parameter.createChildGroup(name: str, index: int = -1) NodegraphAPI.Parameter ¶
Creates and returns a new group parameter as a child of this group parameter. If
index
is non-negative, the child will be created at that index; otherwise, it’ll be appended.
- Parameter.createChildNumber(name: str, value: float, index: int = -1) NodegraphAPI.Parameter ¶
Creates and returns a new number parameter with the given
value
as a child of this group parameter. Ifindex
is non-negative, the child will be created at that index; otherwise, it’ll be appended.
- Parameter.createChildNumberArray(name: str, size: int, index: int = -1) NodegraphAPI.Parameter ¶
Creates and returns a new number array parameter of the given
size
as a child of this group parameter. Ifindex
is non-negative, the child will be created at that index; otherwise, it’ll be appended.
- Parameter.createChildString(name: str, value: str, index: int = -1) NodegraphAPI.Parameter ¶
Creates and returns a new number parameter with the given
value
as a child of this group parameter. Ifindex
is non-negative, the child will be created at that index; otherwise, it’ll be appended.
- Parameter.createChildStringArray(name: str, size: int, index: int = -1) NodegraphAPI.Parameter ¶
Creates and returns a new string array parameter of the given
size
as a child of this group parameter. Ifindex
is non-negative, the child will be created at that index; otherwise, it’ll be appended.
- Parameter.createChildXmlIO(element: Geolib3::XmlIO::v1::Element, index: int = -1) NodegraphAPI.Parameter ¶
Creates a new child parameter from the given
XmlIO.Element
. Ifindex
is non-negative, the child will be created at that index; otherwise, it’ll be appended.
- Parameter.deleteChild(child: NodegraphAPI.Parameter) None ¶
Deletes the given
child
from this group parameter.
- Parameter.getChild(name: str) NodegraphAPI.Parameter ¶
Returns the group child by
name
, orNone
if not found.
- Parameter.getChildByIndex(index: int) NodegraphAPI.Parameter ¶
Returns the group child at the given
index
, orNone
ifindex
is out of range.
- Parameter.getChildren() list ¶
Returns a
list
of all children of this group parameter.
- Parameter.getNumChildren() int ¶
Returns the number of children of this parameter if it is a group parameter, otherwise
0
.
- Parameter.reorderChild(child: NodegraphAPI.Parameter, index: int) None ¶
Moves
child
to the givenindex
.
- Parameter.reorderChildren(oldIndex: int, newIndex: int, count: int) None ¶
Moves
count
children starting atoldIndex
tonewIndex
, retaining order. The source and destination ranges must not overlap.