Table of Contents

ICadPluginApplication

from OpenCAD2D.Plugins import ICadPluginApplication

class ICadPluginApplication(System.Object) ยท ICadPluginApplication in the .NET reference

The entry point of a plugin that adds to the window, as AutoCAD's IExtensionApplication is: a public class with a public constructor that takes nothing, which the presenter makes once when the plugin is loaded and ICadPluginApplication.Initializes, so that the plugin adds its ribbon tabs and panels, Properties rows, DRAWINGS buttons and menu items, canvas menu items and object snaps to the CadPluginHost. ICadPluginApplication.Terminate runs when the plugin is unloaded or reloaded, or the presenter closes.

Methods

Initialize

.NET

def Initialize(self, host: CadPluginHost) -> None

Runs once, when the plugin is loaded, before any of its commands: the place to call the host's Add methods. What it adds is read when it returns. An exception it throws keeps the plugin's commands and drops everything it added, with a line in CadPlugin.Problems.

Terminate

.NET

def Terminate(self) -> None

Runs once when the plugin is unloaded or reloaded, or the presenter closes, before its commands go: the place to let go of what the plugin holds. An exception it throws is logged and the unload goes on.