Sep 25, 2022
Revit API: How to change associated Level in Walls?
Check out this snippet with explanation to change top and base constraints of a Wall.
First of all we need to have an element that we are going to modify. I am going to get a wall with an
Then we need to look inside and find parameters that we want to modify. You can do it easily with RevitLookup plugin that let's us
Snoop Current Selection
Then if you click on Definition you can see
BuiltInName of this Parameter. Which is -
Then do the same to find names of
Top Constraint parameter and
Since these are
BuiltInParamteres we can get them with .
Set New Levels
To set new levels we just going to take parameter variables we have written already and use
.Set() method and provide
ElementId of new levels.
Set Wall Top Constraint to None
If you want to change
Top Constraint to
None we need to provide
ElementId(-1) instead of
Level.Id This is equivalent to None in Revit API.