RoboDK Forum
RoboDK API Register Event Handler可打印版本

+- RoboDK Forum (//www.sinclairbody.com/forum)
+-- Forum: RoboDK (EN) (//www.sinclairbody.com/forum/Forum-RoboDK-EN)
+--- Forum: RoboDK API (//www.sinclairbody.com/forum/Forum-RoboDK-API)
+--- Thread: RoboDK API Register Event Handler (/Thread-RoboDK-API-Register-Event-Handler)



RoboDK API Register Event Handler-joebgold-09-12-2022

Hello RoboDK,

I am looking to see if it is possible to have an external application register an event handler for actions in RoboDK? For example, when the user selects an object in RoboDK, is there any event that gets fired that the API could detect? My preference is to avoid sending constant messages to RoboDK checking what is currently selected by the user.

Kind Regards,

Joseph


RE: RoboDK API Register Event Handler-Albert-09-12-2022

It is possible to have a Robolink instance that listens to events. This example shows a proof of concept:
https://github.com/RoboDK/RoboDK-API/blob/master/Python/Examples/Macros/Event_Loop.py

There is an example with C# code as well.

This instance of Robolink should only be used for events. You can still create other Robolink instances to have normal access to the API.