Count Named Objects List

Is there a script or anything that would count any objects that have an non-default(blank) assigned name, and create a list of them, kind of like the block manager does, but for non-blocked things?

You know, for making B)ills O)f Materials? : )

The numbers would usually be lower, what I am looking for is a way to keep track of singletons and such.
(Please excuse my retro windows 7 style.)

This is one of those little things that Rhino’s competitors wouldn’t want Rhino to have. Lol! : )

I am thinking that this could be incorporated into the block manager. For ha-ha’s I will mock it up.

It’s okay, I will use the standard windows scheme on it : )

Perhaps the object manager could be modified to be a one-stop place for getting not only a list of blocks, but any object with a name.

One advantage is, users will have a rudimentary part list, which is not so powerful that aftermarket solutions couldn’t co-exist with it, yet it would give the user a parts list that also includes single non-blocked objects.

Another advantage is we can sort by count, and see what we are using a lot of. I kept the original count button for a nested count.

I also added an Edit button, so we can select an object by name and edit it’s properties, or go directly into into blockedit.

I added the “Copy to Clipboard” and “Save As CSV,” which would come in handy for doing what I am doing.

I hope this hasn’t offended anyone, just saying that all : )

If I want a part list, the only alternative is to make every object a block.

So to be clear. You want to count the objects in Rhino by Object name and put them in a list?

Hi, jordy1989,

Yes, I have a lot of single objects, that I wish could get a list/export of, without resorting to turning them into blocks. I thought that any user named object could be put in a list. In other words, important enough to give a meaningful name.

(Sometimes, I just don’t want to lock up objects by blocking them, as it’s more difficult to change their materials, their layer, or their properties.)

[To the block manager’s credit, I can do a multiple select and get a list of multiple blocks in the pop-up, but that usefulness was not intuitively indicated.]

In the mock-up, the metaphor was a flat list, the kind you would want if you were buying parts–such as 609 fasteners! The problem with the hybrid flat/hierarchical list is, I cannot tell which objects are root objects, and which ones are made from others. The list only shows me one compartmentalized branch/twig of the tree of a project, and not an expanded tree, nor a list of all objects. You have to craw/drill-down the list exhaustively to learn what you have and need.

Until Rhino has both a full flat view and a tree view, I will not nest blocks, because it’s just not worth the trouble, and I will always create them on the default layer, and move them after they are made. If someone has told me to these things, it would have saved me a lot of work. In another thread, I cannot get anyone to care or understand that I don’t want a block definition to be linked to any layer, only the instances, which I want to move from layer to layer with abandon : )

Take Care,
Brenda

Brenda,

I agree it would be nice to have some reporting features in Rhino.

In your case, I would use SelName, which would report the count in the command line history, and then manually construct my BOM. That avoids having to block parts, but doesn’t give you a list for export. I like doing it that way because I can visually scan the selected parts and sometimes spot erroneous missing or extra parts, but it’s not particularly efficient.

Thank you, that’s should be handy for finding things, too.

It looks like I am going to turn every single part into a block so I can get a count. Sigh. Scuffs feet.

Hi Brenda0

_-SelName “Name”

Command line will report: “X objects added to the selection.”

-Pascal

Pascal, thank you, but I need, a spreadsheet-like list of all the parts, as above. Until we have a way to include non-block objects in the list, I will have to make everything a block, to add to my existing blocks.

I think the above dialogue would take a single programmer less than a week, with no change in the file format. Combined with the named leader plugin you made, and Rhino would be much improved for working with assemblies with multiple parts. I am actually surprised that this hasn’t done before. It would seem that that level of added functionality would not offend a BOM plugin vender.

By the way, I made an icon for your plugin : )

Brenda, you need to learn to write scripts- you can write this yourself in far less time. Also this, if it has not come up before -
http://wiki.mcneel.com/people/peterharris

-Pascal

Thank you, I have downloaded Peter’s tools.

I’ve done some programming, but perhaps building a dialogue, populating it, and saving out a comma-delimited text might be beyond my skill.

Respectfully I feel this seems functionally Rhino should come with. The only other basic plugins I needed for mechanical design were Boltgen and GearGen, which save a lot of time, and maybe should be included too. Just saying, that’s all : )

