# Built in Parameter Python Script

**URL:** <https://forum.dynamobim.com/t/built-in-parameter-python-script/9047>\
**Category:** Developers\
**Tags:** designscript, python\
**Created:** [January 22, 2017, 5:12pm UTC](https://forum.dynamobim.com/t/built-in-parameter-python-script/9047 "2017-01-22T17:12:07Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![i.tzivanidis](https://avatars.discourse-cdn.com/v4/letter/i/dec6dc/32.png) [@i.tzivanidis](https://forum.dynamobim.com/u/i.tzivanidis)\
**Post date:** [January 22, 2017, 5:12pm UTC](https://forum.dynamobim.com/t/built-in-parameter-python-script/9047/1 "2017-01-22T17:12:07Z")

</div>

Need some expert eyes to consult on my script.

Trying to get the rooms at Level 3 and change BIP Unbounded Height.

Does this look right?

 ![](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/9/8/980161d240d53aa01c8929befc84c5054c2a6d07.png)

 ![](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/1/9/1958cbb51240048b21890bc20b93bd1f29270563.png)

---

<div class="post-metadata">

**Author:** ![i.tzivanidis](https://avatars.discourse-cdn.com/v4/letter/i/dec6dc/32.png) [@i.tzivanidis](https://forum.dynamobim.com/u/i.tzivanidis)\
**Post date:** [January 22, 2017, 5:23pm UTC](https://forum.dynamobim.com/t/built-in-parameter-python-script/9047/2 "2017-01-22T17:23:16Z")

</div>

Trrying to do that for Unbounded height

> [@Level Parameter Bug - Read only](https://forum.dynamobim.com/t/level-parameter-bug-read-only/5781/4):
>
> I’ve experienced this same behaviour as well and couldn’t get around it with the OOTB nodes. I finally solved it by using some python code. You can use this: with the following python code: import clr clr.AddReference('RevitAPI') from Autodesk.Revit.DB import \* clr.AddReference("RevitNodes") import Revit clr.ImportExtensions(Revit.Elements) clr.ImportExtensions(Revit.GeometryConversion) clr.AddReference("RevitServices") import RevitServices from RevitServices.Persistence import D…

---

<div class="post-metadata">

**Author:** ![Thomas\_Mahon](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/thomas_mahon/32/64209_2.png) [@Thomas\_Mahon](https://forum.dynamobim.com/u/Thomas_Mahon)\
**Post date:** [January 22, 2017, 5:56pm UTC](https://forum.dynamobim.com/t/built-in-parameter-python-script/9047/3 "2017-01-22T17:56:03Z")

</div>

Paste your code.

The issues I can see:

1. You don’t declare variable ‘x’, meaning the action on line 24 is void. Try using ‘i’

2. There’s no need to use the enumerate function since you are (I presume) feeding in a list of objects to IN[0]

3. No need to unwrap IN[1] as they’re doubles (I presume), not Revit elements

4. No need to output anything since you’re updating parameters

5. You cant index using i as its a member of IN[0] (a room) meaning `UnboundedHeight[i]` will return null. You could do something like the following to iterate through two lists:

---

<div class="post-metadata">

**Author:** ![i.tzivanidis](https://avatars.discourse-cdn.com/v4/letter/i/dec6dc/32.png) [@i.tzivanidis](https://forum.dynamobim.com/u/i.tzivanidis)\
**Post date:** [January 22, 2017, 6:01pm UTC](https://forum.dynamobim.com/t/built-in-parameter-python-script/9047/4 "2017-01-22T18:01:36Z")

</div>

Thanks Tom! Trying to get to grips with API syntax…

import clr  
clr.AddReference(‘RevitAPI’)  
from Autodesk.Revit.DB import \*

clr.AddReference(“RevitNodes”)  
import Revit  
clr.ImportExtensions(Revit.Elements)  
clr.ImportExtensions(Revit.GeometryConversion)

clr.AddReference(“RevitServices”)  
import RevitServices  
from RevitServices.Persistence import DocumentManager  
from RevitServices.Transactions import TransactionManager

doc = DocumentMananger.Instance.CurrentDBDocument

element = UnwrapElement(IN[0])  
Unbounded Height = UnwrapElement(IN[1])

TransactionManager.Instance.EnsureInTransaction(doc)

for i in enumerate(element):

```
object_param_UnboundedHeight = x.get_Parameter(BuiltInParameter.ROOM_HEIGHT)

object_newUnbounded Height = Unbounded Height[i]

object_param_Unbounded Height.Set(object_newUnbounded Height)

```

TransactionManager.Instance.TransactionTaskDone()

#Assign your output to the OUT variable.  
OUT = element

---

<div class="post-metadata">

**Author:** ![T\_Pover](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/t_pover/32/19147_2.png) [@T\_Pover](https://forum.dynamobim.com/u/T_Pover)\
**Post date:** [January 22, 2017, 7:30pm UTC](https://forum.dynamobim.com/t/built-in-parameter-python-script/9047/5 "2017-01-22T19:30:02Z")

</div>

As Thomas pointed out the code needs some changes, but besides that: I don’t think you can change the parameter ‘Unbounded Height’. It’s a read only parameter, so using a built in parameter probably won’t help much in this case.  
 ![](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/5/0/50f99e39a5da935c83118071e9c2116a2fb40df9.png)

Maybe you can use the parameter ‘Limit Offset’ instead? But my knowledge on Rooms and their parameters isn’t that great.

---

<div class="post-metadata">

**Author:** ![Gui\_Talarico](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/gui_talarico/32/10887_2.png) [@Gui\_Talarico](https://forum.dynamobim.com/u/Gui_Talarico)\
**Post date:** [January 23, 2017, 10:48pm UTC](https://forum.dynamobim.com/t/built-in-parameter-python-script/9047/6 "2017-01-23T22:48:26Z")

</div>

On UnboundedHeight parameter:

> I don’t think you can change the parameter ‘Unbounded Height’. It’s a read only parameter […]  
> Maybe you can use the parameter ‘Limit Offset’ instead?

This is correct.

ROOM\_HEIGHT aka “Unbounded Height” is read-only and is computed from:

1. Level (bottom plane) - Fixed based on room placement
2. 
  - Upper Limit (top plane), a level element

3. 
  - Base Offset (bot plane offset), feets (double)

4. 
  - Limit Offset ( top plane offset) feets (double)

You should be able to change the corresponding BIPs (except for #1),  
but also note you can change properties 2,3,4 listed above using their property setters instead of builtin params:

```
room_element.LimitOffset = 5.0
room_element.UpperLimit = SomeLevelElement
room_element.BaseOffset = 5.0

```

> **[BaseOffset Property](https://www.revitapidocs.com/2015/1ee9db0a-558c-e44a-97af-eadc5cafff76.htm)**
>
> Online Documentation for Autodesk's Revit API: 2015, 2016, 2017, 2017.1, 2018

> **[LimitOffset Property](https://www.revitapidocs.com/2015/760d7f16-c715-1fa5-55b1-3ede2492d9fd.htm)**
>
> Online Documentation for Autodesk's Revit API: 2015, 2016, 2017, 2017.1, 2018

> **[UpperLimit Property](https://www.revitapidocs.com/2015/ee4b5be1-482f-e195-e522-28cc2d90dd9a.htm)**
>
> Online Documentation for Autodesk's Revit API: 2015, 2016, 2017, 2017.1, 2018

---

<div class="post-metadata">

**Author:** ![i.tzivanidis](https://avatars.discourse-cdn.com/v4/letter/i/dec6dc/32.png) [@i.tzivanidis](https://forum.dynamobim.com/u/i.tzivanidis)\
**Post date:** [January 23, 2017, 10:56pm UTC](https://forum.dynamobim.com/t/built-in-parameter-python-script/9047/7 "2017-01-23T22:56:19Z")

</div>

You are right. I was seeing an arrow on the space which when adjusted modified the Unbounded height and falsely assumed it is editable.

My issue was in a the room bounding boolean of ceiling floors elements as I am intrested in services.

Thanks for revitapidocs I find it very insightful @Gui_Talarico.
