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: 

WindowsForm dynamic update

3 REPLIES 3
Reply
Message 1 of 4
yafimski
446 Views, 3 Replies

WindowsForm dynamic update

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

3 REPLIES 3
Message 2 of 4
jeremytammik
in reply to: yafimski

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.

 



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

Message 3 of 4
yafimski
in reply to: jeremytammik

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?

Message 4 of 4
jeremytammik
in reply to: yafimski

No, I mean to say that you need to implement an external event as demonstrated by the sample I pointed out.

 



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  

Rail Community


Autodesk Design & Make Report