Hidden Parameters: The Key Under the Mat

Locking parameters inside of Revit content is sometimes a necessity: getting logic to work properly requires some gears to turn and parameters that hold and relay data. In very complicated families that include arrays, moving components, or even error messaging if multiple incompatible options are chosen, the amount of parameters can quickly build up. Revit has a built-in solution to hide those parameters, to keep families clean and only present information that will be important to users of the content: hidden parameters. Little known and under-utilized, hidden parameters can really clean up content when used properly. The best part is it only requires one extra step after the parameter has been made – so they’re fast, easy, efficient, and add functionality. What more can you ask for in a modelling technique? As an example I will be making a simple box with three types of different dimensions and colors, locked out, with the “key” hidden from the user.

The process of creating a hidden parameter begins like a normal shared parameter. When adding a parameter to a family, select the “Shared” option instead of family. It might make sense to create a new file specifically to hold hidden parameters, to keep them segregated from other shared parameters and to make them easy to access. There is no obvious way to tell if a shared parameter is hidden without loading it into a Revit project, so a separate hidden parameters file would make that distinction: any parameter within the file, will be hidden. No guessing or testing involved. For this example I made a new shared parameter file simply called “Hidden Parameters” and a group within the file named “Constraints”.

Hidden Parameters 1

Hidden Parameters 2

Create a new file if needed. Groups can be added to the file once it is made.

Revit Quirk Alert: An important note here before continuing is to go through the entire creation process, including the step to make the parameter hidden, before adding the shared parameter to a family. If it is added to a family before being turned into a hidden parameter it will be visible.

Add any necessary parameters to the file as they are required: there is no limit on the data type of a hidden parameter. Once any parameters have been created and added, they can be used inside of the family as normal. Since these are shared parameters, I prefer to name all of my hidden parameters with a “z” in front, such as “z Type”, “z Width”, “z Model Number”, etc. This will put them at the bottom of the parameter list inside of a project and also signifies that the parameter is hidden in the family editor.

Now for the final step (really, that’s it!): open the shared parameter file in a .txt file editor such as Notepad. The first thing you’ll see is a message to not edit the file…

Just ignore that.

You’ll then see a list of parameters as well as how they are organized inside of Revit and some data that lets Revit know how the parameter is used. Change a single value: the second integer. It will be a “1”. Change it to a “0”.


Hidden Parameters 3

Save the file and you’re done. Now that parameter is hidden in a project when added to a family.

For my example I made two hidden parameters: “z Type” and “z Material”. The visible dimensions are locked out using z Type, and the material (which can not be locked – just the nature of material parameters since they are unable to use formulas) is hidden so it cannot be modified in a project.

Hidden Parameters 4

Hidden Parameters 5

Dimensions locked and materials changed by hidden parameters. Note that there is no “Constraints” category in the Type Properties.

Revit Quirk: Mismatching Units and Hidden Parameters

Revit has a lot of quirks that need to be worked around, and that means finding those workarounds and taking advantage of them. There was an issue with units in previous versions of Revit (that has since been resolved – thankfully) that led to developing a useful trick: using hidden values to drive visible ones.

Before Revit 2014:

There were parameters that had issues displaying the correct way. For example, setting a piping flow rate to GPM with a formula would give an incorrect value using Air Flow units. Revit 2013 and earlier treat all flow formulas as Air Flow – it is hardwired in – even when dealing with piping, so using formulas can get tricky inside of families.

Project units set to GPM

Project units set to GPM

New parameter - Piping, Flow

New parameter – Piping, Flow

Formula uses CFM, Parameter's Units are in GPM

Formula uses CFM, Parameter’s Units are in GPM

As you can see in the above images, even while project units were set to GPM for flow the formula field only accepted values in CFM, the Air Flow project units. What’s more, it will only accept whole values: no fractions and no decimals. While the GPM field itself can be set to any value, locking it out with a formula is where the issue comes up.

Here’s where the workaround comes in.

If you use other parameters to store the value, and then only reference those parameters inside of a formula, it skips the conversion that normally takes place and displays the desired value. – in the correct units, to the correct unit accuracy. If the ‘storage’ parameters are made as Hidden Parameters, then they are not visible in the properties palette in the project.  Parameters that present value to the user remain visible while the ‘Storage Parameters’ do not (in this case, Flow Rate).  The great part about this is that whatever your project units, they will always be accurate. Even though the parameter that holds your “actual” GPM is hidden, changing project units to L/s will convert its value to L/s, etc.

To create a Hidden Parameter, all that needs to be done is to change a Shared Parameter’s “Visible” value to 0 inside of the shared parameter file prior to writing the parameter to the family.  A future post will focus on this little known feature and how INVIEW uses it extensively.

Revit 2014 and Beyond:

In current versions of Revit, the Formula units now match the units shown in the Value field.  However, the rounding increment shown in the formula field doesn’t always match what is shown in the Value field.  If a number gets rounded inside of a formula, its true value is lost: as far as Revit is concerned, the rounded value is the value that was initially input as soon as the Types dialogue is closed. For example, while still working in the same instance of the Types dialogue, a 1.5 that was rounded to 2 inside of a formula will read as “1.5” in the output, but once the dialogue is closed and reopened, it will read as a 2. Changing unit precision will not resolve this problem since the formula itself was “edited” to have the rounded value. This issue is most prominent with small values: fractions of a unit that when rounded, are lost.

