Problems with Parameter values

@Daniele_Teodori

@Kulkul is right , AsValueString will get your aroud the unit conversion issues. Revit internally works with some units that can not be changed.

You could also use the following code if you’d like to run conversions from/to the internal units:

import clr
clr.AddReference('RevitAPI')

clr.AddReference('RevitServices')
from RevitServices.Persistence import DocumentManager

doc = DocumentManager.Instance.CurrentDBDocument

#Getting Document UI Units - you nedd to precise the unit type, here it's lenght

UIunit = Document.GetUnits(doc).GetFormatOptions(UnitType.UT_Length).DisplayUnits

#Converting Input to internal units to user interface units

convertto = UnitUtils.ConvertToInternalUnits(IN[0],UIunit)

#Converting Input from internal units to user interface units

convertfrom = UnitUtils.ConvertFromInternalUnits(IN[0],UIunit)

OUT = convertto , convertfrom

List of all unit types here :
http://www.revitapidocs.com/2016/4155880c-f243-3456-fbb8-542c8f8ad692.htm

2 Likes