Count Named Objects List

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

Haha oke thats clear.

I mean with the last line uhm…

You now have google.nl as URL, its possible to change the objects URL in the plugin Form if you want.

I knew you were from the Netherlands, but I forgot that the top level domain for Google would be different.

I can make an icon for this, sometime after I sleep.

I’ve just checked the file and its hard too count this.

As in the image below. You sometimes use Type (blocks) and sometimes Name
Too get the current version too work all block’s should have a name. And there isnt any atm.

It’s easier to have all objects/blocks names instead of sometimes Type and other times Name.

Hi,

All the fasteners are block instances.
When anyone creates a block, and names it, it appears as the Type.
The rest of the objects, I just gave a name.

I am sorry if you are having issues,
Brenda

I am going to necromancer this.

Jordy1989, I appreciate your work on this.

Still, Rhino should have some kind of object count. That seems reasonable does it not?
For this project, I have to make everything into a block and avoid nesting anything to have a part count. : (

2 Likes

Brenda, did you ever get to a good solution for this? I have bemoaned the lack of this functionality as standard Rhino for years. Found your comments on my umpteenth search for a solution.

I posted on one of the most popular threads in this forum, adding input from some of the dozens of people who replied. Most stated that they agreed with the changes I/we asked for in the block manager. I tried.

49 replies
6.7k views
18 users
35 likes
10 links