Imput and output values done corrispond

I’m trying to make a script to enter a value in the top offset paramater of my structural foundation (piles).
This value needs to make the Z value of the top of the piles equal to the lowest point of all my other constructual elements.

I have all the information, however when i enter the value the model acts wierd and the value in it is different.

See the screenshot:

How does this happen?

Parameter.Value is likely ruturning the internal value (always in feet), while your project is in meters. Element.GetParameterValueByName will return the value with your project units rather than the internal ones.

Ive tried using the other not for my own sanity.
But the problem remains.

The script needs to set the paramater “Top Offset” to -1110, but it sets it to -338324.
When i check in the revit document the Top Offset of the element is also -338328 instead of -1110.

So bitween the + node and the SetParameterValueByName node -1110 gets changed to another value.
Or am i doing something wrong?

What are your project units? can you post a file purged of all but one instance of the family in question?

Attached is a link for the model and the script i have so far.
Project units are in meters or milimeters
Paal afhakhoogtes.dyn (110.0 KB)

hi, i just tried your code, and no problem


I think im going crazy.
Ive retried it in another revit version, and using the dynamo player.
both times im getting the “same” worng values

Can it be that im using metric in revit but dynamo doesnt use metric or something?

it seems like i was indeed going insane
my entire project is in metric value.
i calculate the value in mm’s
if i then convert the mm to feet and input that, i get the correct metric output.
its something ive never had before…
does anyone know how this can happen?