HELP! Activate multiple views on multiple sheets

I have over 300 sheet for a project that I am working on. I have to change all of the framing because of revisions.

I want to Activate View for all of the viewports with the “Bill of Material” title in the entire project at once.

I am very new to Dynamo. How do I create this?

what do you mean by “Activate View”? Like the same result after double click the viewport?

yes, that is what I mean

( I ultimately want to “Refresh” all of my Bill of Material viewports for sheets D-6000 to D-6200 at once.
I currently have to open each individual sheet, activate my Bill of Material viewport, then refresh view. This is very time consuming.)


Slightly modifying this…

Means I can edit the python to get a different PostableCommend Enumeration…

Which seems to work…

PostableCommandEnumeration.dyn (3.7 KB)

import clr

import RevitServices
from RevitServices.Persistence import DocumentManager
doc = DocumentManager.Instance.CurrentDBDocument
uidoc = DocumentManager.Instance.CurrentUIDocument
uiapp = DocumentManager.Instance.CurrentUIApplication

import Revit
from Autodesk.Revit.DB import *
from Autodesk.Revit.UI import *
from System.Collections.Generic import HashSet

def tolist(obj1):
if hasattr(obj1,'__iter__'): return obj1
else: return [obj1]

# IN variables...
run = tolist(IN[0])[0]
elems = tolist(UnwrapElement(IN[1]))

# Main Code...
if run:
# Get ElementIds to list...
elemIds = HashSet[ElementId]([e.Id for e in elems])
# Set Selection (required for the postable command)...

# Get RevitCommandId of PostableCommand...
rvtComId = RevitCommandId.LookupPostableCommandId(PostableCommand.ActivateView)
# Run PostableCommand...

OUT = 'Command Has Run'
OUT = 'Please set Run to True';

Hope that helps,


1 Like

Can you post a video of you doing this step by step? I do not see “Pick Model Elements” in Library

Postable commands can’t really be run more than once.

Wouldn’t it be easier to just delete it and put it back on in the same place?

“It” as in the Bill of Material Viewport?

Hey Keisha,

I presumed you’d feed a list of views filtered by name…

However, Daniel knows more than me and his idea sounds like a better method…

How about you refresh 1… Grab the locations of the out of date ones, delete them and replace with duplicates of the refreshed one? If that makes sense?



Just out of curiousity Daniel, I tried putting the command inside a transaction then tried looping with a range… It gave the ‘not supporting more than one command error’ but shouldn’t this be doing multiple ‘commands’?

Any advice welcome :slight_smile:


   # Run PostableCommand...
    	for r in range(len(elemIds)):

Nope, postable commands cannot be run more than once as far as I’m aware, so looping will not work I’m afraid. In fact, I don’t even think you can daisy chain them in the Dynamo graph, although I haven’t tested thoroughly as I try to avoid Postable Commands if I can.

Perhaps you could use the TransactionManager.Instance.ForceCloseTransaction() and put the transaction in your loop rather than outside but I think this will also fail.

You are correct, it fails in a daisy chain as well as inside a transaction which is then looped.

I only questioned it as there are hundreds of commands which we otherwise need work around’s for.



Yup, I thought it might. Postable commands are really a last resort, and generally not really meant to be used like this.

The method of getting the viewport (inc location and view), deleting viewport and replacing is probably the best solution.

What type of view is it?

Each sheet has a different “Bill of Material”. I use a program called StrucSoft MWF to frame walls and it generates the “Bill of Material” once we create the shop drawings. If the framing in the walls change I “Activate View” of one of the “Bill of Material” Viewport and use the StrucSoft program to “Refresh View”. This updates the “Bill of Material”. I want to figure out a way to “Refresh View” of all 200 different “Bill of Material” at once. Currently I have to open every single sheet, double click on that particular Viewport (there are 3 different viewports on each page), then “Refresh View”. Unfortunately, I don’t think the method you suggest in this instance will work.


I’m not sure what the plugin you mentioned is. But these views are in the project somewhere. Can these only be updated from within the sheet? If you delete one and undo, does it update?

Can we have a sample project to test with?


Maybe create a new View/Sheet and place a copy of all the Bill of Material on it, update there / all at once?


That is a great Idea!

I tried copying the Bill of Material onto a new sheet. It only updated for that one sheet instead of the entire project.

sooo!!! :slight_smile:
place copies of all of them with Dynamo
now you dont have to use all of the Sheets
what is that thing btw, a view yes, a schedule? filtered schedule?

1 Like

That is a great idea. I just found a video that walks me through the steps with Dynamo, thanks!