Class Reference layers

Class with the global layer setup. More...

Member

void disableAllLayer()
int displayedLayers
void disableUnusedLayers(drawingField *design)
void enableAllLayer()
int findLayer(string layerName)
int findLevel(int i)
int globalVia()
void hideAllLayer()
void hideCurrentUnusedLayers(drawingField *d)
void hideUnusedLayers(drawingField *d)
bool importLayerSettings(string filename)
int layerMax()
layer num[layersMax]
int maxLevel()
void reset3dView()
void showAllLayer()
void technologyLayerAdd(int layer,int type)
int technologyLayerConductorSize(int layer)
int technologyLayerConductorSpaceing(int layer)
int technologyLayerGetParameter(int layer,int parnum)
int technologyLayerGetType(int layer)
void technologyLayerRemoveAll()
void technologyLayerSetParameter(int layer,int parnum,int value)
void technologyLevelFrom3d()

Detailed Description

graph LR ly(layers)--num-->lr(layer) click ly "/layoutscript/api/layers" click lr "/layoutscript/api/layer" classDef thisClas fill:#eaf5fc,stroke:#3c7faa,stroke-width:4px; classDef clas fill:#eaf5fc,stroke:#3c7faa,stroke-width:1px; class ly thisClas class lr clas

layers is the global layer table for every open layout window. Like setup it is a static class: you never construct it, and you cannot use it as a type. In a C++ macro the members are reached with the prefix layers::. Each layer is layers::num[i] for a number from 0 up to the internal maximum. displayedLayers is how many layer controls the dock and the menu show (default 128, up to 11000). showAllLayer, hideAllLayer, enableAllLayer and disableAllLayer change visibility or the dock list for the whole table. findLayer looks up a name and returns the lowest matching number, or -1. Technology helpers (technologyLayerAdd, technologyLayerSetParameter, findLevel, globalVia) describe vias and conductors for extraction and 3d. In Python the array num is not used; call layers.number(10) instead.

Example:

layers::num[5].name = "Layer Number 5";
layers::showAllLayer();
int poly = layers::findLayer("POLY");
if (poly >= 0)
 layers::num[poly].visible = true;
layers::disableUnusedLayers(layout->drawing);

In Python:

layers.showAllLayer()
layers.number(10).disable()
layers.number(9).name = "layer nine"

Member Function Documentation


static void layers::disableAllLayer()

Disables every layer. No shapes are drawn, and the layer dock lists none of them. Call enable on a layer for those you still need.


static int layers::displayedLayers

The highest layer number shown in the layer menu and the layer dock. The default is 128. Values up to 11000 are allowed; a very large number of controls can slow down start-up.


static void layers::disableUnusedLayers(drawingField *design)

Disables every layer that is not used in design.


static void layers::enableAllLayer()

Enables every layer from 0 to displayedLayers. The dock, the layer menu and the drawing all show those layers.


static int layers::findLayer(string layerName)

Searches for a layer named layerName. If several layers share the name, the lowest number is used.

Returns: that layer number, or -1 if layerName is not used.


static int layers::findLevel(int i)

Returns: the layer used for technology level i, or -1 if that level is unused.


static int layers::globalVia()

Returns: the layer used for global vias, or -1 if the technology setup has no global via.


static void layers::hideAllLayer()

Makes every layer invisible in the drawing. The layers remain in the menu and the dock, marked as invisible.


static void layers::hideCurrentUnusedLayers(drawingField *d)

Hides every layer that is not used in the cell currently displayed in d. After this, every still-visible layer is used in that cell.


static void layers::hideUnusedLayers(drawingField *d)

Hides every layer that is not used anywhere in design d. Unlike hideCurrentUnusedLayers, this searches all cells, not only the cell on screen.


static bool layers::importLayerSettings(string filename)

Loads layer settings from filename.

Returns: true if the settings were loaded, false if the file format is not supported.


static int layers::layerMax()

Returns: the number of layers in the LayoutEditor.


static layer layers::num[layersMax]

Array of layer objects. In C++ use layers::num[5]. In Python use number instead.


static int layers::maxLevel()

Returns: the number of technology levels in the current setup.


static void layers::reset3dView()

Turns off the 3d view of every layer and resets it.


static void layers::showAllLayer()

Makes every layer visible.


static void layers::technologyLayerAdd(int layer,int type)

Marks layer as a technology layer. If type is 1, the layer is a via. If type is 2, the layer is a conductor.


static int layers::technologyLayerConductorSize(int layer)

Returns: the conductor size if layer is a conductor layer, otherwise -1.


static int layers::technologyLayerConductorSpaceing(int layer)

Returns: the conductor spacing if layer is a conductor layer, otherwise -1.


static int layers::technologyLayerGetParameter(int layer,int parnum)

Returns: technology parameter parnum of layer.

Currently these parameters are used:

parnum: usage:
0 level of the layer. If level is set to -2 that layer is a global via.
1 conductor layer: width, via layer: size of the via
2 conductor layer: spaceing between two shapes, via layer: distance via edge - conductor at top layer
3 via layer: distance via edge - conductor at bottom layer
4 via layer: spacing between two vias
5 via layer: shape of the via with 0= square via, 1= round via/square conductor, 2= round via/conductor

static int layers::technologyLayerGetType(int layer)

Returns: the type of layer, using the same values as technologyLayerAdd.


static void layers::technologyLayerRemoveAll()

Clears the technology information of every layer.


static void layers::technologyLayerSetParameter(int layer,int parnum,int value)

Sets technology parameter parnum of layer to value. See technologyLayerGetParameter for the meaning of parnum.

Parameter:
layer layer number
parnum parameter index
value new value

static void layers::technologyLevelFrom3d()

Fills the technology level order (vias and conductors) from the current 3d settings.