fusion_addin_framework.utils.create_custom_event

fusion_addin_framework.utils.create_custom_event(event_id: str, action: Optional[Callable] = None, debug_to_ui: bool = False, generic_use: bool = False)adsk.core.CustomEvent

Creates and registers a custom event. The event is not associated with any command. The custom event gets removed and cleaned up when calling the addin.stop() method. If you dont instantiate a addin you need to clean up / unregister the event manually. Note that custom events can only be created from the command created handler. Otherwise calling them will have no effect.

Parameters
  • event_id (str) – The id of the event.

  • action (Call) – The action which gets executed from the handler. Must accept one argument for eventArgs which might get passed.

  • debug_to_ui (bool, optional) – Whether any errors appearing during execution of the action are displayed in messageBox. Defaults to False.

  • generic_use (boool, optional) – If you intend to use this event with the dynamic ‘execute_from_even’ functions set this to true. If this is set actiob must be None. Defaults to False.

Returns

The created CustomEvent.

Return type

adsk.core.CustomEvent