Revit mean sea level parameter with Dynamo

I use Revit 2020 and Dynamo 2.2.1
Is it possible to create a Revit parameter where you can change the height of a floor from mean sea level?
I have tried to make a dynamo script that is linked to a parameter I made with the name “Elevation Top” and this parameter is visible in the Properties bar when you click on a floor. But when i change the value of the “Top elevation” parameter it just resets.

What I need is a parameter where i can change the elevation of a floor from the mean sea level by just typing in the correct height for that floor without having to use the “Height Offset From Level” and then use a calculator to calculate the correct offset to put in to higher or lower the floor to it’s correct mean sea level . I am new to Dynamo and programming in general, I have no idea if it’s right in anyway but this is the script I but together .

The graph you posted does the following: reads the value of the parameter “Elavation at Top” and writes to the parameter “Elevation Top” of the same elements. You don’t modify the values any way. I guess you want add the elevation difference to this parameter somewhere?

What do you mean the parameter “resets”? It becomes empty?

Not dynamo related but for sea level elevation a common practice is to move the survey point to the sea level, and this way you can read sea level elevations in the “Elevation at Top Survey” parameter. This parameter is not readable directly but you can use it in floor tags. Also a Spot Elevation can be set up to show elevation from survey point, and it’s usable on any elements.

@infeeeee Refer what he had said.


follow this link and read about the survey point.

I can change the number off the parameter “Elevation Top” but when Revit updates the parameter resets to what it was previously. But that’s probably because its done in the wrong way as you say.

The thing is that the project I’m working in have a lot of different highs on the floors but I only have around 10 Revit levels so all the floors are offseted from these levels to put them in the right mean sea level height. So I want to create a parameter in the properties tab where I can just enter the sea level height I want the floor to move to and it will move to that height. Instead of having to calculate what “Height Offset from Level” I have to wright in for it to get to the right sea level height.

For example If I want the floor to be bound to Level 2 and the sea level height at Level 2 is 7000 mm, but i want the floor to be at 8000 mm but still have a connection with Level 2 i have to enter 1000 in the “Height Offset from Level” instead of just entering the top elevation of the floor to 8000 mm.

I know how the survey point works I just wanted to create a more effective way to get my work done, as I responded in the answer above. But thank you anyway! :slight_smile:

1 Like

Ok, now I understand what you want, it was a pretty easy graph, it would be a good learning experience for you to figure it out by yourself, but never mind.

I created a project parameter, I called it SeaLevel, I added as an instance parameter to levels and floors. You have to fill this parameter on the levels and on the floors. After you run the script, floors will move to their correct location. I didn’t test this graph on a lot of elements and levels, but it should work:

But I still don’t recommend using this, using the survey point workflow should be much more stable and consistent. You don’t have to reinvent the wheel. If you add a spot elevation to an element, select the element you can click on the spot elevation and type the elevation from survey point there, so it would be a much quicker workflow. Also if you forget to run this graph some of your floors will be at a wrong location.

Also without knowing your design it’s strange to have a lot of non level floors, is it some university project? In reality it’s also recommended to create separate levels in this case for separate floors, it would make room placement much easier. Rooms can behave strangely if a floor is above their level, you can forego this PITA.

I tried your script but I got this message “Warning: Element.SetParameterByName operation failed.
The call is ambiguous between the following methods or properties: ‘Revit.Elements.InternalUtilities.ElementUtils.SetParameterValue(Autodesk.Revit.DB.Parameter, Revit.Elements.Element)’ and 'Revit.Elements.InternalUtilities.ElementUtils.SetParameterValue(Autodesk.Revit.DB.Parameter, string)”

What type of parameter did you use for the “SeaLevel” parameter? And what exactly dose the parmeter do? Dose it allow you to click on a floor and change the elevation of the floor by typing a nummber in to the parameter "SeaLevel?

The building I’m working on is relay big and very old and it’s going to be renovated. So that’s why we have so many different floor levels and if we had a level for every different floor height we wold have 250+ levels. I know how to change the elevation by annotating the floor and then typing in the new desired height. The problem with this is that everyone in the project has a separate working view. So every time someone would like to change a new floor they would have to first annotate it and then change the value in their working view. That’s why I would like to have a separate parameter that applies to every floor where you can simply just change the elevation of the floor.

It was a length instance project parameter. Your problem is you want to write null values to the height offset from level parameter, you have to sanitize your input first and fill all levels and floors. Dynamo is not that straightforward, and it won’t think instead of you, please learn a bit about it, if you have so basic questions it seems you are missing even the most basic stuff. The primer is really good source, you can read it in 1-2 hours, I cannot explain every basic concepts already written on the internet: https://primer.dynamobim.org/index.html Also I can’t help if you don’t understand the graph you are trying to use.

Also you can add a tag automatically to all elements in a view in two clicks…

Also the forum is not a slave market, I don’t want to work for you for free, if you have exact questions I’m happy to help, but I won’t write a full workflow in my free time for you, this was even more I should have done, pls don’t get offended.