Message 1 of 3
Best practice for AddIn command to be executed at regular interval?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello
I have a webAPI running on a server with the following endpoint : http://api.myserver.com/HasJob
I would like Inventor to poll this endpoint every 10 seconds in order to determine if there is a job for Inventor to do.
I have followed the examples in the SDK to create a C# AddIn that is loaded when Inventor starts.
Inventor.ApplicationEvents exposes many different events but I don't see a timer-based event. What would be the best-practice way for me to trigger my polling action every 10 seconds?
My idea so far it to :
- add a handler for the .ApplicationEvents.OnReady event during the StandardAddInServer.Activate() method called when Inventor is loading addIns.
- in my OnReadyEventHandler() set up a standard System.Windows.Forms Timer class to call my poll method. and set the interval to 10 seconds..
Is this considered to be best practice?
Regards
Dan
------------------------------------------------------------------------------------------------------------
Atkins Consultants Ltd UK
+19,000 staff (M&E, Civils, Structural, Geotechnical, Environmental and more)
Atkins Consultants Ltd UK
+19,000 staff (M&E, Civils, Structural, Geotechnical, Environmental and more)