Skip to content

Instantly share code, notes, and snippets.

@chuongmep
Created June 4, 2020 16:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chuongmep/6348426bbcf96233c99cc6829b59c5d3 to your computer and use it in GitHub Desktop.
Save chuongmep/6348426bbcf96233c99cc6829b59c5d3 to your computer and use it in GitHub Desktop.
Get Parmater Revit API
def GetParameterValue(parameter):
value= None
if parameter.StorageType == StorageType.Double:
value = parameter.AsDouble()
elif parameter.StorageType == StorageType.Integer:
if parameter.Definition.ParameterType == ParameterType.Integer:
value = parameter.AsInteger()
else:
value = parameter.AsValueString()
elif parameter.StorageType == StorageType.String:
value = parameter.AsString()
elif parameter.StorageType == StorageType.ElementId:
value = parameter.AsElementId()
return value
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment