Using the Scripting Interface with Visual Basic

The procedure is described below for adding the reference for the Type Library to a Visual Basic project. The procedure is also described for using Visual Basic scripts in eCADSTAR Library Editor, eCADSTAR Schematic Editor and eCADSTAR PCB Editor.

Referencing eCADSTAR

For the relevant eCADSTAR application, the following procedure describes how to add the reference for the Type Library to a Visual Basic project.

  1. When using Visual Studio, select Add > Reference… on the Project menu.
  2. Select COM > Type Libraries.
  3. Select the following.
  4. In eCADSTAR PCB Editor, select eCSPCBCOM.
  5. In eCADSTAR Schematic Editor, select eCSSCHCOM.

eCADSTAR Library Editor

 To launch a new instance of eCADSTAR Library Editor:

 

               Dim App As  Object
               App = CreateObject("eCADSTAR.LibraryEditor.Application")
               App.OpenLibrary(LibraryPath)

   

To connect to a running instance of eCADSTAR Library Editor:

 

               Dim App As  Object
               App = GetObject(, "eCADSTAR.LibraryEditor.Application")
               App.OpenLibrary(LibraryPath)

   

eCADSTAR Schematic Editor

To launch a new instance of eCADSTAR Schematic Editor:

 

               Dim App As  Object
               App = CreateObject("eCADSTAR.SchematicEditor.Application")
               App.OpenDesign(DesignPath)

 

To connect to a running instance of eCADSTAR Schematic Editor:

 

               Dim App As  Object
               App = GetObject(, "eCADSTAR.SchematicEditor.Application")
               App.OpenDesign(DesignPath)

 

eCADSTAR PCB Editor

To launch a new instance of eCADSTAR PCB Editor:

 

               Dim App As  Object
               App = CreateObject("eCADSTAR.PCBEditor.Application")
               App.OpenDesign(DesignPath)

 

To connect to a running instance of eCADSTAR PCB Editor:

 

               Dim App As  Object
               App = GetObject(, "eCADSTAR.PCBEditor.Application")
               App.OpenDesign(DesignPath)