Uncaught TypeError: Cannot read property 'h' of un

hi,
i try to select multi nodes by a property (such as name)
and i get this error when it start to to do " myDiagram.select(part)" :
Uncaught TypeError: Cannot read property ‘h’ of undefined

my code is:

myDiagram.model.nodeDataArray.forEach(function(part) {

            if (part.Type == type) {
            part.isSelected = true;
            myDiagram.select(part);
            }

        });

i want that i can be able to select multi nodes and the moved them on the graph.

The data in the Model.nodeDataArray should be your app’s data, a regular JavaScript Object for each node, holding whatever properties that you like.

The GoJS Diagram will automatically create Nodes and Links. Those classes inherit from the Part class, which inherits from the GraphObject class and forms a visual tree of GraphObjects. Those objects have properties defined by GoJS, and they do not have app-specific properties. Part.isSelected is one such property. Diagram.select only accepts instances of Parts, not your model data.

So perhaps you want to do:
myDiagram.clearSelection();
myDiagram.model.nodeDataArray.forEach(function(data) {
    if (data.Type == type) {
var part = myDiagram.findPartForData(data);
 if (part !== null) part.isSelected = true;
    }
 });