Tuesday, 19 November 2013

Setting Maximum and Minimum Values to Parameters

When you are creating Families in Revit there is often times where you would like to set maximum and minimum values for a parameter. This can be done using a simple nested ‘If’ statement in the formula.

In the example we would like to specify a maximum and minimum range for a length of an object. For this we will need 2 parameters….

Length – this parameter is the adjustable length of the object in question, this can be set to any amount without limitation. (For example this could be used to describe the distance from the object to a reference point)
Length Actual – This is the actual length of the object that is limited to a maximum and minimum amount.

The Length parameter is manually input (or determined) by the user.

The Length Actual then needs a formula applied to set it maximum and minimum values, in this example we are going to set a maximum amount of 2400 and a minimum amount of 1200.

The formula for Length Actual would read…..

=if(Length < 1200, 1200, (if(Length > 2400, 2400, Length)))

This formula reads….

If the Length is less than 1200 then use 1200, if the Length is greater than 2400 then use 2400, if the Length is between 1200 and 2400 then use the Length value.


(The ‘mm’ units get automatically added by Revit)


No comments:

Post a Comment