Most recent threads @ RevitForum.org

Saturday, October 31, 2009

Controlling user inputs in families

When building Revit families, and wanting to avoid nightmares, it may be useful to be in control of the user inputs. It could be a door that can´t be made if it´s more than 1200 mm´s (4´-0") wide.

Now, there´s a couple of ways to aproach this, but only one of them will actually tell the user that the input is not acceptable, I tend to combine two methods - 1. Warning & 2. Control

Warning Method

For this we need a custom parameter (yes/no) called "Width Warning", with a formula like this

not(Width < 1200 mm)






Now, create some model text, with a warning to the user - choose element properties for the model text, and aply the "Width Warning" parameter under "Graphics > Visible"







Now, if a user inputs 1200 mm´s or more as the width, the model text will show, and tell the user to correct the problem.

Control Method

It´s also possible to control the input, just in case that the user chooses to ignore the warning.

Create a new length parameter called "Controlled Width" and ad a formula like this:

if(Width > 1200 mm, 1200 mm, Width)




Now change the label for the current width dimension, to the new "Controlled Width" parameter.

Now the user get´s  a warning, and the door keeps a max. width of 1200 mm´s, even if the user input is greater than 1200 mm´s.









Download the example Door family

3 comments: