spydrnet.Definition.add_child

Definition.add_child(instance, position=None)[source]

Add an existing instance to the definition.

This instance must not already be included in a definition. It add the instance as a child into the given position. Append to the end of the list if no position is given. It will set the parent of the instance to this definition.

Parameters:
  • instance - (Instance) the instance to add as a child of the definition

  • position - (int, default None) the index in the children list at which to add the instance.