the fair gds editor RemoveNonOrthogonalCellrefsMacro

Removes non Orthoginal Cellref Arrays Macro

This macro removes all non orthogonal Cellref Array. This kind of arrays cannot be stored in some file formats like OpenAccess.

Download: r_nonorthogonal.layout

   1 #!/usr/bin/layout
   2 #name=remove non orth. arrays
   3 #help=removes non orthoginal cellref arrays
   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->isCellrefArray() ){
  22 
  23                    
  24                    pointArray pa= l->thisElement->getPoints();
  25                 if (pa.point(1).y()!=0) l->thisElement->selectAll();
  26                 if (pa.point(2).x()!=0) l->thisElement->selectAll();
  27                 }
  28            }
  29            l=l->nextElement;
  30        }
  31 
  32     //round all selected elements
  33     cells->thisCell->flatSelect();
  34     cells->thisCell->deselectAll();
  35     }
  36     cells=cells->nextCell;
  37   }
  38 }

See also


CategoryMacro


RemoveNonOrthogonalCellrefsMacro (last edited 2017-04-06 10:15:09 by JurgenThies)