insertPart method

Part? insertPart(
  1. Point loc
)

Create a node by adding a copy of the #archetypeNodeData object to the diagram's model, assign its Part#location to be the given point, and select the new part.

This starts and commits a transaction and also raises the "PartCreated" DiagramEvent. The actual part that is added to the diagram may be a Part, a Node, or even a Group, depending on the properties of the #archetypeNodeData and the type of the template that is copied to create the part.

This method also raises the "ChangingSelection" and "ChangedSelection" diagram events outside the transaction.

This method may be overridden, although it is usually much easier to just set #archetypeNodeData. Please read the Introduction page on Extensions for how to override methods and how to call this base method. @expose @param {Point} loc a Point in document coordinates. @return {Part} the newly created Part, or null if it failed.

Implementation

_i3.Part? insertPart(_i3.Point loc) => _i4.callMethod(
      this,
      'insertPart',
      [loc],
    );