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?
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?
Trrying to do that for Unbounded height
Paste your code.
The issues I can see:
You donât declare variable âxâ, meaning the action on line 24 is void. Try using âiâ
Thereâs no need to use the enumerate function since you are (I presume) feeding in a list of objects to IN[0]
No need to unwrap IN[1] as theyâre doubles (I presume), not Revit elements
No need to output anything since youâre updating parameters
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:
for i, j in zip(element, UnboundedHeight):
do something
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
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.
Maybe you can use the parameter âLimit Offsetâ instead? But my knowledge on Rooms and their parameters isnât that great.
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:
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
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.