Quantcast
Channel: All Revit API Forum posts
Viewing all articles
Browse latest Browse all 66702

Re: managing transaction in a function initiated from a modeless dialog

$
0
0

Dear Abba,

 

Thank you for your query.

 

Looking at the ModelessForm_ExternalEvent is the perfect answer to this question.

 

Lots more background information is provided in The Building Coder topic group on Idling and External Events for Modeless Access and Driving Revit from Outside:

 

http://thebuildingcoder.typepad.com/blog/about-the-author.html#5.28

 

You might want to start reading those posts from the end.

 

Scott, you mentioned your Idling event handler and custom task queue repeatedly in the past.

 

I would love to take a look at it!

 

Would you be willing to share it here with us?

 

Thank you!

 

By the way, I do not recommend using the Idling event except for one-off notifications, to get back into a valid Revit API context asap.

 

For continuous polling of events such as you describe, I rather recommend using an external event.

 

The disadvantage of the Idling event is the lack of control over the polling frequency. It is either 'once only' or 'as often as possible'. The latter hogs the CPUY and degrades performance.

 

With an external event driven by some external event or raised from a separate thread, you have total control over the polling frequency.

 

For an in-depth analysis and example, please refer to the FireRatingCloud sample:

 

https://github.com/jeremytammik/FireRatingCloud

 

Especially, the last few enhancements to implement the real-time BIM update:

 

http://thebuildingcoder.typepad.com/blog/2016/04/real-time-bim-update-with-fireratingcloud-2017.html

 

http://thebuildingcoder.typepad.com/blog/2016/04/real-time-bim-update-via-fireratingcloud-windows-client.html

 

I hope this helps.

 

Best regards,

 

Jeremy


Viewing all articles
Browse latest Browse all 66702

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>