I have created a script that renames all views based on Sheet Number, Detail Number and Title on Sheet. Although it falls over because its trying to also name the Legend views. How can i exclude legends from selection?
see script below.
I have created a script that renames all views based on Sheet Number, Detail Number and Title on Sheet. Although it falls over because its trying to also name the Legend views. How can i exclude legends from selection?
see script below.
Use a boolean mask with View.TypeIsLegend
from Clockwork.
Thanks @Nick_Boyts ,do you mind showing me where this fits in with my current script? never came accross boolean mask before.
Thanks again
A boolean mask takes a list of items and a list of booleans and separates the items based on whether their boolean was True or False (“in” meaning True and “out” meaning False.).
So in your case, you would use View.TypeIsLegend to check whether your views are legends or not (booleans). Then you can mask your view elements with that list of booleans to get the views that are legends and the views that are not.
View.TypeIsLegend within a code block?
@JamesP View.TypeIsLegend is a node from the Clockwork package. If you don’t already have installed, definitely install it! It has a lot of useful nodes. Search for “Clockwork” in the package manager
Thanks @awilliams i have now got the relevant nodes.
so i based my script on the one @Nick_Boyts did but im having the same problems. When running my script its still picking up legend views.
see below.
You’re not following the same setup as I showed in the example. The list input on FilterByBoolMask should be the views you checked. This will split the views into those that are a legend and those that aren’t. Then you can use the list of non-legend views as the input for your other nodes.
Great! Please mark the solution if you’ve got everything working properly so other users with similar trouble can use this thread as a resource.