How to count number of objects selected?


#1

Hi,
selected a load of same size rivets, need to know how many selected.
look in details, doesnt tell me.

How can I count them ?

If they are block instances, will method work or must I explode them to count them ?

Cheers

Steve


#2

Press Esc key to exit current command, then use SelPrev command.
No, do not explode block instances to count them.
If you want to count rivets inside blocks, you must count them separately.


#3

Hi,
as to where the number selected appears, I see it at top row of Properties.

Steve


#4

One way to do it is once you have selected your objects, hit Invert - twice, then look at the command line. Just beware that if you have many thousands of objects that it may take a bit of time.

Looking in Properties will not be very useful if you have more than one object type.

–Mitch


#5

it’s in the command history… on mac, that’s at the bottom-left as well as in the right side inspectors… not sure where this feedback shows up on windows but i’m guessing it’s there somewhere.


edit- oh, i suppose you might be selecting them individual or in multiple batches (shift-selecting)… in which case, the history will only show the number of the last actual selection set.


#6

Are the rivets in question on their own layer?


(Pascal Golay) #7

I like the Invert twice trick, makes my day (simple pleasures for simple minds, I know, I know). For layers, I guess there is no nice trick, is there? especially since objects can be hidden. Anyway, @Steve1, in case it helps, here’s a quick plug-in for LayerObjects & SelectedObjects (less useful perhaps)

ObjectCount.rhp (11.5 KB)

-Pascal


#8

If you gave the rivets a Name, you could use SelName. As Pascal cautioned with his suggestions, this one also falls down if you’ve hidden any of them.


(Pascal Golay) #9

The quick way is to pop up the list at the lower right of the Rhino window - it gives a count of the selected objects as the first item.

-Pascal


#10

I use Pascal’s How Many script for this, the version he doctored up for me here: Info on the sum total of parts and types of objects

Works great!

I also commonly use a unique color for each type of object I may need to count at some point, then use SelColor to select them all and just look at the status line to see the feedback. I mix this with layer sorting so I can do two-factor sorts, for instance if all the brass screws are on one layer and all the steel on another and each length is its own color, than I can get just the 6mm brass screws by turning off the steel layer and then SelColor for the 6mm length.

Of course it the objects are blocked you can call up Block Manager and get a count from there.


#11

Looks quick and easy.

Rivets were on two different layers, but in the case promting this, those on the one layer would suffice.

Steve


#12

High quantity items like rivets are always best as block entities. Create the one rivet, block it, copy it or nest it in other blocks as necessary. When you need to count, use block manager’s Count function, it will tell you exactly how many instances of that rivet are currently in your model.


#13

OK, late to the party BUT - why not a column we could add to the layers display that lists number of objects in a column?

Sometimes I am not that perfect when creating an object using lines + and wish to know that the final object [usually a solid] is the only thing on the layer. I know I could “select…lines…curves…” but I would like to know when there are many many layers, it would be so easy to look at the column count number to verify. I could look over all my final layers in seconds versus minutes or more.

A suggestion that others may not wish for - I go with the flow…for or against…

Sorry if this has been discussed elsewhere - I searched, looked and only found this topic. Thought best to continue here.


(Pascal Golay) #14

Hi Clark - if you deselect and then click on the layer in the layer panel, right-click and choose ‘Select objects’ the number will be printed on the command line. There is also an item in the menu that cycles through at the very right end of the status bar to show you what the current selection is - right-click on that pane and check ‘Selected object count’ to have it always show up.

Any of that help?

-Pascal


#15

Yes & No. That is what I have been doing - but the steps when I might
have fifty layers is:

  1. Make sure nothing is selected
  2. Right Click Layer
  3. Select menu item “select objects”
  4. look at the menu bar to see how many
  5. deselect to be positive and restart on another layer

So the minimum step for fifty layers is 200 to 250 steps when I know I
should have “x” number per layer based on the drawn layer “function
name” - separated by machine steps. Such as “crankshaft”, “blower”,
“blower vanes [2]”…all fictitious items but true to my scheme of
things.

It would also be nice to see what layers may be /empty/ without doing a
purge. Sometimes a construction steps sequence is later redefined and
objects change - so it would be nice to know what objects moved from/to
or were deprecated/deleted. A fast way to be able to rename a layer to a
master name and move its hierarchy without having to check the layer for
objects.

If there was a column that I could just show to see the objects per
layer I could at least look over 30 to 40 layers without using the
associated 120 to 160 steps.

It may be me, and perhaps it is my method that is at fault.

Again, I may be the exception so whatever prevails I will submit to.
Great program, great forum - you have a posted a good many scripts I am
using and I thank you for your time and patience, you are a great asset
to everyone and I will assume you to be a generally all-around good
person at heart cause it comes through in your writing style - please
ignore mine :slight_smile:

Does anything I have written make sense or strick a cord with you?
Besides my writing style that is…

Thanks

Jimmy AKA Clark


#16

There is a filter for this in the layer manager - hit the filter icon (funnel) to see what can be filtered. --Mitch


#17

Agreed - I have used this also, but steps, steps, steps when visual
would be nice and fast.

There are times - in my files - that I have a lot of info in layers,
some I need to rename or reorganize to a new master layer - then rebuild
the layers under it by either moving or creating new ones and moving
objects to fit the scheme. In those cases, simply after reassigning
objects to the new schema, along with some layer moves and renames - it
would be nice to see the empties so I no longer need to check them for
objects to move because I see they are empty without having to filter or
purge. Because once I do either one of those, I need to do it thirty
more times as and after objects are reassigned or moved. That is what I
was getting at. Knowing - visually - would be a great benefit and a lot
less steps for /me/ but perhaps not others if I am the sole one doing
this [may be me - poor CAD method?].

FYI - I just noticed my email may be misinterpreted. I created it as a
shortcut for “forumrhino@” and not some other “frhino@” and I will be
changing that as soon as I finish this current project. I never noticed
until the two of you sent me personal mail. As stated - NOT my intent at
all and I was a little taken back when I received mail at it and
realized what it could be seen to be :frowning:

Again, I yield. I am attempting to also learn Grasshopper too. I can
state Rhino exceeds my expectations, there is always and should always
be ways to improve Rhino, but I am a very happy camper as is - even if
I have to trudge through my method.

As I wrote to Pascal - you are another great contributor and I
appreciate your activity in the forum. I learn a lot from both of you
[and a few others] but you two are top of the list. Espe3cially like all
the little down and dirty scripts. I sure wish those were incorporated
directly into Rhino and would have to ask why not - but ok, some day.

Thanks again

Jimmy AKA Clark


(Wim Dekeyser) #18

Just a follow-up on this one: I see that you are replying from your eMail account and I suppose that you might be thinking that you are receiving personal mail - and sending personal mail. I guess your settings on the Rhino Discourse are such that public posts that are replies to you or mention you will be copied and sent by eMail to you. We don’t see your eMail address…


#19

Yeah - I go that, guess I was too deep in my project. Still bothered me
so I changed it.

As to the stated comments by myself - still stand.

Thanks again.


(Pascal Golay) #20

Hi Clark - the basic wish here is for a new column in Layers showing the total number of objects on each layer, correct?

-Pascal