Writing an add-in in Visual Basic .NET is basically the same as described in the topic "Creating add-ins in CSharp". The only difference is the source code syntax and the way the compiler is called.
Create a "VBAddInModule.vb" file with the following content:
| VB |
Copy Code
|
|---|---|
Public Class AddInModule Implements Eplan.EplApi.ApplicationFramework.IEplAddIn Public Function OnRegister(ByRef bLoadOnStart As System.Boolean) As Boolean _ Implements Eplan.EplApi.ApplicationFramework.IEplAddIn.OnRegister bLoadOnStart = True Return True End Function 'OnRegister Public Function OnUnregister() As Boolean _ Implements Eplan.EplApi.ApplicationFramework.IEplAddIn.OnUnregister Return True End Function 'OnUnregister Public Function OnInit() As Boolean _ Implements Eplan.EplApi.ApplicationFramework.IEplAddIn.OnInit Return True End Function 'OnInit Public Function OnInitGui() As Boolean _ Implements Eplan.EplApi.ApplicationFramework.IEplAddIn.OnInitGui Return True End Function 'OnInitGui Public Function OnExit() As Boolean _ Implements Eplan.EplApi.ApplicationFramework.IEplAddIn.OnExit Return True End Function 'OnExit End Class 'AddInModule |
|
Invoke the Visual Basic compiler (vbc.exe) with the following parameters:
For an action create the following source file and save it as "SimpleVBAction.cs" in your source directory. To create an action, we need a class that implements the IEplAction interface. For a more detailed explanation, see the "Actions" topic.
Now the compiler call needs to be slightly extended: