Hooks and telemetry

So, I’ve just realized that my hook scripts do not send telemetry data to the server, I assume for a reason, because that would overlap the events system. However, I would really like to send custom commandresult from some of my hook scripts, especially from the ones which collect sync time and model opening times. Obviously, I haven’t checked the telemetry and requests system’s underlying, but is there any way to somehow force the hook script, to send commandresults to the server?

Currently hooks are not tied to the telemetry system but that’s an easy fix. I’ll add this (alongside commands/ and checks/ scripts) coming in the next release and will update this post. If you want to test this out before the next release Turn ON this option inside the pyRevit runtime code. Restart pyRevit and it should start sending telemery on hooks as well

[ OK ] 2020-11-27T22:55:53.3341Z "eirannejad" 20200826_1250(x64):277 (ironpython) [pyRevitDevTools.hooks.view-activated] code=0 info=map[]

Great, thank you!
If it is already a planned feature you should consider making it optional both on script and extension level, I mean one should be able to enable/disable it in the hook script itself, but the deafult behaviour could be set in the extension.json

1 Like