Element.GetParameterValueByName gives wrong answer or maybe not?


#1

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:


#2

Dynamo is giving you the value in feet.


#3

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


#4

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

#5

i used now this solution:

i am going to use your solution


#6

Thanks it works :+1: