Blocks into blocks

Hi,
I am trying to work with Blocks containing (sub) blocks
I can place them, but I can’t extract the attributes from the subblocks. Is there a way to do it with Dynamo? Can you reference a sub-block that is inside a block with Dynamo, and thus be able to extract its attributes? If not, do you know any alternative? Thank you

Like this?

Or perhaps this is even more simple…

2 Likes

Thanks for everything, but in my case it doesn’t work well for me. neither the first nor the second. Although perhaps the issue is that I generate multiple Block References with Blockreference.Create

Right after putting the post, I found another path that lies in the key node “Block.Object”.
From this if I get the list of content of an attribute (which is in several of the sub-blocks such as the ID)
Now I still have work with the handling of the lists, because this code is going to be repeated for each of the attributes and I have to put them together to export them to Excel …
Thanks for everything,

So is this your workflow?

  1. Create block references in model space using Dynamo

  2. Set attribute values in Civil 3D

  3. Extract attribute values in Dynamo, in the same graph as step 1

1 Like

Not exactly.

  1. I introduce the blocks with “BlockReference.Create”
  2. Yes, but: When I use only blocks with attributes, from Dynamo it is easy to change their content, with “Block.SetAttributeDefaultValueByTag”. The problem I have now is to change the value of the Attribute of a sub-block from Dynamo, but I think it is only a matter of managing lists and substituting values with conditions. Or maybe my life is not complicated and if you want to change an attribute value of the subblock that is done from the Civil itself.
  3. The extraction to Excel, with a block and attributes I have no problem. If I use a block of blocks with its sub-attributes, then with the second graphic that I have passed to you before, I think I can solve it with the handling of lists
    Excuse me, my english from google translator :slight_smile:

OK I understand. See the markup below.

No problem!

2 Likes

Yes. You’re right … But I have a major problem. This solution only gets me the list of ONE Block of Blocks … Remember that I put a multitude of those blocks with “BlockReference.Create” …
Maybe if I could remove with a node the number of references of a put block, and then multiply that final list * the number of References put would be the solution. Is there a node that will get you the number of references placed from a block? … I have not found it :frowning:

1 Like

Can you upload the DWG?

Sorry, here it won’t let me, it weighs 19 Mb.
Can you pass me your email if it is not annoying?

Here you go. This makes all of the attributes the same, so you’ll have to come up with a more complex list structure if you want them to vary individually.

Attributes.dyn (37.8 KB)

1 Like

Traducir por voz

volume_up

720 / 5000

Resultados de traducción

Thank you very much, but I see that it changes all the attributes with the same Name, when they are actually different blocks and different contents … Actually, this is not what worries me the most, because there is an alternative way to do it from the block editor in Civil What I do need to solve is the problem of the number of blocks actually entered in the project, because what I need is to remove all the attributes of all the blocks … I have gotten a little closer in the code … In fact, I do I do manual when creating the amount of inputs (items) of a list it works for me … But I need it to be automatic, because it could vary throughout a project. I attach the point where the Achilles heel is

I already found the solution. “List.Count” and “List.Repeat” were the nodes I needed. Then I also managed to separate into a list for each type of Block. Thanks for your support. You marked the way for me :slight_smile:

3 Likes