Hide/Unhide all lines by linestyle

Hi all,

i’m trying to write a dynamo script that automatically hide and unhide a specific line style (modell and detaillines) in all views in the projekt.

All my attempts do not really work :frowning:

So the toughts are:
Select all lines in the projekt -> Filter all lines withe the linestyle “vag_hilfslinien” -> hide or unhide all filterd lines in all views

So at the moment i have this:

But at the end i just get a list of graphicstyles and i don’t know how to use them for the next steps. I tried some with the nodes form archi-lab “view.hideelements” and view.unhideelements" but its not working with the list of graphicstyles (guess because they are not elements).


This is the test setup for the hide/unhide part. Haven’t figured out how to do it in all views yet but i have seen a node some time ago “getAll.Views” or something like that.

Hope someone can help.

schlueter

Hi @schlueter
You will find your solution here Hide all lines of a specific line style / texts of a specific text type

1 Like

@Kulkul

thanks alot. I googled and i found many posts similar to mine but haven’t found this one. The solution of @Mostafa_El_Ayoubi is a great and very small script.

Best is… at the last post i found the solution why my script is not working :D. So my guess with the elements was right.

The issue here is that you’re giving the view.hideelements strings instead of revit elements. This should work:

So i connected the “list.FilterByBoolMask” with the “All Elements of Category”. Everything is working now. /cheer

Almost all the topics of forum is stored in my brain. I just run a quick scan in my brain :smile:

Glad it helped :slight_smile:
Cheers!

1 Like

Ok almost finished with this thing.

Just one little question left.

I combiend the lists of “vag_hilfslinie” and the text notes “INTERN” and have a main switch for on and off. But thats just for the views. So i made another list of sheets in the project and combined them with the list of views. Looks great but if i now run the script its just working for the views.

So i switched the List.Join (first = sheets, second = views). Run the script again … tadaaa…

But why? Is it maybe because in the list of the views is a “null” and the node “view.hide.elements” stops working at this point of the list?

Revit- and dynamo-file attached:
hide-unhide.dyn (25.0 KB)Hide-unhide.rvt (2.8 MB)

Hope someone can explain this behavior to me.

schlueter

Someone?

I want to understand why it stops working after the list of views. :frowning:

schlueter