Unconnected Height


#1

Hello community,
Is there anyway to set theTop constraint of a wall to Unconnected


#2

I would advice you to experiment with the Element.GetParameterValueByName node and see what it gives you when Unconnected is selected in Revit. Use that value with Element.SetParameterByName to change it.

Good luck!


#3

Thanks Einar, that was my first intent but it doesn’t work


#4

Are you able to post some screenshots? Do you get any warnings. Hoover over the yellow note.


#5

Sure, here you are,
As you can see there are 3 items that have top constraint level 1 and one unconnected
When we use the string Unconnected to replace the params values the node doesn’t work
It does not give me any warning but the output is null


#6

I think the Top Constraint values are actually integer vales. -1 equals unconnected height i think, i’ll have to check.

Edit: mixed up the connected height and Top constraint parameter


#7


#8

There are not Unconnected Height values in this graph the issue here is the Top Constraint parameter, which need to be populated by a level however there is not any existing level called unconneted.
That is why we are wondering if this is possible to accomplish…


#9

We cannot release an element with a Top Constraint to be Unconnected…


#10

I used this workaround once. But it is very odd and I am not entirely sure it is supported or will do what you want.


#11

wow yeah that is odd


#12

I’m not sure how you’d do it with OOTB nodes, but this should work:

import clr
clr.AddReference("RevitAPI")
import Autodesk
from Autodesk.Revit.DB import *

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


doc = DocumentManager.Instance.CurrentDBDocument



#Code here

#Start Transaction
TransactionManager.Instance.EnsureInTransaction(doc)


element = UnwrapElement(IN[0])

BIPname = BuiltInParameter.WALL_HEIGHT_TYPE
name = (element.get_Parameter(BIPname))
new = name.Set(ElementId(-1))

#End Transaction.
TransactionManager.Instance.TransactionTaskDone()

OUT = new

I meant -1 = Unconnected within the revit API, turns out the value has the storage type Id which is why ElementId(-1) works for setting the value to unconnected height.


#13

To add to this post:

i found this from an AU 2010 document by Matt Mason:

Setting Parameters
Similar to getting the parameter values, setting parameters is done based on the parameter storage type:
• Set (String): text
• Set (Double): number (usually in Revit’s internal units)
• Set (Integer)
• Set (ElementId): The ElementId (or an ElementId with an IntegerValue of -1 for blank).


#14

Hello,
I have tried to put together John aproach but without success, the Unconnected Height parameter works fine with numbers, they do not necessarily need integers, however when I use empty list, null and finally try to override the set parameter name by value, the unconnected height does not change.
I am probably doing something wrong…


graph attach


#15

Sorry i might have confused you a little and also myself, i mixed the parameter names up (Top Constraint and Unconnected Height).
This should work:

import clr
clr.AddReference("RevitAPI")
import Autodesk
from Autodesk.Revit.DB import *

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

doc = DocumentManager.Instance.CurrentDBDocument

#Code here
#Start Transaction
TransactionManager.Instance.EnsureInTransaction(doc)

if isinstance(IN[0], list):
	element = UnwrapElement(IN[0])
else:
	element = [UnwrapElement(IN[0])]

BIPname = BuiltInParameter.WALL_HEIGHT_TYPE
bool = []
for e in element:
	name = (e.get_Parameter(BIPname))
	new = name.Set(ElementId(-1))
	bool.append(new)

#End Transaction.
TransactionManager.Instance.TransactionTaskDone()

OUT = bool

#16

Many thanks Tom,

I have not done before custom nodes, I guees is just copy the command line that you kindly exchange and save the new node?


#17

It’s not a custom node, it’s just a python script node.

Search for it in the library like you would a normal node, right click, edit and paste the code above into it.


#18

Cool, I am on it
Many thanks


#19

Amazing Tom!!!
Many thanks!!!


#20

no worries