MacroDump

LayoutEditor Macro Dump

Any element of a design can be created manually with a macro however, entering all the necessary coordinates by hand is a painful task. To make it more simple, the LayoutEditor Macro Dump file format was created. Saving a file to LayoutEditor Dump will create a macro with all selected shapes. Calling this macro will create these elements again in a new design. Referred cells must already exist in the deisgn.

Macro Dump File Format

A dump file format is nothing more than a simple macro that can create elements. It uses headers which define some basic definitions and a section for each shape to be created. Here is an example of a dump macro file:

#!/usr/bin/layout
#name=dump macro file: example.dump.layout
#help=dump of selected shapes in cell example-cell

int main(){
 element *e;
 point p;
 pointArray pa;
 cell *cr;cell *c=layout->drawing->currentCell;
 if (c==NULL) {c=layout->drawing->addCell()->thisCell;}

 pa.resize(5);
 pa.set(0,43715,4850);
 pa.set(1,44830,4850);
 pa.set(2,44830,4950);
 pa.set(3,43715,4950);
 pa.set(4,43715,4850);
 e=c->addPolygon(pa,5);

 p.set(2750,980);
 e=c->addText(12,p,"Vdd");
 e->setWidth(0);
 e->setPresentation(0);
 e->scale(20);

 cr=layout->drawing->findCell("Pad");
 if (cr!=NULL) {
 p.set(1600,2600);
 e=c->addCellref(cr,p);
 e->rotate(90);
 }

}