In average day working with the zenon Editor quite a few actions are required for each project. Actions like creating a default set of users, common drivers, default templates, etc. can be time consuming. Obviously these actions can be replaced and automated by use of VSTA-code in
the editor. But if
these actions are to be performed for each new project, it would be more efficient if the actions could be triggered in a more comfortable way: By use of the integrated Wizard dialog which pops up when creating a new project in zenon.
Integrating VSTA-Code into the wizard dialog
In order for VSTA-Code to be available in the wizard dialog the automation code
needs to be contained (implemented) into a Windows-Form. Additionally the Form needs to implement the following set of static functions (all without parameters):
static public string GetWizardName ()
Return the name of the wizard, displayed as “Name of the wizard” in the wizard dialog.
static public string GetWizardInfo ()
Return a description of the wizard, shown as “A more detailed description of the wizard.” in the wizard dialog.
static public string GetWizardCategory ()
Returns the category of the wizard, shown as “Wizard category” in the wizard dialog.
Note: An existing category can be used here. And a VSTA and a VBA wizard can reside in the same category.
static public bool IsZenOnWizard ()
This function determines whether the wizard should appear in the dialog. It offers the possibility to stop a wizard from appearing without having to delete all functions or removing it from the Addin.
static public int GetWizardVersion ()
This function returns the version number of the wizard, indicated next to the wizard information.
NOTE: It’s not allowed to have any functions with the same name inside of the wizard class, not even if their return type of parameter count is different from the “Wizard-Functions”. If all functions are correctly implemented and the Addin has been successfully compiled, the Form will appear in the wizard dialog.