Wild Card Values in the Revit Model Checker

BIM
Share on facebook
Share on twitter
Share on linkedin
Share on pocket
Share on email

[box type=”info”] Heads up! This post is dialing the Nerd level up to 11, but if you are interested in better ways of keeping your Revit models on your standards, keep reading![/box]

The Autodesk Model Checker for Revit and the Autodesk Model Checker Configurator are two potent pieces of software that can help take the manual lifting out of many of your BIM standards checking in your Revit models.

A lot of the checks we see center around validating how something is named or numbered. This kind of consistency is great in project files, but it can also be tricky to build up in the Configurator. It’s easy to build your check to make sure all your rooms are named “ROOM”, but that isn’t feasible at all. Fortunately, the Configurator allows you to use a Wild Card for many of the checks, and that flexibility is huge.

If you are an old DOS user like me, you might think of an asterisk (*) as a Wild Card, but the model checks are able to leverage a far more robust set of rules for building wild cards, and those are built upon Regular Expressions. Stolen directly from Wikipedia, a regular expression “is a sequence of characters that define a search pattern,” and once you crack their secret code, you can make some amazingly complex checks.

The Model Checker specifically uses the .Net 4.0 flavor of Regular Expressions, but the vast majority of rules and guidelines are universal, no matter what programming language you are looking at.

So let’s say I wanted to check my room numbers, and my standard is that it either starts with “B” or nothing at all, followed by three numbers and only three numbers. You can leverage the Wild Card for the Room Number parameter in the Model Checker to accomplish this.

Full disclosure: I am NOT a Regular Expression wizard. I know enough to muddle through and build checks that do what I want them to do. I would wager that someone who is a master could look at my check and figure out a way to streamline it, but for now I know this check I built gets the job done.

The check you can use will look like this:

001b-overview

It might look a little confusing, and we want to focus on the Wild Card portions, but I’ll break it down. The topmost dropdown is simply saying “If you find anything that matches the below filters, then we have a problem” followed by the error message the user will get if the check fails:

002b-top

The next section simply grabs all the room instances in the model, so we know this check is only starting with room elements:

003b-group

This next chunk is where the first Wild Card comes in. These filters start with EXCLUDE, so anything that the check finds before, take out these elements. In this case, our Wild Card specifically looks for a Room Number that may or may not start with a “B” and ends with 3 numbers:

004b-exclude

And that’s it. You see the ^B?[0-9]{3}$ sitting at the end? That’s the Regular Expression. Took me some trial and error (remember, NOT a wizard) but once it’s set, and I’ve tested it, I can be confident that this check will throw an error for any room number that doesn’t match my standards.

I like to test my Regular Expressions with an online validator, and there are several to choose from. Just remember that some of these don’t check specifically for .Net 4.0, but again, most of these rules are universal. I haven’t come across a check function that is excluded from what I need to accomplish. And there are scores of resources and reference all over the web that can help you along your way.

Popular posts like this

Leave a Comment

Your email address will not be published. Required fields are marked *