Page 1 of 1

Access all selected objects from script

Posted: Mon Jun 03, 2013 1:24 pm
by jalonsor
Hello,
i am newbie in qcad scripting. Reading some examnples i formed an idea of how does the scripts work.

I would like to access all selected items (array or list) in the current draw and i can not find an object or method to query selected items. Any help?, please

Thank you very much

Re: Access all selected objects from script

Posted: Mon Jun 03, 2013 2:44 pm
by andrew
var document = this.getDocument();
var ids = document.querySelectedEntities();
For a complete example, please refer to scripts/Modify/Reverse/Reverse.js or other modification tools that work on a selection.

Re: Access all selected objects from script

Posted: Mon Jun 03, 2013 8:43 pm
by jalonsor
Thank you very much and best regards Andrew.