fusion_addin_framework.FusionAddin

class fusion_addin_framework.FusionAddin(debugToUi: bool = True)

Entry point to create all your elements that will appear in the user interface.

Handles the creation of UI elements and deletes them (by calling the stop method).

Parameters

debug_to_ui (bool, optional) – Flag indicating if erorr messages caused by errors in the eventhandlers are displayed in a messageBox or not. Regardless of this flag all messages will get logged by the module logger. Defaults to True.

workspace(*args, **kwargs)

Creates a Workspace as a child of this Adddin.

Calling this method is the same as initialsing a Workspace with this addin instance as parent parameters. Therfore the same parameters are passed. See Workspace for a detailed description of the paramters.

Returns

The newly created or accessed Workspace instance.

Return type

Workspace

stop()

Stops the addin and deletes all created command and user interface related elements.

This methods needs to get called from the stop(context) function of the main file of your addin to ensure proper cleanup. If you dont call it, strange thigs can happen the next time you run the addin.

registerElement(elem: fusion_addin_framework.wrapper._FusionWrapper, level: int = 0)

Registers an instance of a _FusionWrapper to the addin.

All wrapper objects that are registered will get deleted if the addin stops. The order of the deletion is determind by the level. Instances with a higher level will get deleted first. All elements that are created will be registered by the framework internally, so THERE IS NO NEED TO USE THIS METHOD in noraml use of the framework.

Parameters
  • elem (_FusionWrapper) – The wrapper instance to register.

  • level (int, optional) – The Ui level of the element. Defaults to 0.

property debugToUi: bool

Flag indicating if erorr messages are displayed in a messageBox or only send to the module logger.

Type

bool

property uiLevel: int

The ui level ot the app. (Always 0)

Type

int

property addin

Itself. Kept for consistency with the other wrapper classes.

Type

FusionApp

property createdElements

A dictonary with all the created ui elemnts mapped by their ui level.

Type

Dict[int, List[FusionApp]]

Summary

Methods

registerElement(elem[, level])

Registers an instance of a _FusionWrapper to the addin.

stop()

Stops the addin and deletes all created command and user interface related elements.

workspace(*args, **kwargs)

Creates a Workspace as a child of this Adddin.

Attributes

addin

Itself.

createdElements

A dictonary with all the created ui elemnts mapped by their ui level.

debugToUi

Flag indicating if erorr messages are displayed in a messageBox or only send to the module logger.

uiLevel

The ui level ot the app.