Announcements
Welcome to the Revit Ideas Board! Before posting, please read the helpful tips here. Thank you for your Ideas!
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Change active document

Change active document

In the Revit API there is the following function to set an document active in Revit.

 

application.OpenAndActivateDocument(file)

 

Problem is, it needs a filename but it seems unlogical, since the document is already openend. The normal way to get a filename is by using Document.Pathname.

 

But since people are using Revit Server, Bim 360 docs ect. the Document.Pathname is empty, so you can rely on it. That's why it would be hugely appriciated when the API would be expanded with a function like:

 

application.SetActiveDocument(Document)

 

Where you could pass a document instead of a filename.

 

2 Comments
Anonymous
Not applicable

In my case im trying to replicate the Edit Family command in our own dockable family browser.
Enabling Revits own "Edit Family" as a PostableCommand would solve it of course.
Or if application.SetActiveDocument(Document) could activate the inactive document which EditFamily returns.

Or if Document.OpenAndActivateDocument would accept a loaded Family as input.

DanielKP2Z9V
Advocate

I'm getting "The central server could not be reached." exception message when trying this method for opening another currently opened document from BIM360 - this doesn't seem to work.

 

Can this please be added to the API? I don't know how else can you work with multiple documents each with its own set of different views in revit - this is critical. And yes, I've tried workarounds and even if they worked (they didn't) this is a critical function, not something you want to hack, this ought to be an inherent part of the API.

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

Submit Idea