Hide Red Text on All Sheets

Here’s a fun one; I’ve been racking my brain around it for hours now. My engineers use red text on sheets as messages to the next person who opens it. However, when we print, I want only the red text to be hidden on all sheets (and eventually I’ll turn them back on). I’m trying to automate it so it’s a mindless function in the back ground.

So far I’ve managed to find all the red text styles in my drawing, but Views.HideElements is either not accepting the elements I’m giving them after the filter, or it doesn’t like the Sheets.All output.
Suggestions? I’ve also tried View.SetCategoryVisibility from MEPower and View.SetCategoriesOverrides (which works but won’t accept my filter).
Notice also, I looks like I’m picking up many many more text styles than what’s actually in Revit.


Hello…think you feed in string as element…try this here

mmmm, when I do that I get a list of TextNotes Elements

Also makes it so I can’t filter and see only text styles that are marked “Red”

yes thats great…now you have these element there have red in name…out in filterboolmask will give you the other…you can tjeck with an element name after your unique items…

Hey it worked! It hid all instances of every red piece of text on every sheet!

Now I just have the reverse the process :wink: Thanks so much!!

2 Likes

Any idea how to attach that code to a Boolean operator?
Basically, if true run this code, if false then no.

here is one way…

Where do I tie the result in to?

Got it! Scope.If is amazing!
I have this tied to a user interface (Data.Shapes) and when the boolean input is true, it turns it all off like I expected. Thanks!

One thing to note is that for ScopeIf to work, you need to ensure the two branches (i.e. one going into True and one into False) don’t interact with each other :slight_smile:

1 Like

You could also try running via the Color values - in this case an RGB value of 255 / 0 / 0 :slight_smile:

3 Likes

Hmm… I am noticing that for Scope.If, if it proves false, the graph still runs. What I’d like to happen is if Scope.If reads a false, the remainder of the graph doesn’t run.

More thinking to do…

ScopeIf will choose which part of the graph to run. There are two ‘branches’ - the true one and the false one, and it will only execute one of those based on the boolean value.

We recently updated the description to explain better :slight_smile:

image

What this means in practise, is that the nodes on both branches before ScopeIf will show null results, and only ScopeIf will show a result.

1 Like