Revit MEP Forum
Welcome to Autodesk’s Revit MEP Forums. Share your knowledge, ask questions, and explore popular Revit MEP topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Open multiple views from project browser

20 REPLIES 20
Reply
Message 1 of 21
andkal
3503 Views, 20 Replies

Open multiple views from project browser

Hi
Is there a way to open at once multiple views selected in project browser?


• www.autolisps.blogspot.com - Productivity plugins for Autocad and Autocad MEP
• Autodesk AppStore
20 REPLIES 20
Message 2 of 21
RobDraw
in reply to: andkal

No.


Rob

Drafting is a breeze and Revit doesn't always work the way you think it should.
Message 3 of 21
hmunsell
in reply to: andkal

So you want to select multiple views in the project browser and have them all open at the same time?  as @RobDraw said... No....

 

You would have to select each view anyway, just double click when you select them. 

Howard Munsell
Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.

EESignature

Message 4 of 21
andkal
in reply to: hmunsell

Is there no plugin for this?
I found here something that should do the job :
http://revitaddons.blogspot.com/2017/05/free-openmultipleviews-open-selected.html

but it seems that they have removed it.


• www.autolisps.blogspot.com - Productivity plugins for Autocad and Autocad MEP
• Autodesk AppStore
Message 5 of 21
hmunsell
in reply to: andkal

nothing I know of. 

 

I'm curious though, how would you see a tool like that working? 

  1. select a view
  2. select additional views while hold CTRL
  3. right click 
  4. Open
  5. ???

 

Howard Munsell
Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.

EESignature

Message 6 of 21
andkal
in reply to: hmunsell

1) select multiple views with ctrl or shift
2) rightlick - > open

In large projects i could end up badly when by mistake somebody opens 100 views but for me with using it carefully it would be handy.


• www.autolisps.blogspot.com - Productivity plugins for Autocad and Autocad MEP
• Autodesk AppStore
Message 7 of 21
hmunsell
in reply to: andkal

that's kind of what I though. hopefully someone will see this and maybe develop somthing or know of somthing to point you to. 

Howard Munsell
Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.

EESignature

Message 8 of 21
RobDraw
in reply to: andkal

Until something is available, you can use the project browser to group those views together for easy picking.


Rob

Drafting is a breeze and Revit doesn't always work the way you think it should.
Message 9 of 21

Hey, i think is not possible from Revit, but it can be done with the Revit API.

Paste this code inside the Python Script node, on Dynamo:

import clr

clr.AddReference("RevitAPI")
import Autodesk
from Autodesk.Revit.DB import *

clr.AddReference("RevitServices")
import RevitServices
from RevitServices.Persistence import DocumentManager

doc = DocumentManager.Instance.CurrentDBDocument
uiapp = DocumentManager.Instance.CurrentUIApplication
uiDoc = uiapp.ActiveUIDocument
app = uiapp.Application

ids = uiDoc.Selection.GetElementIds();
views = list()

for v in ids:
	uiDoc.RequestViewChange(doc.GetElement(v))

 

As you can see in the image, there is a boolean node. This is just to refresh dynamo in the case you run the script and nothing happen.

franciscopossetto_1-1613578469429.png

 

 

To run the script:

1. Select the views you want to open from the Project Browser.

2. Run the script.

* If nothing happen, modify the boolean value, and run it again.

 

The views should be opened.

 

I have attached the dyn file. The script was done on Revit 2020. 

 

I hope it helps,

Kind regards.

Github:
https://github.com/franpossetto
Message 10 of 21

@andkal and there you go.... 😂.

 

Give what @franciscopossetto provided a try and let us know how it works.

Howard Munsell
Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.

EESignature

Message 11 of 21
andkal
in reply to: franciscopossetto

I created a 2-node script in dynamo according to your instructions and it works but only once.
I somehow cannot repeat this action when I click Run again to open other selected views


• www.autolisps.blogspot.com - Productivity plugins for Autocad and Autocad MEP
• Autodesk AppStore
Message 12 of 21
franciscopossetto
in reply to: andkal

It was working on my side, but after run it a couple of times I had the same error.

I added 2 lines on the Python script. Please replace the old code.

import clr

clr.AddReference("RevitAPI")
import Autodesk
from Autodesk.Revit.DB import *

clr.AddReference("RevitServices")
import RevitServices
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager

doc = DocumentManager.Instance.CurrentDBDocument
uiapp = DocumentManager.Instance.CurrentUIApplication
uiDoc = uiapp.ActiveUIDocument
app = uiapp.Application
ids = uiDoc.Selection.GetElementIds();

for v in ids:
	uiDoc.RequestViewChange(doc.GetElement(v))

TransactionManager.Instance.ForceCloseTransaction()

 

It is working on my side now, but let me know if it doesn't work as you expect. I will do some more tests.

 

Kind regards.

Github:
https://github.com/franpossetto
Message 13 of 21
andkal
in reply to: franciscopossetto

still the same problem


• www.autolisps.blogspot.com - Productivity plugins for Autocad and Autocad MEP
• Autodesk AppStore
Message 14 of 21
iainsavage
in reply to: andkal

I know I’ve joined this late and I’m maybe going to approach this from the wrong angle but you mentioned opening 100 views at once - why would you want to do that? What are you going to be doing that needs so many views open simultaneously? How do you view them all at once?
I wouldn’t normally open more than about 5 or 10 views max at a time and it only takes seconds to achieve.

Just an opinion, feel free to ignore me.

Message 15 of 21
andkal
in reply to: iainsavage

Hello
By being careful with this tool I ment  to watch out not to open 100 views at once, but only a few.


• www.autolisps.blogspot.com - Productivity plugins for Autocad and Autocad MEP
• Autodesk AppStore
Tags (1)
Message 16 of 21
iainsavage
in reply to: andkal

So if you are only opening a few, is it a big deal to just open them one after the other?

Message 17 of 21
andkal
in reply to: iainsavage

As for me - any improvement is wellcome. If there was such function im sure the users would use it, not avoid it.


• www.autolisps.blogspot.com - Productivity plugins for Autocad and Autocad MEP
• Autodesk AppStore
Message 18 of 21
franciscopossetto
in reply to: andkal

Hey,

 

I built the tool using C# and works much better than the Dynamo script. I've added it in a open-source solution that I am working on.
https://github.com/franpossetto/Nina

 

You can download the installer directly from this link.
https://github.com/franpossetto/Nina/releases/latest/download/Nina.msi

 

I hope this time works.

Kind regards.

Github:
https://github.com/franpossetto
Message 19 of 21

Sadly, the installer seems to be offline. Could the python version not be included into pyrevit? Just copying it over into pyrevit however did not do the trick. Pyrevit must be very different from DynPython ;-).

Message 20 of 21

Hey,

 

Thanks for the heads-up. The link has been fixed. The previous link should work:

https://github.com/franpossetto/Nina/releases/latest/download/Nina.msi

 

And in case I break the link again, all the versions are here:

https://github.com/franpossetto/Nina/releases

 

The issue was that I changed the Installer name, so the URL was broken because it cannot find the .msi file.

 

I think the python code should work on pyRevit making some small modifications. Let me check it and I can send you the script as well.

 

I hope it helps,

Kind regards!

Github:
https://github.com/franpossetto

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Forma Design Contest


Autodesk Design & Make Report