Blocks missing in List Blocks in Document

Hi!

I am using List Blocks in Document to find all the blocks in a document which is made by others and then filter them.
But there are blocks that can’t be found every time I newly open the 3dm file.
I found a workaround which is to click every blocks and then use Blockedit the click ok directly.
Then I go back to List Blocks in Document to update the blocks.
This way it will suddenly find the missing blocks.

This is beyond my capability and can’t seem to find any solution online.
Does anyone know the possible solutions or the reasons behind it?

PS. I am using the latest version.

Thanks in advance!!!

`

Do you have an example you can share?

Are any of the missing blocks nested blocks within other block definitions?

Are the missing blocks missing from the output of the “List Blocks In Document” component from Elefront or missing from some other place you are viewing them?

Does the equivalent legacy component work or give you the same unexpected results?

On my end it returns all blocks as expected regardless of file opening/closing.

Thank you for the reply!

I found out that indeed there’s no problem with List Blocks in Document. That’s my bad sorry.

The problem I am facing right now is actually with insert blocks. I am trying to use some conditions to filter out what I want.
There are some missing blocks nested blocks within other blocks.
But it seems not all of them are like that.

The filtering is good, but insert blocks can’t seem to function as I expected.
The file that I am using is from Wikihouse. Because it’s a bit too big.
So I will post a link to the official website of Wikihouse.
And Grasshopper file is my thought of getting out what I want.

Example.gh (69.4 KB)

Thanks in advance!!

I don’t have time to look at the wikihouse files at the moment but try something along these lines:

Exploding the Parent block, returning only blocks from the exploded results, and then getting the names of those nested blocks and filtering as desired.

Hope that helps!

Thank you so much for your time.
I get that the file is too much.

I have another problem that on my end, the list block only outputs only text.
So I must do the insert blocks first to get the blocks to be handled later on.

But the insert blocks has problem outputting blocks.
Is it possible that there are too many blocks?
I would like to filter out those nested blocks definitions and leave only the parent blocks.

Really appreciate it!!

How about this?

I’ve simplified your code to allow you to create an initial data tree based on your search input keywords.

This is better than repeating the same nodes multiple times and will save computation time as well.

You can return the specific blocks at the highest level by selecting the “Category” and then subsequently return the nested blocks after that if desired.

I think the node you were looking for is “Reference Blocks By Name” this will return the geometry without having to insert a new block instance, of course if you are trying to Insert a new block elsewhere, you can always use the Insert Block node.

Hope this helps, if not let me know more specifically what you are after and I’m happy to help take a look when I can.

Thanks!

20230530_Example_Response_01a.gh (73.2 KB)

Thanks a lot, Michael!!
I tried your suggestion and it worked pretty well and it is neat!!
That does help me solve my issue of failure to insert blocks. :grin:

However, I do have some small questions left.

  1. It is somehow not clear to me how to select “Category” and find the highest level. And I am really curious why Reference Blocks By Name can filter out only the parent blocks.
    PS. I noticed that in the previous version of Reference Blocks By Name, there is an option for top-level when right-clicking. Is it something like that?

  2. There is an error message popped up with Reference Blocks By Name with only one group of blocks. But I can’t really understand what this message was trying to say.
    It was supposed to select 4 of them but ended up with only 1 being selected.

Solution exception:eleFront could not complete the operation because of an invalid object. The error message from Rhino is: Brep: brep.m_L[265] loop is not valid.
loop.m_type = 0 (must be 1=outer, 2=inner, or 3=slit)
brep.m_F[265] face is not valid.
brep.m_L[face.m_li[0]=265] is not valid.
ON_Brep.m_F[265] is invalid.

Thank you again for your efforts and help:grinning:.
Really appreciate it.

Hello,

  1. Since I am creating a data tree with each search keyword defining a unique branch, the value list I’m referring to as a category selector is simply mapping a the search key words to a specific integer number which is being used as a path to select the corresponding branch of said “category”. This is working at the highest level because it is comparing the search query against a list of unexploded blocks, meaning, the overall block name is what’s being looked at, if you exploded all blocks and ran the exact same logic it would be at the next level down (from original), so on and so forth. So if a block was named “Myblock_Parent” and it had a nested block inside it called “Myblock_Test” and you search “myblock” it will only search at the parent level unless you explode it all. I think the new Rhino 8 node called "“Query Block Instances” would let you search at all levels of depth but Id have to check when I’m at my computer again.

  2. I am not entirely sure myself, but I believe that it is saying that Brep at index 265 (in a list of ALL breps that make up the geometry of your bocks) is invalid, null, or has some other issue with the geometry and therefore won’t select it.

I would use the list item component with an input of a flattened list of all the geometry and then plug in an index value of 265 and see if you can highlight the problemed brep and take a look at what looks odd about it.

Hope this helps for now!