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

OnStartup - Setting Workset

1 REPLY 1
Reply
Message 1 of 2
Anonymous
424 Views, 1 Reply

OnStartup - Setting Workset

I would like the workset dialog to open when a workshared file is opened.

 

Is this possible?

 

 

1 REPLY 1
Message 2 of 2
jeremytammik
in reply to: Anonymous

Sorry for the rather late answer  🙂

 

I just discovered this post, and other information that I thought I would add here in case others happen to encounter it as well.

 

A read-only workset API was introduced in Revit 2012:

 

http://thebuildingcoder.typepad.com/blog/2011/11/read-only-workset-api.html

 

The full read-write workset API was introduced in Revit 2015 R2:

 

http://thebuildingcoder.typepad.com/blog/2015/02/revit-2015-r2-and-the-read-write-workset-api.html

 

You can use the WorksetTable.SetActiveWorksetId method to activate a workset:

 

http://www.revitapidocs.com/2018.1/9f11d796-ca5c-93d9-51e1-67cf8da9baf2.htm

 

For more details on exactly what you can and cannot achieve with worksets while opening a document, please refer to this discussion in the Revit API discussion forum:

 

https://forums.autodesk.com/t5/revit-api-forum/openandactivatedocument-central-model-change-open-wor...

 

I hope this helps.

 

Oh, and re-reading your question again, I also assume that you might be able to use PostCommand in the DocumentOpened event to launch the built-in Revit workset dialogue on opening a model.

 

Best regards,

 

Jeremy



Jeremy Tammik
Developer Technical Services
Autodesk Developer Network, ADN Open
The Building Coder

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

Post to forums  

Autodesk DevCon in Munich May 28-29th


Rail Community