[I used a calculator to figure out integer links in a chain, but that is quite esoteric, and an example of something I would consider as a non-imperative.]

Peter’s tools are great, but the BOM cannot count objects, and ignores blocks.
Currently, AFAIK, the only way to get a parts inventory is to make everything including singletons a block.

Created a small plugin

There is 1 command. CountObjectNames. See if it it what you need. You can also copy the text / counts too clipboard.

CountObjectNames.rhp (18 KB)

1 Like

Thank you Jordy1989.

Your plugin does a good job counting non-block objects, however it doesn’t count blocks without names. I need comma-delimited copying, too.

I found a complication: A user cannot block edit an block to add a object name, as they exist outside the block. Sigh… This gives me a lot to think about. I would have to select everything, such as each of the 41 types of the 731 fasteners, hidden or not and give them a name.

I want is a one-stop list and count of all the objects in project, like the 2nd dialogue I mocked up, but perhaps with URLs and notes too. The URL and note fields in Rhino are great, and I have been using them for my own use, but I’d like to share that information with my friend in a spreadsheet.

Projects like Grasshopper are great, but I feel that a Rhino’s Reporting needs a little TLC. Data reporting isn’t sexy, but this is part of the process that turns envisioned dreams into reality.

Couple of questions what needs to be changed:

  • Copy split not a space but a comma,
  • Instead of only count objects also count block names
  • Have a status bar for Block’s

Why do you want to count blocks without names?
It’s possible to create a block and give it a name. But you can also give it a name after. Wich one do you use?
Do objects that are in blocks also need to be count?

A new sample CountObjectNames.rhp (20 KB)

Hi Jordy1989,

Firstly, thanks for working on this : )

Yes, a comma is perhaps the best delimiter for export/import, as names may have spaces.

Yes, originally, I wanted a count of blocks, but also non-block objects that have been given a name, as in the second screenshot above.

No, I do not need to count blocks nor objects without names. I feel that there should be a way that a user can exclude an object from count. (Although a count of unnamed objects might be good for showing progress.)

I think that the block name should be used or take precedence over the object name because the user may name the part for its purpose, but that part still has to be counted, and purchased or made. An object might be named “kids vanity” but its blockname still might be "Model 311 16-Inch White Sink."
BlockName > ObjectName

I think that all named-objects and block-names should be counted whether or not they live in blocks or not, BUT the same object or instance shouldn’t ever be counted twice, because it’s difficult to sort them out.

[This is a problem with the current block manager; it’s a forward tree that doesn’t show all root level objects. Those blocks made from other blocks need to be put in a reverse/inverse tree, making a dependency chart, such as:
– -- – super-widget
– -- widget-a
– -- widget-b

– -- widget-a
– angle
– boltshort
– washer
– nut

– -- widget-b
– bracket
– boltlong
– washer
– nut

BOM:
1 bracket
1 angle
1 boltshort
1 boltlong
2 nut
2 washer

Everything in the BOM has to be bought or made.]

I am going to try your new script-function : )

Thanks again,
Brenda

Hi Jordy1989,

I like the commas on copy : )
The first column rocks, exactly what I wanted. I tell at a glance if something is a block or not, or should be : )
I see that you have a link status too.

It’s not counting blocknames though.

The outside window is, but can the form be resizable?

Adding the URL and Description, and Note fields might help buyers and beancounters. It also pushes Rhino upstream in the design workflow, as a designer can find something they want, past the URL in, and hand a list to someone else.

I am kind of excited by this as I found that I couldn’t get even a rudimentary BOM if I nested blocks.

Thank you for working on it,
Brenda

Oke. I’m using the block’s type name not the normal name. I’ll change it a bit.

  • Use the right block name
  • Add URL
  • Add Description
  • Add Note
  • make it resizable

Btw do you want the URL description or the normal description?

2nd. something more for @stevebaer
How to get the name of a block
If I do

For Each Block As Rhino.DocObjects.InstanceDefinition In doc.InstanceDefinitions
     Dim name As String = Block.Name
Next

Then I get the name of the block when it is created but how do I get the name

Because with the above vb.net code I get “Block 01”
I’m now using

Block.GetReferences(1)(0).Attributes.Name

is that the right way?