SNode first = context.getSelection().firstItem();
if(! (first instanceof SShape)) return;
SShape shape = (SShape) first;
if(shape instanceof SPath) return;
SPath path = shape.toPath();
SketchDocument.SketchPage page = context.getDocument().getCurrentPage();
page.remove(shape);
page.add(path);
context.redraw();
}