How many components on canvas?

Is there any function to ‘count’ how many components are in your definition? either default or via plugin.

I have some mega-definitions (~1000 components), that are being rebuilt/optimised, and component number would be a really handy to metric, to help with QA/QC.

Metahopper ‘bottleneck navigator’ will list all components, but without a count.

Thanks!
Nick

Nothing in standard GH, unless you’re willing to examine the file and navigate the resulting treeview:

you can examine files by dropping them onto the magnifier glass icon which hides behind the page-curl when you drag gh files over the canvas.

What other metrics beyond component count would you consider informative?

2 Likes

Thanks! never used the File viewer before. Actually surprised to find my definition is 2220 components. (although that does include a fair few containers, used for neatness).

How does the file viewer treat clusters? I assume all components in all cluster instances are included?

In terms of other metrics. I suppose it depends on the purpose. At the moment i am focused on live interactive client tools, so file speed is the most important aspect, so they are responsive. Being able to cut 10 seconds to 6 seconds is a big win.

I use profiler, metahopper bottleneck nav to optimise. I also compare definition iterations by their total computed time. By hitting ‘recompute’ and recording the ‘solution completed in ~…’ from the bottom toolbar.

So I suppose if that kind of info was more readily available. Or maybe a live estimate of time to complete, based on the collective data illustrated by the profiler widget.

Thanks again!

Nope. Clusters are a single object.
And groups and other non-active objects like scribbles and jumps etc. all add to the count.

Yeah that makes sense. GH2 doesn’t have clusters yet, but that’ll always be tricky since clusters can contain other clusters. Reporting on that in a friendly manner will be a challenge.

Just a thought.
I use the Metahopper plugin with a ListLength then a Panel attached to it.
You have probably tried that, but I figured id give it a shot. I also may have miss understood your question.

1 Like

Thanks dude! this is what i needed. I had not properly dived into metahopper components.

It also separates Components from Parameters, which is not immediately obvious on file viewer.

Thanks David!

You can call this property for a native script solution:


230523_CanvasObjectCount_00.gh (8.5 KB)