Data Types in PropertyWizard for Revit

When you make a new Revit parameter you choose the Type of Parameter, and that determines the type of data that the parameter can hold:

Revit Parameter Properties dialog showing the 'Type of Parameter' drop-down menu

PropertyWizard uses these same data types:

  • Number
  • Integer
  • Length
  • Area
  • Volume
  • Text
  • True/False (equivalent to Yes/No)
  • Angle (measured in radians)
  • Currency

The only oddity is XYZ, which is a Revit API type. It is only valid as input to the internalToShared() and sharedToInternal() functions.

Formulas have data types

It follows that each formula produces a result of a particular data type. It’s important that the formula result is compatible with the Target Property:

Parameter TypeCompatible Types
NumberNumber or Integer
IntegerNumber or Integer (see Note 1)
TextAny (see Note 2)
AngleAngle (see Note 3)
CurrencyCurrency (see Note 3)

Note 1: When setting Integer parameters, Number values are rounded down. For more control, you will usually want to carry out the rounding within your formula.

Note 2: PropertyWizard will convert virtually all values to text when setting Text parameters. Dimension values (Length, Area, and Volume) will be converted using the current Revit project’s Units settings.

Note 3: Angle and Currency parameters can currently be set with any numeric value. Please do not rely on this: I will tighten it up in a future version of PropertyWizard.

Implementation Types

Behind the scenes, the PropertyWizard data types are stored in .Net data types. You may see these data types in error messages. The details may vary in future versions.

PropertyWizard Data TypeImplementation Data Type
CurrencyDouble (see Note 4)

Note 4: Best practice would suggest storing Currency values in a Decimal form. Revit’s implementation uses Doubles to store currency values, so PropertyWizard follows suit. This may change in the future.

Leave a Comment

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.