Hi,
I've built a Windows Form in Revit, that displays some information on the project when a button is clicked.
So far, I've used the DocumentChanged() event to determine if something has changed since the last time I clicked the button.
What I'd like to achieve is a Form where it allows to dynamically select and modify objects in Revit, and display the updated information in the Form, without having to exit and restart the Form.
My current Form is modeless, meaning it doesn't allow any actions in Revit while it is active. I understand that I might need to use a modal form, but I'm not sure if that will allow me the same functionality.
I've tried reading the information about ExternalEvents and Modeless_Dialogue etc., but it's very hard for me to understand, and no matter how much I read into it I quickly get confused as to which method will help me achieve my goal.
Any advice? I'd appreciate even a direction on which specific things to read up on.
Thanks
If you want your form to remain open while at the same time continuing interaction with Revit independently of the form, it must indeed remain modeless, just as you have it now.
To obtain access to the Revit API from the modeless context, you need some way to enter a valid Revit API context. One such possibility is provided by the external event mechanism, demonstrated by the Revit SDK Sample ModelessDialog/ModelessForm_ExternalEvent.
Hi @jeremytammik,
Thanks.
Do you mean to say that in order to keep the Form open while I'm selecting objects, I need to start a Transaction, select/pick objects, and then Commit the transaction to return back to the Form and update it?
No, I mean to say that you need to implement an external event as demonstrated by the sample I pointed out.
Can't find what you're looking for? Ask the community or share your knowledge.