Access all selected objects from script

Discussion forum for C++ and script developers who are using the QCAD development platform or who are looking to contribute to QCAD (translations, documentation, etc).

Moderator: andrew

Forum rules

Always indicate your operating system and QCAD version.

Attach drawing files, scripts and screenshots.

Post one question per topic.

Post Reply
jalonsor
Registered Member
Posts: 2
Joined: Mon Jun 03, 2013 8:10 am

Access all selected objects from script

Post by jalonsor » Mon Jun 03, 2013 1:24 pm

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

User avatar
andrew
Site Admin
Posts: 9037
Joined: Fri Mar 30, 2007 6:07 am

Re: Access all selected objects from script

Post by andrew » Mon Jun 03, 2013 2:44 pm

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.

jalonsor
Registered Member
Posts: 2
Joined: Mon Jun 03, 2013 8:10 am

Re: Access all selected objects from script

Post by jalonsor » Mon Jun 03, 2013 8:43 pm

Thank you very much and best regards Andrew.

Post Reply

Return to “QCAD Programming, Script Programming and Contributing”