A simple way to recreate this is to set Project Units to Feet and fractional inches. Unit precision does not matter in later versions of Revit: formula fields are very precise, regardless of project unit precision. If you were to create a Length parameter and set its Formula to a static value of .05”, it automatically converts to a fraction of 13/256”. Press okay to close to the types dialogue, convert project units to decimal inches, and reopen the types dialogue. You’ll see that the original value was lost and is now .051”. Values that small are not usually an issue – but it is something to keep in mind and is solid evidence to easily reproduce. Once a unit is rounded, its original value is lost in the family editor.

Storage Parameters:

Storing values inside of hidden parameters have quite a few uses, and prevent mistakes inside of families: values that would otherwise be unlocked and rely on the user to not change them can be locked completely, and unit accuracy can be guaranteed.

Let’s say there was a family that absolutely needed ¼” accuracy at all times. If you do not want Revit to ever round that value up or down, create two Hidden parameters: “Number” (Discipline: Common, Type: Number) and “Unit” (whatever your desired unit is. In this example, Discipline: Common, Type: Length). They will feed into a third parameter, “Visible Value” (same unit type as the “Unit” parameter. This parameter will be what users see). Set the “Number” parameter to be .25. Now use the “Unit” parameter, unlocked, to hold the value you want to set: if you want that ¼” accuracy, set the parameter to be 1”. In the formula field of the “Visible Value” parameter that users will be using, multiply the two hidden parameters together: in this example Number * Unit. Since “Number” and “Unit” are hidden they will not be seen inside of a project, but the Visible Value field will always be accurate – even if it’s rounded up or down by the project units, its value remains constant.

The usefulness does not end there: you can also use Storage Parameters to lock the values of parameters that always exist in a family, like Model and Description. If you had four separate types with unique values (such as a Part Number, Ordering Number, or SKU) you could use a hidden storage parameter to lock them out by Type instead of leaving the values open. The same goes for changing dimensions – multiple types with different Width, Height, and Depth could all be locked using a hidden value.

When I create a family, I usually name that Storage Parameter “z Type”, and there are very few families that I make without it: set “z Type” to be a different value for each of the types in a family, set all of the formulas to look for a specific z Type that informs them what their value is supposed to be. Voila: completely parametric family with locked values to prevent mistakes wherever they are needed. Correct “Cost” values for every type, security cameras that have the correct horizontal and vertical field of view, depending on lenses… The possibilities are endless.

Revit formula modeling for performance and scalability

There’s no right or wrong way to do anything in Revit, though some methods are more scalable. When writing formulas for families, it can prove advantageous to make it as human-readable as possible making edits faster and easier.

Through a process I call “funneling”, you can take multiple checkboxes and assign them an easily referenced value from an integer parameter. Imagine a heat pump available in three voltages (208/230/460V) and two frequencies (50/60 Hz) available with and without a heater or a humidifier. Each combination produces a different Rated Load Amps, 24 possible values in total. By this point, most will have resorted to using a type catalog, but this can easily be handled using instance checkboxes.

First, we create checkboxes for each available voltage and an integer parameter. The integer parameter should not be named “Voltage” since we’ll probably want a true Voltage parameter later, so I use “Voltage Selection”. Write a formula that looks at each checkbox and assigns a numerical value based on which one is selected.

Revit Integer Parameter Funneling

I prefer to go in ascending incremental order for legibility and I never use the “False” of the statement for a usable value. This ensures that none of the options are missed in the funnel and counting parenthesis is easy since it’s equal to how many options we have. The funnel parameter is the separation between input and output, allowing us to change our outputs without affecting inputs and vice versa. By doing this with the remaining options for frequency, humidifier, and heater, we can use Excel to concatenate our 24 possible outcomes with a simple “if(and(“ statement referencing each parameter to a value like a combination lock.

Revit Integer Parameter Funneling

Array out your combinations almost like you would for a type catalog and start a concatenate for just one row in another column. Lock the referenced cell holding the funnel parameter names in the columns and rows direction (with a “$” before each letter and number) so they don’t move at all. Lock the funnel parameters values in the column direction (with a “$” before the number only) so each formula fragment will reference the appropriate value for that combination when you drag the concatenate downwards, but not allow the cell with the reference parameter name to change at all. Then concatenate the formula fragments at the bottom and copy over into the cell next to it. Input a closing parenthesis in the cells the new concatenate references. This will count your parenthesis for you. Assign a false value for the formula and concatenate the three parts together:

  1. The concatenate of the true values
  2. The false value
  3. The concatenate of the closing parenthesis

Once created, the whole structure is scalable. The parameter names or values can be changed at any time and the formula will still work because the concatenate updates automatically. The structure can also be easily edited to create formulas for the rest of the family by adding or removing formula fragments (Rows) or referenced parameters (Columns) independent of each other. Multiple formulas can also be written at the same time if they reference the same parameters as seen at the end of the video. It would of course be a good idea to save the Excel Book wherever the family is saved if you ever want to come back and make changes later.


I hope this helps you create some powerful formulas! Feel free to leave me a comment below if you have any questions.