How to find text with PropertyWizard

You can use the instr() function to find text in a PropertyWizard function. It finds the position of one piece of text inside another, and returns the character position of the first character of the found text, or -1 if the text isn’t found.

So, say we want to find all the rooms where the room’s Name contains “Bedroom”, such as “Main Bedroom”, ” Bedroom 2″, etc. The formula for that would be:

instr(Name, "Bedroom")

To turn that into a true/false value, you could use:

instr(Name, "Bedroom") != -1

This checks whether the instr result is not equal to (!=) minus 1. It will return true if the Name contains “Bedroom” and false otherwise – you can put this true/false result directly into a Yes/No parameter.

Continue reading “How to find text with PropertyWizard”

How to generate Level Codes in Revit with PropertyWizard

It’s useful if your Revit Levels have a Level Code as well as a Level Name. That way, you can use the Level Code in your formulas for door numbers, room numbers, etc:

Level NameLevel Code
Level 000
Level 101
Level 202
etc.etc.
Level Names and Level Codes

You could type the level codes in, level by level. But if you have PropertyWizard, you can just generate them. This post walks through a couple of different ways of generating the level codes from the level names. And on the way, it explains two of the text functions in PropertyWizard: substr() and strlen().

Continue reading “How to generate Level Codes in Revit with PropertyWizard”