This is a workflow that I put together in order to re-organize our project’s browser structure. Previously the management team has asked everyone to create their “working” views, and assign a View Group and View Sub Group parameters to them in order to properly place them in the project browser.
While this assigns a View Group, making it obvious what is the purpose of the view, assigning a Sub Group dedicating it as “Building Section”, “Plan Detail” etc. proved to be “too much to ask”. Soon enough we had a whole bunch of redundant or unwanted Sub Groups. It seemed like everyone on the team wanted their own version of “Building Section” Sub Group, and I started to see some redundancy when Sub Groups like Wall Section and Detail Section started showing up in the browser. The longer this went on, the more difficult it was to find your views. On top of all that Sub Group business, every view was assigned (automatically by Revit) a category based on type. Soon enough we had views stored in this kind of drop down: Working>Building Section>Floor Plan>viewName. It made no sense.
I decided to at least try, and make it easier for everyone to find and manage their own views. Everyone was asked to add their initial as prefix to view name. I later used that to organize the Working section of the browser. Here’s how:
I usually run a View Schedule first, to get a good idea about what I am dealing with. I sort it by Sheet Number, View Group and View Subgroup adding a footer/header to View Group. Now with a quick glance at the schedule I can see what views are on sheets, which ones are working and which ones are unassigned and need to be fixed. Next thing I do is clean up the first block in schedule, that will include all unassigned views. Those are usually views that don’t have View Group assigned and are stored under “???” in a browser. If I see a view with a generic name, just delete it. If I see bunch of views that could potentially be Working views, then I can use Dynamo to assign a View Group:
First, we need to collect all views in the project. Normally I would use the Dynamo node Categories and then All Elements of Category, but that workflow doesn’t work:
Warning message is pretty clear. Since Templates are part of the View Category they are being “collected” when Categories node runs, however what All Elements of Category node does is tries to cast them to Element, and that is producing a warning. I wrote a quick workaround for that so that we can collect all views except Templates and Sheets since we wont need those. Here’s code:
This node will get us all views like so:
Next we need to do some filtering. First task is to extract all views that do not have a View Group parameter assigned (parameter is empty or contains empty string). We can do that using standard Dynamo nodes like this:
This is a pretty simple process where we first extract a parameter value for View Group from every returned View. Then we use Equals to compare it to empty string “” and finally use the resulting boolean list to filter out just the views that do not have View Group assigned.
Once we have that we can quickly move them to Working view by assigning that parameter:
This might cause a warning, since some of the views will not allow you to assign this parameter (it can be caused by a view template if View Group parameter is already “controlled” by a view template. one more reason could be a view type that will not allow you to assign a View Group parameter), but ones that didn’t throw an exception still worked, so we are good to go on.
Since this post was made I have updated the Get All Views node and now it supports extracting views by Category witch might help with the above warning. Please visit my download page to see an example of combining multiple outputs into one list that could be used here: Download Page
Next thing that we can do is to combine more than one boolean operation to further narrow down our search. In the opening paragraph I discussed the shortcomings of the system that we had established, and how I wanted to use Dynamo to quickly remedy it. Here’s a few examples of one user (initials JK), stashing his/her views under various Sub Groups.
I wanted to eliminate that, and make them be all stored under Sub Group named after that particular user. Revit sorts views into types anyways so why be redundant. This is a two step process: First we filter by Group, then by Sub Group and finally assign a new Sub Group parameter.
You can see that this set up first filters for all views in 03 Working then checks if View Name starts with an initial “JK”, and finally overrides Sub Group parameter to a new one called “! JK”. This will group all these views together like so:
Obviously there are unlimited number of combinations that you can use to selectively work through all of the views, and organize them in a more comprehensive fashion. If you come up with few more of these feel free to drop me a line.
Get All Views node will make it to Package Manager as part of the archi-lab tools, but in the meantime you can just use the raw code and Python node. Also, let me know if there is some special functionality that you are missing with this node and i will add it in.