Support Forum

Rotating a box using python scripting

Sema

Monday 30th November 2020
Hi, I am creating box elements using python, and am trying to rotate each box individually as a function of their position. I have tried element.rotate(angle), which did not have any effect. I tried to convert the structure to polygon, but failed to do so. Do you have any hints to do this. Thank you in advance. Sema
J├╝rgen
LayoutEditorFull
Saturday 5th December 2020
Please select the box that should be rotated and call *rotateSelect*, part of the cell class. This method will convert the box to a polygon when required. A c++ would look like this: ```cpp cell *c=layout->drawing->currentCell; c->selectAll(); // or just select the required box c->rotateSelect(35.6,point(234,678)); // ratation in deg and origin of rotation c->deselectAll(); ```