Element.GetParameterValueByName gives wrong answer or maybe not?

I want to get the value of the dimension type parameter : Dimension Line Snap Distance: in this case it is 6mm
But i get a wrong value (0.0196850393700787) Why?

see pictures:

Dynamo is giving you the value in feet.

1 Like

Thank
I thought about inches but that was not right
Never thought about feet :wink:

1 Like

Hi @Nico_Stegeman

You could use this method to get dimension values as Revit if your project is in mm:

import clr
clr.AddReference('RevitAPI')
clr.AddReference('RevitNodes')

from Autodesk.Revit.DB import DisplayUnitType, UnitUtils
from Revit import Elements

dim = IN[0]
# param
val = []

# output unit
unit = DisplayUnitType.DUT_MILLIMETERS

for d in dim:
	item = d.GetParameterValueByName('Dimension Line Snap Distance')
	val.append(UnitUtils.ConvertFromInternalUnits(item, unit))


OUT = val
3 Likes

i used now this solution:

i am going to use your solution

Thanks it works :+1: