Custom Events are a mess

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I'll put together some demo code if I don't completely give up on custom events but here's what I've noticed that's wrong with them so far...
1. The simple act of calling app.registerCustomEvent(event_name) results in a runtime error... saying everything is OK?!? I can't work around this with a try-catch because i need the return value of the call so I can't actually use the custom event i just registered...
--------------------------- Error --------------------------- 3 : The event has been registered -------- Traceback (most recent call last): ... File "C:/Users/Ens/AppData/Local/Autodesk/webdeploy/production/49d03f9fc343664d5942b9c34209b4f6b73c6c2d/Api/Python/packages\adsk\core.py", line 2298, in registerCustomEvent return _core.Application_registerCustomEvent(self, *args) RuntimeError: 3 : The event has been registered --------------------------- Ok ---------------------------
2. registering a custom event before adding inputs to a control results in execute being invoked! Why would registering an event EVER result in execute!?!? This is a huge problem for my intended use (which mind you is trying to come up with a hack-around for group "inputs" triggering up to 3 preview calls (2 if the enable checkbox is disabled, 3 with it enabled) when expanding/collapsing when in fact NO previews should be generated).
3. This one is silly but (CustomEventArgs) args.firingEvent.name returns "CustomeEvent", I was hoping it would contain my custom event name, not a fixed string defined somewhere - broken (note the typo in the value!) and useless
Ya, i probably wont get around to making sample code for this - too frustrated with it for now... maybe tomorrow