Count Named Objects 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?

Test the new one

  • Counting blocks

  • Count objects

  • Counts objects within blocks

  • If you click on a block it shows URL / Description/ Url Description

CountObjectNames.rhp (24 KB)

1 Like

You are looking at the definitions. What you want to do is look at the instance references. References use definitions + a transformation to display on the screen.

Use the object table on the document.

doc.Objects.GetObjectList(ObjectType.InstanceReference)

Hi Jordy,

The new version doesn’t come up on my file, which did before, but it does work with just a few objects. There are no error codes of any kind.

Can the URL and notes be included with the copy and perhaps in the table as well?

The resizing works.
The click on the URL to launch a browser should come in handy.
If the lower text boxes will remain both editable and read only, it might be confusing for some people.

Thank you (both now),
Brenda

Can you post a file with some block objects and normal objects so i can test it?
The not editable part can be handy. But can also make it that it will edit the objects.
Like if the URL is http://www.google.com and you want http://www.bing.com its posible xD

1 Like

I took the fasteners from my project, and added some other tests, such as: 100 differently named objects, a URL Test, a common punctuation test, and a nested-block test.

If you open the block manager, and look at the blocks named “A Block Level…” and try to get a count of nested parts you can see what could be clearer if you were trying to use the block manager to get a physical part count of what would needs to be purchased or made. I intentional prefixed the name with “A” so they would be all together, but in real life finding out what is real and what are blocks made only from real things would be quite a chore–without something like you are working on : )

I didn’t quite understand the last line in your post, so I will just liked it.
As with most non-MS employees, I prefer google.

Thanks again for working on this.Bolts.zip (997.4 KB)

I hope this helps, and thanks again,
brenda