# Blocks into blocks

**URL:** <https://forum.dynamobim.com/t/blocks-into-blocks/57491>\
**Category:** Civil 3D\
**Created:** [November 20, 2020, 3:06am UTC](https://forum.dynamobim.com/t/blocks-into-blocks/57491 "2020-11-20T03:06:59Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![ramallafre](https://avatars.discourse-cdn.com/v4/letter/r/4da419/32.png) [@ramallafre](https://forum.dynamobim.com/u/ramallafre)\
**Post date:** [November 20, 2020, 3:06am UTC](https://forum.dynamobim.com/t/blocks-into-blocks/57491/1 "2020-11-20T03:06:59Z")

</div>

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

 ![blocks_into_blocks](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/e/1/e1a779f6b7f10c7df0172b315ed676b3aba141be.jpeg)

---

<div class="post-metadata">

**Author:** ![mzjensen](https://avatars.discourse-cdn.com/v4/letter/m/b77776/32.png) [@mzjensen](https://forum.dynamobim.com/u/mzjensen)\
**Post date:** [November 20, 2020, 4:24am UTC](https://forum.dynamobim.com/t/blocks-into-blocks/57491/2 "2020-11-20T04:24:16Z")

</div>

Like this?

 ![NestedBlocks](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/2/b/2b0dee7de46e1eb55a0311a4ea6a32afe42d2172.png)

 ![Block](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/5/5/5512ed087d23382e4db7099993bc696354f3ff42.jpeg)

---

<div class="post-metadata">

**Author:** ![mzjensen](https://avatars.discourse-cdn.com/v4/letter/m/b77776/32.png) [@mzjensen](https://forum.dynamobim.com/u/mzjensen)\
**Post date:** [November 20, 2020, 4:55am UTC](https://forum.dynamobim.com/t/blocks-into-blocks/57491/3 "2020-11-20T04:55:06Z")

</div>

Or perhaps this is even more simple…

 ![NestedBlocks](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/5/c/5ce08784fdf2b35f03205f1c26ba9f5bf66be580.png)

---

<div class="post-metadata">

**Author:** ![ramallafre](https://avatars.discourse-cdn.com/v4/letter/r/4da419/32.png) [@ramallafre](https://forum.dynamobim.com/u/ramallafre)\
**Post date:** [November 20, 2020, 3:16pm UTC](https://forum.dynamobim.com/t/blocks-into-blocks/57491/4 "2020-11-20T15:16:22Z")

</div>

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

 ![cap01](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/4/d/4d19723dcf92eec9dafcea1c0934bc07dfcd0177.jpeg)

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,

 ![cap02](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/f/d/fdebb2b1fafb6b866d48dd1dfe7a1158478186a8.jpeg)

---

<div class="post-metadata">

**Author:** ![mzjensen](https://avatars.discourse-cdn.com/v4/letter/m/b77776/32.png) [@mzjensen](https://forum.dynamobim.com/u/mzjensen)\
**Post date:** [November 20, 2020, 3:27pm UTC](https://forum.dynamobim.com/t/blocks-into-blocks/57491/5 "2020-11-20T15:27:17Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![ramallafre](https://avatars.discourse-cdn.com/v4/letter/r/4da419/32.png) [@ramallafre](https://forum.dynamobim.com/u/ramallafre)\
**Post date:** [November 20, 2020, 4:09pm UTC](https://forum.dynamobim.com/t/blocks-into-blocks/57491/6 "2020-11-20T16:09:06Z")

</div>

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 🙂

---

<div class="post-metadata">

**Author:** ![mzjensen](https://avatars.discourse-cdn.com/v4/letter/m/b77776/32.png) [@mzjensen](https://forum.dynamobim.com/u/mzjensen)\
**Post date:** [November 20, 2020, 4:27pm UTC](https://forum.dynamobim.com/t/blocks-into-blocks/57491/7 "2020-11-20T16:27:25Z")

</div>

OK I understand. See the markup below.

> [@ramallafre](#):
>
> Excuse me, my english from google translator 🙂

No problem!

 ![Edits](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/2/2/22c604ff92345c767123f453d19c60e4c17b4809.jpeg)

---

<div class="post-metadata">

**Author:** ![ramallafre](https://avatars.discourse-cdn.com/v4/letter/r/4da419/32.png) [@ramallafre](https://forum.dynamobim.com/u/ramallafre)\
**Post date:** [November 20, 2020, 5:34pm UTC](https://forum.dynamobim.com/t/blocks-into-blocks/57491/8 "2020-11-20T17:34:10Z")

</div>

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 ☹

 ![cap3](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/f/1/f14f4ada7bf49b37272dd42b13a35b21027743b9.jpeg)

---

<div class="post-metadata">

**Author:** ![mzjensen](https://avatars.discourse-cdn.com/v4/letter/m/b77776/32.png) [@mzjensen](https://forum.dynamobim.com/u/mzjensen)\
**Post date:** [November 20, 2020, 5:59pm UTC](https://forum.dynamobim.com/t/blocks-into-blocks/57491/9 "2020-11-20T17:59:57Z")

</div>

Can you upload the DWG?

---

<div class="post-metadata">

**Author:** ![ramallafre](https://avatars.discourse-cdn.com/v4/letter/r/4da419/32.png) [@ramallafre](https://forum.dynamobim.com/u/ramallafre)\
**Post date:** [November 20, 2020, 9:00pm UTC](https://forum.dynamobim.com/t/blocks-into-blocks/57491/10 "2020-11-20T21:00:43Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![mzjensen](https://avatars.discourse-cdn.com/v4/letter/m/b77776/32.png) [@mzjensen](https://forum.dynamobim.com/u/mzjensen)\
**Post date:** [November 20, 2020, 9:41pm UTC](https://forum.dynamobim.com/t/blocks-into-blocks/57491/11 "2020-11-20T21:41:50Z")

</div>

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](https://forum.dynamobim.com/uploads/short-url/u0FLgjVSa3YOdteBca8sQMMz7n3.dyn) (37.8 KB)

![Attributes](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/7/2/728bd6a83958d14ea5a2542e5fc068758a7a9b61.gif)

---

<div class="post-metadata">

**Author:** ![ramallafre](https://avatars.discourse-cdn.com/v4/letter/r/4da419/32.png) [@ramallafre](https://forum.dynamobim.com/u/ramallafre)\
**Post date:** [November 20, 2020, 10:21pm UTC](https://forum.dynamobim.com/t/blocks-into-blocks/57491/12 "2020-11-20T22:21:50Z")

</div>

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

 ![ListCreate](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/3/d/3dc339424054299b2bc0c63cabe36ab8a4d2e417.jpeg)

---

<div class="post-metadata">

**Author:** ![ramallafre](https://avatars.discourse-cdn.com/v4/letter/r/4da419/32.png) [@ramallafre](https://forum.dynamobim.com/u/ramallafre)\
**Post date:** [November 21, 2020, 5:54am UTC](https://forum.dynamobim.com/t/blocks-into-blocks/57491/13 "2020-11-21T05:54:17Z")

</div>

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 🙂

 ![list of block separate](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/e/0/e06e8583ec358e3dfe30883ad032bbe69ff07767.jpeg)
