Files
obsidian-excalidraw-plugin/ea-scripts/Change shape of selected elements.md
Zsolt Viczian 7055f08c35 1.5.21
2022-01-23 15:22:30 +01:00

550 B

/*

The script allows you to change the shape of selected Rectangles, Diamonds and Ellipses.

*/
const shapes=["ellipse","rectangle","diamond"];
elements = ea.getViewSelectedElements().filter(el=>shapes.contains(el.type));
newShape = await utils.suggester(shapes, shapes);
if(!newShape) return;

elements.forEach(el=>el.type = newShape);
ea.copyViewElementsToEAforEditing(elements);
ea.addElementsToView();