Electra

Electra

The main Electra namespace.

Methods

.createLayoutSymbol(lay_sym, opt) Returns: Promise.<T>

Create layout symbol and add to stencil

NameTypeDescription
lay_symVecta.Shape

Must be a group shape

optobject

Options object

NameTypeAttributesDefaultDescription
is_circlebooleanoptionalfalse

Indicate this layout is circle or not. Default to false

rotate_menubooleanoptionaltrue

Flag to insert horizontal/vertical menu to the layout. Default to true

nameStringoptional'Untitled Symbol'

The symbol name. Default to 'Untitled Symbol'

descStringoptional''

The symbol description.

permStringoptionalopt.name

The symbol permanent link. Default to symbol name.

stencil_idStringoptional

Stencil id. Will create a new stencil if not passed.

Examples:
var opt = {
     is_circle: false,
     rotate_menu: true,
     name: 'My Layout',
     desc: 'My description',
     perm: 'My Layout',
     stencil_id: ...

};

Electra.createLayoutSymbol(lay_sym, opt).then(function () {
    //Layout symbol created
});

.getRefShapes([ref]) Returns: Object

Get list of shape ids with the same reference

NameTypeAttributesDescription
refstringoptional

Reference to search

Returns:

ret List of shape ids by page ids. Structure is { pg_id: [shp_ids] }

.getSortedRefs() Returns: string[]

Get list of references on the drawing

Returns:

references List of references on the drawing

.getWireNameList() Returns: object

Get the list of wire names and their quantity for printing label stamps of wire names each wire connection from 1 symbol to another symbol will need 2 label stamps

Returns:

list List of wire names and their quantity. Example: { 'R1': 3 }

.searchNetwork(wire, scanned) Returns: Promise.<T>

Given a wire, we scan through all the wires and symbols that connected to it

NameTypeDescription
wireVecta.Shape

The wire that we want to scan

scannedobject

The list of wires that already scanned before, its structure is { wire_id: 1 }

Returns:

It resolved an object: 1. if the wire is already scanned previously, it resolve { scanned: true } 2. otherwise, it resolve { nets: { id: {object} }, shapes: [ {object} ] }

Electra Cloud