the fair gds editor TextRemoveMacro

Remove a certain text in the design

This macro remove all text elements from the design starting with a given text in line 22 of the macro.

Download: removeText.layout

   1 #!/usr/bin/layout
   2 #name=remove text
   3 #help=remove text "Generated with the LayoutEditor"
   4 
   5 int  main() {
   6   // get first cell
   7   cellList *cells=layout->drawing->firstCell;
   8 
   9   // loop over all cells
  10   while (cells!=NULL){  
  11    if (cells->thisCell!=NULL){
  12        // get first Element of this cell
  13        elementList *l=cells->thisCell->firstElement;
  14        cells->thisCell->deselectAll();
  15 
  16        // loop over all elements
  17        while (l!=NULL) {
  18              if (l->thisElement!=NULL) {
  19                 
  20                 
  21              if (l->thisElement->isText() ){
  22                 if (l->thisElement->getName().left(31)=="Generated with the LayoutEditor")
  23                    l->thisElement->selectAll();
  24                 }
  25            }
  26           l=l->nextElement;
  27      }
  28 
  29 
  30     cells->thisCell->deleteSelect();
  31     }
  32    cells=cells->nextCell;
  33  }
  34 }

See also


CategoryMacro


TextRemoveMacro (last edited 2015-07-16 09:01:41 by JurgenThies)