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:
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 Type | Compatible Types |
Number | Number or Integer |
Integer | Number or Integer (see Note 1) |
Length | Length |
Area | Area |
Volume | Volume |
Text | Any (see Note 2) |
Yes/No | True/False |
Angle | Angle (see Note 3) |
Currency | Currency (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 Type | Implementation Data Type |
Number | Double |
Integer | Int32 |
Length | UnitsNet.Length |
Area | UnitsNet.Area |
Volume | UnitsNet.Volume |
Text | String |
True/False | Bool |
Angle | Double |
Currency | Double (see Note 4) |
XYZ | Autodesk.Revit.DB.XYZ |
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.