Files
obsidian-excalidraw-plugin/ea-scripts/Change shape of selected elements.md
2022-01-24 14:49:23 +08:00

625 B

/*

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

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

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