# Area Boundaries From Room Boundaries

**URL:** <https://forum.dynamobim.com/t/area-boundaries-from-room-boundaries/44756>\
**Category:** Revit\
**Created:** [December 20, 2019, 11:13pm UTC](https://forum.dynamobim.com/t/area-boundaries-from-room-boundaries/44756 "2019-12-20T23:13:05Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![rstewart](https://avatars.discourse-cdn.com/v4/letter/r/2acd7d/32.png) [@rstewart](https://forum.dynamobim.com/u/rstewart)\
**Post date:** [December 20, 2019, 11:13pm UTC](https://forum.dynamobim.com/t/area-boundaries-from-room-boundaries/44756/1 "2019-12-20T23:13:05Z")

</div>

I’ve found an Autodesk University article about automating occupancy calculations for code analysis. Part of the process requires a dynamo script labeled “Area Boundaries\_From Room Boundaries”. I’ve recreated the script from the reference info but continue to experience an error. Is anyone familiar with this particular script or know how to troubleshoot this one. I’ve attached a screenshot from the article showing the script. Thank you!

Original Handout can be found [here](https://www.autodesk.com/autodesk-university/class/Automating-Occupancy-Smarter-Way-2018#handout):

 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/7/9/79ba5192d9e89ebb3359b70c51fec4887eac46cc.png)

---

<div class="post-metadata">

**Author:** ![jacob.small](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/jacob.small/32/161030_2.png) [@jacob.small](https://forum.dynamobim.com/u/jacob.small)\
**Post date:** [December 21, 2019, 4:26am UTC](https://forum.dynamobim.com/t/area-boundaries-from-room-boundaries/44756/2 "2019-12-21T04:26:10Z")

</div>

What is the error, and which node is throwing it?

---

<div class="post-metadata">

**Author:** ![SeanP](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/seanp/32/42560_2.png) [@SeanP](https://forum.dynamobim.com/u/SeanP)\
**Post date:** [December 22, 2019, 3:17am UTC](https://forum.dynamobim.com/t/area-boundaries-from-room-boundaries/44756/3 "2019-12-22T03:17:57Z")

</div>

Check your levels and lacing to make sure the rooms curves are being read correctly for the Area creation node.

---

<div class="post-metadata">

**Author:** ![rstewart](https://avatars.discourse-cdn.com/v4/letter/r/2acd7d/32.png) [@rstewart](https://forum.dynamobim.com/u/rstewart)\
**Post date:** [December 23, 2019, 3:49pm UTC](https://forum.dynamobim.com/t/area-boundaries-from-room-boundaries/44756/4 "2019-12-23T15:49:37Z")

</div>

The errors occur along the Area Plan View group. Please see attachment. The first error is located at the Element.Name node and replies “Warning: Internal error, please report: Dereferencing a non-pointer.”. The second error is located at the List.FirstItem node and replies “Warning: List.FirstItem operation failed. Index was out of range. Must be non-negative and less than the size of the collection.Parameter name: index”. Thank you for your time and replies!

 ![Errors](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/8/a/8ac33c8bad889ddf7aa346f9f51f33f889481043.jpeg)

---

<div class="post-metadata">

**Author:** ![jacob.small](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/jacob.small/32/161030_2.png) [@jacob.small](https://forum.dynamobim.com/u/jacob.small)\
**Post date:** [December 24, 2019, 12:59am UTC](https://forum.dynamobim.com/t/area-boundaries-from-room-boundaries/44756/5 "2019-12-24T00:59:57Z")

</div>

Have you cleaned up unplaced rooms in your model prior to running the graph? If not you may want to filter out rooms with an area which is not greater than 0 to see if this prevents the issue.

---

<div class="post-metadata">

**Author:** ![rstewart](https://avatars.discourse-cdn.com/v4/letter/r/2acd7d/32.png) [@rstewart](https://forum.dynamobim.com/u/rstewart)\
**Post date:** [December 26, 2019, 3:06pm UTC](https://forum.dynamobim.com/t/area-boundaries-from-room-boundaries/44756/6 "2019-12-26T15:06:07Z")

</div>

There do not appear to be any unplaced rooms. I’ve noticed that after running the graph, the area boundaries graphically appear. They are, however, unable to be selected or to define an area. This occurs only while Dynamo is up and running. It’s almost like the graph is correctly generating the area boundary curves but unable to terminate. This graph was created verbatim from a an Autodesk University course about 2 years ago. I’m sure updates to Dynamo since then have caused the issue. I welcome other suggestions, thank you!

---

<div class="post-metadata">

**Author:** ![jacob.small](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/jacob.small/32/161030_2.png) [@jacob.small](https://forum.dynamobim.com/u/jacob.small)\
**Post date:** [December 27, 2019, 5:49am UTC](https://forum.dynamobim.com/t/area-boundaries-from-room-boundaries/44756/7 "2019-12-27T05:49:42Z")

</div>

> [@rstewart](#):
>
> They are, however, unable to be selected or to define an area. This occurs only while Dynamo is up and running.

This is likely the background preview of the room geometry.

Please check the object types from the Element.Level bode with an Object.Type node. Then use a List.UniqueItems node so we can confirm there are no nulls (typically from unplaced rooms).

---

<div class="post-metadata">

**Author:** ![rstewart](https://avatars.discourse-cdn.com/v4/letter/r/2acd7d/32.png) [@rstewart](https://forum.dynamobim.com/u/rstewart)\
**Post date:** [December 27, 2019, 3:15pm UTC](https://forum.dynamobim.com/t/area-boundaries-from-room-boundaries/44756/8 "2019-12-27T15:15:46Z")

</div>

When I connect the Object.Type node to the Element.Level custom node I get a “null” result. I get the same “null” result when I attach the List.UniqueItems node to the Element.Level; should I connect this node elsewhere? According to my room schedule, I shouldn’t have any unplaced rooms in either phase. Thank you!

---

<div class="post-metadata">

**Author:** ![jacob.small](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/jacob.small/32/161030_2.png) [@jacob.small](https://forum.dynamobim.com/u/jacob.small)\
**Post date:** [December 27, 2019, 4:45pm UTC](https://forum.dynamobim.com/t/area-boundaries-from-room-boundaries/44756/9 "2019-12-27T16:45:40Z")

</div>

Is the issue in the lower or upper set of nodes? Element.GetParameterValueByName should allow you to pull the level value from the views of the Clockwork node is acting up there. You may also need a different version of the Clockwork package for your Revit and/or Dynamo version.

---

<div class="post-metadata">

**Author:** ![rstewart](https://avatars.discourse-cdn.com/v4/letter/r/2acd7d/32.png) [@rstewart](https://forum.dynamobim.com/u/rstewart)\
**Post date:** [December 27, 2019, 4:58pm UTC](https://forum.dynamobim.com/t/area-boundaries-from-room-boundaries/44756/10 "2019-12-27T16:58:16Z")

</div>

The issue is in the lower nodes and look to occur between All Elements of Category and Element.Level. Element.Level gives a “null” result. I’ll try an older version of Clockwork and let you know if I have any luck.

---

<div class="post-metadata">

**Author:** ![rstewart](https://avatars.discourse-cdn.com/v4/letter/r/2acd7d/32.png) [@rstewart](https://forum.dynamobim.com/u/rstewart)\
**Post date:** [December 27, 2019, 5:12pm UTC](https://forum.dynamobim.com/t/area-boundaries-from-room-boundaries/44756/11 "2019-12-27T17:12:16Z")

</div>

The 2.1.0 version of Clockwork which had a date around August 2018 worked for me. The difference appears to be in the Python Script within the Element.Level node. The node worked fine for the rooms category but not for views. Thank you for your help!
