# How to insert BlockReference from python

**URL:** <https://forum.dynamobim.com/t/how-to-insert-blockreference-from-python/65469>\
**Category:** Civil 3D\
**Created:** [June 23, 2021, 7:44pm UTC](https://forum.dynamobim.com/t/how-to-insert-blockreference-from-python/65469 "2021-06-23T19:44:55Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![WWentzler](https://avatars.discourse-cdn.com/v4/letter/w/8c91f0/32.png) [@WWentzler](https://forum.dynamobim.com/u/WWentzler)\
**Post date:** [June 23, 2021, 7:44pm UTC](https://forum.dynamobim.com/t/how-to-insert-blockreference-from-python/65469/1 "2021-06-23T19:44:55Z")

</div>

Is there a way to insert a block reference from python? Im able to add attribute tags or set dynamic properties to existing blocks easily, but cant seem to replace the BlockReference.ByCoordinateSystem() block with a line of python code. Anyone have a way?

Thanks in advance!

---

<div class="post-metadata">

**Author:** ![WWentzler](https://avatars.discourse-cdn.com/v4/letter/w/8c91f0/32.png) [@WWentzler](https://forum.dynamobim.com/u/WWentzler)\
**Post date:** [August 3, 2021, 11:18pm UTC](https://forum.dynamobim.com/t/how-to-insert-blockreference-from-python/65469/2 "2021-08-03T23:18:12Z")

</div>

Bump

---

<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:** [August 4, 2021, 3:20am UTC](https://forum.dynamobim.com/t/how-to-insert-blockreference-from-python/65469/3 "2021-08-04T03:20:43Z")

</div>

@WWentzler here’s a simple example:

```auto
import clr
clr.AddReference('AutoCADNodes')
from Autodesk.AutoCAD.DynamoNodes import *

sourceBlock = IN[0]
coordinateSystem = IN[1]
layer = IN[2]

OUT = BlockReference.ByCoordinateSystem(sourceBlock, coordinateSystem, layer, Document.Current.ModelSpace)

```

 ![Python](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/5/0/5009245c0f13e0666a26ca6b04336c975fb5758d.png)

---

<div class="post-metadata">

**Author:** ![WWentzler](https://avatars.discourse-cdn.com/v4/letter/w/8c91f0/32.png) [@WWentzler](https://forum.dynamobim.com/u/WWentzler)\
**Post date:** [August 4, 2021, 5:41pm UTC](https://forum.dynamobim.com/t/how-to-insert-blockreference-from-python/65469/4 "2021-08-04T17:41:00Z")

</div>

Huge thank you! I thought it should be this simple, but was missing the import …DynamoNodes … at the top. This makes things much better. Thanks!!
