Unconnected Height

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

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!

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

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

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

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

image

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…

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

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.

wow yeah that is odd

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.

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).

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…Capture
graph attach

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:
image

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
1 Like

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?

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.

Cool, I am on it
Many thanks

Amazing Tom!!!
Many thanks!!!

no worries