Hi,
I've created a form that lists all the worksets and the number of elements inside it. While opening the form I would also like to open Worksets window so that it can be displayed side by side.
How should I do this?
I tried using:
UIApplication uiApp = new UIApplication(this.Application); RevitCommandId cmdId = RevitCommandId.LookupPostableCommandId(PostableCommand.Worksets); if (uiapp.CanPostCommand(cmdId)) uiapp.PostCommand(cmdId);
but the worksets window opens after the form is closed.
Can anyone guide me on this?
Thanks,
I suggets you look at the worksharing API and implement the parts relevant to you in an own form. This way you gain full control, provided the necessary APIs are in place.
To achieve what you asked, you could either use a modeless window beforehand or post the worksharing command first and install a hook that opens a window after it has been created. There would however be only limited interactivity, since you will not be able to modify the model, as you cannot open a transaction from anything else than the UI thread. Even if you circumvent this problem, the result is guaranteed to look and behave strange. It is not even clear if the worksharing dialog updates the worksets instantaneously or only after you leave.
Can't find what you're looking for? Ask the community or share your knowledge.