Using the Scripting Interface with PowerShell

After you install eCADSTAR, it can be accessed using PowerShell scripts, without any additional preparation. The procedure is described below for using PowerShell scripts in eCADSTAR Library Editor, eCADSTAR Schematic Editor and eCADSTAR PCB Editor.

eCADSTAR Library Editor

To launch an instance of eCADSTAR Library Editor and execute an operation using a script, you must create a new object. This is done as follows.

                $app = New-Object -ComObject 'eCADSTAR.LibraryEditor.Application'
                $app.OpenDesign($libraryPath)

          

To connect to a running instance of eCADSTAR Library Editor, the following function must be called.

               $app = [Runtime.InteropServices.Marshal]::GetActiveObject('eCADSTAR.LibraryEditor.Application')

 

eCADSTAR Schematic Editor

To launch an instance of eCADSTAR Schematic Editor and execute an operation using a script, you must create a new object. This is done as follows.

 

                $app = New-Object -ComObject 'eCADSTAR.SchematicEditor.Application'
                $app.OpenDesign($designPath)

 

To connect to a running instance of eCADSTAR Schematic Editor, you must call the following function.

 

               $app = [Runtime.InteropServices.Marshal]::GetActiveObject('eCADSTAR.SchematicEditor.Application')

 

eCADSTAR PCB Editor

To launch an instance of eCADSTAR PCB Editor and execute an operation using a script, you must create a new object. This is done as follows.

 

              $app = New-Object -ComObject 'eCADSTAR.PCBEditor.Application'
              $app.OpenDesign($designPath)

 

To connect to a running instance of eCADSTAR PCB Editor, the following function must be called.

 

               $app = [Runtime.InteropServices.Marshal]::GetActiveObject('eCADSTAR.PCBEditor.Application')