This functionality is only available for certain module packages.

You are here: Reference > SCRIPTING > Methods for components > Operations on placeholders > Adding objects to placeholders > addToPlaceholderObjects(MechatronicObject mo, String placeholderName, int index)

addToPlaceholderObjects(MechatronicObject mo, String placeholderName, int index)

Places the mechatronic object mo on the placeholder with the name placeholderName on the index index in this mechatronic component.

addToPlaceholderObjects(MechatronicObject mo, String placeholderName, int index)
Argument MechatronicObject mo A mechatronic object to place.
String placeholderName The name of the placeholder of the component.
Integer index A valid index within the already existing objects on the placeholder
Return value
Exceptions Throws a PlaceholderNotExistingException, if no placeholder with the specified name exists.
Throws an IndexOutOfBoundsException if the specified index is out of bounds:
-1 < index < getPlaceholderObjects(placeholder).size().