How PropertyWizard generates text values

The previous post explains how to use the ‘+’ operator to join text values together in PropertyWizard. But it doesn’t explain how PropertyWizard generates text values from the Revit properties that you use in your formulas.

For example, in this formula what determines how the Length value is formatted?

"This wall is " + Length + " long."

The answer depends on whether the Revit property is a parameter or an API property.

Formatting Revit parameter values

Revit parameters know what type of data they represent, which enables PropertyWizard to format the value correctly to match your current Units settings.

So, if you are using Millimetres for length, a six metre long wall will generate this result:

Revit properties box, showing a value formatted in millimetres

While if you are using Feet and Fractional Inches (to the nearest 1/2″), you will get this result:

Revit properties box, showing a value formatted in feet and fractional inches

Note that if you change your Units setting, you need to run PropertyWizard’s Update All command. The Revit API does not have any facility to notify an add-in that the Units settings have changed.

Formatting Revit API values

Revit API values do not know what kind of value they represent, so it isn’t possible for PropertyWizard to format them for you. For example, if you use the Location.Point.X property on the Columns category, you will get results like this:

Revit properties box, showing a raw Revit API value

Which is showing the raw data from the Revit API, the same as is shown by Revit Lookup:

Revit Lookup box, showing raw values for Point data

You will need to use formula expressions to format this raw data to match your current Units settings. I will cover some techniques in a future post, but please comment below if you have specific questions.

Leave a Reply

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.