Electric has the Bean Shell built into it. This enables you to load custom Java code that adds functionality to Electric. The Bean Shell is not part of the default Electric distribution. You must add it as a "plug in" (see Section 1-5 for more on plug-ins).
To run a script, use the Run Java Bean Shell Script... command (in menu Tools / Languages).
You can attach a script to the Tools / Languages menu by using the Manage Java Bean Shell Scripts... command. Scripts can have mnemonic letters assigned to them (see Section 1-9 for more on mnemonics). | ![]() |
Here are some example scripts in the Java Bean Shell. For more information about accessing the internals of Electric, read the Javadoc in the source code.
|
This example searches the current cell, printing all transistors and all exports that start with the letter "a".
Notice that Electric's "Export" object must be a fully-qualified name, because the name "Export" is used for other reasons in the Bean Shell. This also applies to Electric's "EPoint" class. |
|
This example creates a new cell, places a transistor in it, and displays the cell. |
|
This example goes a bit further: it creates a rotated transistor and a contact, wires them together, and exports the contact. The transistor is named "T1." |