findNodesByExample has no effect on go.Part

I want to search all the “PRINTBOX” in the drawing,So I used findNodesByExample :

              g_(go.Part, "Viewbox",......)
   myDiagram.findNodesByExample({ category: "PRINTBOX" });

However, this method does not support go.Part.

That’s true, it was designed to only work for Nodes, and Diagram.findLinksByExample only for Links.

Maybe you want to do something like this:

    .filter(function(d) { return d.category === "PRINTBOX"; })
    .map(function(d) { return myDiagram.findPartForData(d); })

@walter I have tried for the node part as well it’s not showing the changes
I dont know where i m doing this wrong… beta node is not toggled!
$(go.Node,“Auto”, // the Shape will go around the TextBlock
{ strokeWidth: 0 },
// Shape.fill is bound to
new go.Binding(“fill”, “color”)
{ margin: 8 }, // some room around the text
// TextBlock.text is bound to
new go.Binding(“text”, “key”)

document.getElementById("beta").addEventListener("change", function(e) {
  var alpha = myDiagram.findNodesByExample({category:"Pen"});
  myDiagram.startTransaction("toggle visibility");
  alpha.visible =;
  myDiagram.commitTransaction("toggle visibility");

findNodesByExample always returns a collection of Nodes, not a single Node.

function(e) {
  myDiagram.commit(function(d) {
      d.findNodesByExample({ category: "Pen" })
          .each(function(n) { n.visible =; });
    }, "toggled visibility of Pens");