This functionality is only available for certain module packages.

You are here: Reference > SCRIPTING > Methods for components > Manipulating the object model > instantiate(instantiationTarget, MechatronicObjectClass classToInstantiate, String instanceName, boolean instantiateExtensions)

instantiate(instantiationTarget, MechatronicObjectClass classToInstantiate, String instanceName, boolean instantiateExtensions)

Instantiates the classToInstantiate with the given instanceName on the specified instantiationTarget. By means of the boolean argument instantiateExtensions can be controlled, whether it is possible to instantiate objects on the contained extension point. The instantiation takes place on the first from the rear fitting placeholder. If no fitting placeholder is determined, a NoMatchingPlaceholderException is thrown.

instantiate(instantiationTarget, MechatronicObjectClass classToInstantiate, String instanceName, boolean instantiateExtensions) throws NoMatchingPlaceholderException
Argument instantiationTarget A mechatronic component or mechatronic root, under which the new object is placed
MechatronicObjectClass classToInstantiate The class to instantiate
String instanceName The name of the object. If null is returned, the object gets the name of the class.
Boolean instantiateExtensions If the return value is true, internal extension points are calculated while instantiation, if the return value is false no calculation is done.
Return value Component The instantiated object