Tab Coloring By Filter (Regex)

I assume I’m missing something pretty obvious but have had a search and can’t find anything, how exactly am I supposed to use the “Filter (Regex)” field to get the tabs to filter by the tab name?

Every time I input text into the field and save nothing happens, and the field is blank when I return to the settings. I’ve tried enclosing the term/s in “” but same result.

I prefer the solid background fill for all tabs, and what I’m trying to do is input all the standard family file view names (Front, Back, Ref.Level, etc.) in as the filter, so that my open family files are always from that specific colour range.

I was searching for information on this, found your post, had the same problem as you, and then happened to stumble upon the answer!

You have to click on a colour box in order to associate it with the particular Regex. In this screenshot, you can see I’ve defined three different colours, and I’ve typed ‘plan’ into the Regex (to colourize anything with the word ‘plan’ in its name) – but it won’t work – because I need to click on one of the colour boxes to associate it with ‘plan’!

image

Now if I click the green colour box, you’ll see it’s selected/active, and now when I save and reload, PyRevit ‘knows’ that my regex ‘plan’ is tied to the green colour.

image

So basically now I’ll just click the red box, then type the regex I want associated with it; then I’ll click the green box, type its regex, and so on. (and then hit save and reload)

I hope that solves it for you!

2 Likes

Well that confirms my ‘I must be missing something pretty obvious’ suspicions :stuck_out_tongue:

I revisited this a couple of times and still kept coming up short, thank you a ton for sharing the solution, you win the internet for this week.

Unfortunately it means the effect that I was after isn’t possible - I basically want family files to use one colour palette and project files to use another colour palette. But if I assign green to “Front”, for example, it means that all family files in Front view display the same colour. I was kinda hoping that I could create a regex with all family view names as one filter (ref. level, front, back, etc.) and it would assign one of the colours from the entire colour range to an entire file. Shame, but thanks again!

1 Like