(viewb))) {
          remove.push(d);
          if (model instanceof go.GraphLinksModel) {
            removeLinks.addAll(n.linksConnected);
          }
        }
      }
    }

    if (remove.length > 0) {
      const oldskips = diagram.skipsUndoManager;
      diagram.skipsUndoManager = true;
      model.removeNodeDataCollection(remove);
      if (model instanceof go.GraphLinksModel) {
        removeLinks.each((l) => {
          if (!l.isSelected) model.removeLinkData(l.data);
        });
      }
      dia