Access all selected objects from script

Discussion forum for contributors and developers who are using the QCAD version 3 ECMAScript development platform or the C++ plugin interface or who are otherwise looking to contribute to QCAD (translations, documentation, etc).

Moderator: andrew

Access all selected objects from script

Postby 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
jalonsor
Registered Member
 
Posts: 2
Joined: Mon Jun 03, 2013 8:10 am

Re: Access all selected objects from script

Postby 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.
User avatar
andrew
Site Admin
 
Posts: 2617
Joined: Fri Mar 30, 2007 6:07 am

Re: Access all selected objects from script

Postby jalonsor » Mon Jun 03, 2013 8:43 pm

Thank you very much and best regards Andrew.
jalonsor
Registered Member
 
Posts: 2
Joined: Mon Jun 03, 2013 8:10 am


Return to QCAD 3 Developers and Contributors

Who is online

Users browsing this forum: No registered users and 1 guest