# BlockReference.Create removes block attributes

**URL:** <https://forum.dynamobim.com/t/blockreference-create-removes-block-attributes/44306>\
**Category:** Civil 3D\
**Created:** [December 10, 2019, 5:43pm UTC](https://forum.dynamobim.com/t/blockreference-create-removes-block-attributes/44306 "2019-12-10T17:43:49Z")\
**Posts on this page:** 16\
**Page:** 1

<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:** [December 10, 2019, 5:43pm UTC](https://forum.dynamobim.com/t/blockreference-create-removes-block-attributes/44306/1 "2019-12-10T17:43:49Z")

</div>

I have a simple block containing a circle and an attribute definition. When trying to place block references at x,y coordinates specified in an Excel file, the inserted block references are stripped of the attribute. Has anyone else had this issue?

When checking the Document.BlockByName node to see if it has attributes, the Block.HasAttributeDefinitions node returns “true”. Doing the same check on the BlockReference.Create node returns “false”.

 ![Block Issue](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/e/f/ef0dd92829eb1fbe7475c0c7963bbe9f27e88a55.png)

---

<div class="post-metadata">

**Author:** ![Paolo\_Emilio\_Serra1](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/paolo_emilio_serra1/32/12902_2.png) [@Paolo\_Emilio\_Serra1](https://forum.dynamobim.com/u/Paolo_Emilio_Serra1)\
**Post date:** [December 10, 2019, 5:49pm UTC](https://forum.dynamobim.com/t/blockreference-create-removes-block-attributes/44306/2 "2019-12-10T17:49:42Z")

</div>

@zachri.jensen please use the other node BlockReference.ByCoordinateSystem, does it make any difference?

---

<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:** [December 10, 2019, 6:59pm UTC](https://forum.dynamobim.com/t/blockreference-create-removes-block-attributes/44306/3 "2019-12-10T18:59:30Z")

</div>

Hi @Paolo_Emilio_Serra1, thanks for the quick reply. I tried using the CoordinateSystem.ByOrigin node instead of Point.ByCoordinates and then feeding that into BlockReference.ByCoordinateSystem. I got the same result - the block references have no attributes.

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

---

<div class="post-metadata">

**Author:** ![olsen](https://avatars.discourse-cdn.com/v4/letter/o/4af34b/32.png) [@olsen](https://forum.dynamobim.com/u/olsen)\
**Post date:** [December 16, 2019, 4:00pm UTC](https://forum.dynamobim.com/t/blockreference-create-removes-block-attributes/44306/4 "2019-12-16T16:00:02Z")

</div>

Have the same problem!

---

<div class="post-metadata">

**Author:** ![Paolo\_Emilio\_Serra1](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/paolo_emilio_serra1/32/12902_2.png) [@Paolo\_Emilio\_Serra1](https://forum.dynamobim.com/u/Paolo_Emilio_Serra1)\
**Post date:** [December 16, 2019, 8:30pm UTC](https://forum.dynamobim.com/t/blockreference-create-removes-block-attributes/44306/5 "2019-12-16T20:30:30Z")

</div>

@zachri.jensen @olsen Could you please share the Block Reference? also can you confirm that if you insert the block references manually the attributes are still there?

---

<div class="post-metadata">

**Author:** ![olsen](https://avatars.discourse-cdn.com/v4/letter/o/4af34b/32.png) [@olsen](https://forum.dynamobim.com/u/olsen)\
**Post date:** [December 17, 2019, 8:44am UTC](https://forum.dynamobim.com/t/blockreference-create-removes-block-attributes/44306/6 "2019-12-17T08:44:07Z")

</div>

I believe you got the files from my coworker. For others who may be intereseted, here are some screenshots showing my problem.

I was hoping this script would create my “ID-blokk” at 0,0,0, with the ID-attribute set to 44. However, it looses the attribute all together.

 ![sc3](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/7/3/73eb4e6b47e702b49e44dbe203e9a11ae0e1f282.jpeg)

---

<div class="post-metadata">

**Author:** ![olsen](https://avatars.discourse-cdn.com/v4/letter/o/4af34b/32.png) [@olsen](https://forum.dynamobim.com/u/olsen)\
**Post date:** [December 17, 2019, 8:48am UTC](https://forum.dynamobim.com/t/blockreference-create-removes-block-attributes/44306/7 "2019-12-17T08:48:34Z")

</div>

This block was inserted the normal way, as you can see it has the attribute “ID” set to 999

 ![sc1](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/3/3/337e4347105ce14cdb608e7ca5ec0db4ea58ad33.jpeg)

---

<div class="post-metadata">

**Author:** ![olsen](https://avatars.discourse-cdn.com/v4/letter/o/4af34b/32.png) [@olsen](https://forum.dynamobim.com/u/olsen)\
**Post date:** [December 17, 2019, 8:49am UTC](https://forum.dynamobim.com/t/blockreference-create-removes-block-attributes/44306/8 "2019-12-17T08:49:31Z")

</div>

This is the block that lost its attribute “ID”, placed in 0,0,0 by Dynamo

 ![sc2](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/c/9/c96f311dc4769c659551e2239bfa066f6807d714.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:** [December 17, 2019, 3:15pm UTC](https://forum.dynamobim.com/t/blockreference-create-removes-block-attributes/44306/9 "2019-12-17T15:15:13Z")

</div>

The block that I was using was basically identical to the example posted by @olsen and I was experiencing the same results.

---

<div class="post-metadata">

**Author:** ![Paolo\_Emilio\_Serra1](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/paolo_emilio_serra1/32/12902_2.png) [@Paolo\_Emilio\_Serra1](https://forum.dynamobim.com/u/Paolo_Emilio_Serra1)\
**Post date:** [December 20, 2019, 9:19pm UTC](https://forum.dynamobim.com/t/blockreference-create-removes-block-attributes/44306/10 "2019-12-20T21:19:56Z")

</div>

@zachri.jensen @olsen I had the chance to test it and yes, when you create the block reference you initially have the result of BlockReference.HasAttribute() equal to false, but as soon as you set the value everything works as expected and if you test the BlockReferences again they return true.

 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/0/b/0b3f0bdec0cc5de13e95ae596dc32d17c236d5a4.png)

 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/7/6/7681711c094f8656944bca2a9a9ad56a7f7ddade.png)

---

<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:** [December 23, 2019, 6:52pm UTC](https://forum.dynamobim.com/t/blockreference-create-removes-block-attributes/44306/11 "2019-12-23T18:52:38Z")

</div>

Thanks @Paolo_Emilio_Serra1. So what I’m seeing is that you either need to set attributes in Dynamo or run ATTSYNC after they’ve been placed. Is that correct? My original goal was to use Dynamo only for the initial placement of blocks in model space, and then set individual attributes values afterwards. But it looks like Dynamo will not insert a block while also setting the default value for an attribute.

---

<div class="post-metadata">

**Author:** ![olsen](https://avatars.discourse-cdn.com/v4/letter/o/4af34b/32.png) [@olsen](https://forum.dynamobim.com/u/olsen)\
**Post date:** [December 29, 2019, 11:32am UTC](https://forum.dynamobim.com/t/blockreference-create-removes-block-attributes/44306/12 "2019-12-29T11:32:35Z")

</div>

I guess you can always set the default value in dynamo though?

---

<div class="post-metadata">

**Author:** ![palporkolab](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/palporkolab/32/94014_2.png) [@palporkolab](https://forum.dynamobim.com/u/palporkolab)\
**Post date:** [January 2, 2020, 8:17pm UTC](https://forum.dynamobim.com/t/blockreference-create-removes-block-attributes/44306/13 "2020-01-02T20:17:10Z")

</div>

Hi Paolo,  
I am struggling with the similar issue although I’ve got some problem with the tag definition. I thought this can be a simple string, but it is somehow not taking. Can you please share how did you define the tag field?

 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/6/8/68895cdeeadb6c82017fd47b6eca16c73f7c3691.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 17, 2020, 1:57pm UTC](https://forum.dynamobim.com/t/blockreference-create-removes-block-attributes/44306/14 "2020-11-17T13:57:39Z")

</div>

Prueba cambiando esto. A mi me funciono …

 ![Prueba esto](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/0/2/02b45651ff28c095778466cb56fb9f9a3f91f414.jpeg)

---

<div class="post-metadata">

**Author:** ![e.winter](https://avatars.discourse-cdn.com/v4/letter/e/d26b3c/32.png) [@e.winter](https://forum.dynamobim.com/u/e.winter)\
**Post date:** [February 6, 2021, 10:07am UTC](https://forum.dynamobim.com/t/blockreference-create-removes-block-attributes/44306/15 "2021-02-06T10:07:47Z")

</div>

Hi palporkolab,

Did you resolve the issue with setting (read defining) attributes to a Block(reference)?  
I too have this issue.  
Regards,

Edward

---

<div class="post-metadata">

**Author:** ![EiPM\_XaviColl](https://avatars.discourse-cdn.com/v4/letter/e/53a042/32.png) [@EiPM\_XaviColl](https://forum.dynamobim.com/u/EiPM_XaviColl)\
**Post date:** [September 17, 2021, 7:50am UTC](https://forum.dynamobim.com/t/blockreference-create-removes-block-attributes/44306/16 "2021-09-17T07:50:36Z")

</div>

Hi @palporkolab  
Did you solved your issue?  
thanks!
