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
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.
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
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?