TomK,
The Simple API is not really suited for scripting addons.
Addons are for example scripts that are triggered by a shortcut key sequence as do most QCAD tools, see:
https://www.ribbonsoft.com/archives/sho ... uts_en.pdf
Remark that there are not many free combinations left over.
tkyler wrote: ↑Sat Sep 16, 2023 1:18 pm
searching/browsing the API docs and simply can't figure out how (using QCAD simple API) to "get a handle to a selected object",
Not with the Simple API ... In general this works:
Code: Select all
var doc = this.getDocument();
var ids = doc.querySelectedEntities();
ids is now a list of ID's (if any) and you need to query these entities by their ID.
https://qcad.org/doc/qcad/3.0/developer ... 79a957c678
Any modification to these queried entities is not immediate, you need to cast them back to the drawing.
tkyler wrote: ↑Sat Sep 16, 2023 1:18 pm
I've killed enough time now to execute the RO command manually about 500 times
If all around the same point as explained later then you could rotated them as a multiple selection.
One doesn't have to rotate 500 entities one by one.

If each around an individual point then you need 'Alt-L or Alt-R (or some other modification key)' for each too.
Why inventing the wheel? The functions already exists ... F5 & F6.
Use a 30 degrees step and a shift multiplier x3 ... Shift F5 & Shift F6 is then 90 degrees CCW or CW.
The bounding box of an REntity type in variable 'entity' or 'e' or whatever the variable name is:
Methods with bounding boxes, see:
https://qcad.org/doc/qcad/3.0/developer ... r_box.html
The learning curve of scripting under QCAD can be steep.
Do not expect to have an overview of the vast QCAD API in the first 45 mins.
Similar topic:
https://www.qcad.org/rsforum/viewtopic. ... 273#p42035
Regards,
CVH