Selected items cannot be deleted by deleteSelect() function!
User LayoutEditorFull Saturday 11th May 2019Attachments: (only for registered users) select_bug2.gds
The following codes select 48 elements in my design (in attached GDS file) that I want to delete, but the deleteSelect() function cannot delete them as I want. This is another bug, I believe. Please correct it.
```
int main()
{
double chip_w=4500, chip_h=8200;
int i, j;
layout->open("select_bug2.gds");
layout->drawing->activeLayer=150;
for (i=0; i<2; i++)
{
for (j=0; j<4; j++)
{
layout->drawing->p(800+chip_w*j, 7440+chip_h*i);
layout->drawing->fSelect();
layout->drawing->p(800+955+chip_w*j, 7440+chip_h*i);
layout->drawing->fSelect();
layout->drawing->p(800+955+750+chip_w*j, 7440+chip_h*i);
layout->drawing->fSelect();
layout->drawing->p(800+955+750+750+chip_w*j, 7440+chip_h*i);
layout->drawing->fSelect();
layout->drawing->p(800+chip_w*j, 7440-225+chip_h*i);
layout->drawing->fSelect();
layout->drawing->p(800+chip_w*j, 7440-225-225+chip_h*i);
layout->drawing->fSelect();
layout->drawing->deleteSelect(); // <---- This function cannot delete the above selected items!!??
}
}
}
```
Jürgen LayoutEditorFull Saturday 11th May 2019
I can see any problem with the macro code. The line `layout->drawing->deleteSelect();` will select anything you have selected before. After execution of the macro there are no more selected shapes. What exactly happened, that you did not expect?
User LayoutEditorFull Sunday 12th May 2019
If you pay attention, you will see the selected 48 items are not deleted by the last line. Nothing happens to those items after executing the codes.
I want to delete them, but the codes doesn't do that.
Jürgen LayoutEditorFull Sunday 12th May 2019
I think i now understand what your problem is: With your macro you will select 48 shapes, but as you always have 3 identical shapes over each other, only one of these 3 shapes is selected and deleted. The other two shapes will remain and the design look like it does before, but the number of shapes in your design has reduced.
If you want to select/delete all shapes at the location, use a code like this:
```
layout->drawing->p(800+chip_w*j, 7440+chip_h*i);
layout->drawing->p(800+chip_w*j+100, 7440+chip_h*i+100);
layout->drawing->fSelect();
```
It will select all shapes with at least one point in the entered rectangle. The code you have used with one entered coordinate will exactly select one shape nearest to the given coordinate.
Jürgen LayoutEditorFull Sunday 12th May 2019
The feature *Strip identical Elements* located in the *shape utilities* may help you to remove these double or more exact triple shapes over each other.
User LayoutEditorFull Monday 13th May 2019
OK. So it's the bug in my design, not Layout Editor. Thanks!