selection feature(s)

Please use this forum to post feedback and suggestions related to QCAD.

Moderator: andrew

Post Reply
LeoP
Active Member
Posts: 38
Joined: Sat Feb 13, 2010 12:01 pm

selection feature(s)

Post by LeoP » Mon Mar 01, 2010 3:00 pm

What would be really useful is a method to select entities by type, rather than by location or layer.

It could have a user interface like the snap command with buttons for the entity type to select, or like the line command with a drop-down box.

This would enable one to quickly select e.g. all texts in a drawing for subsequent attribute modification. Now one has to select each text individually if the texts are scattered over the drawing and layers...

LeoP
Active Member
Posts: 38
Joined: Sat Feb 13, 2010 12:01 pm

Post by LeoP » Mon Mar 01, 2010 3:02 pm

:oops: Wrong forum! Should be a QCAD suggestion...

[Edit: topic moved 16/06/2012]

adeetz
Registered Member
Posts: 1
Joined: Sun Jun 10, 2012 3:15 pm

Re: selection feature(s)

Post by adeetz » Sun Jun 10, 2012 3:38 pm

t could have a user interface ? :mrgreen:

User avatar
Clive
Moderator
Posts: 1329
Joined: Thu Aug 25, 2011 9:28 pm
Location: UK

Re: selection feature(s)

Post by Clive » Sat Jun 16, 2012 3:06 pm

LeoP wrote:What would be really useful is a method to select entities by type, rather than by location or layer.

It could have a user interface like the snap command with buttons for the entity type to select, or like the line command with a drop-down box.

This would enable one to quickly select e.g. all texts in a drawing for subsequent attribute modification. Now one has to select each text individually if the texts are scattered over the drawing and layers...
I agree although this post is over 2 years old its still very much valid - often I am in the same situation.
I have added a feature request for this:
http://www.ribbonsoft.com/bugtracker/in ... ask_id=630

One 'workaround' (which you may have found by now :?: ) which Andrew gave me is this:
1. Select everything first (Select All TA).
2. Go to > Property Editor > click on Selection and from the 'drop' down menu select the entity type e.g. Text.
3. Property Editor > layer > then click on the + button (Move Selection to a New Layer), now assign a new layer.
4. Go to new assigned layer and from there edit/modify your entities (in this case text).

As I say you probably know this by now - but its still a useful workaround for now for other users. :wink:

smf
Premier Member
Posts: 177
Joined: Tue Feb 28, 2012 1:05 pm

Re: selection feature(s)

Post by smf » Sat Aug 04, 2012 9:53 am

Thread start is long ago, but perhaps someone finds it useful: I implemented a widget to do this. See http://www.ribbonsoft.com/bugtracker/in ... ask_id=663 to download a small zip file. Any comment is welcome!

User avatar
Clive
Moderator
Posts: 1329
Joined: Thu Aug 25, 2011 9:28 pm
Location: UK

Re: selection feature(s)

Post by Clive » Sat Aug 04, 2012 11:31 am

smf wrote:Thread start is long ago, but perhaps someone finds it useful: I implemented a widget to do this. See http://www.ribbonsoft.com/bugtracker/in ... ask_id=663 to download a small zip file. Any comment is welcome!
Hi Stefan
I`ve downloaded your widget to try out, but I can`t get it to run - I`m probably doing something wrong here :lol: , please could you outline the steps clearly to install and run. So this `daft' old fella can try it out on Win 7-64.

smf
Premier Member
Posts: 177
Joined: Tue Feb 28, 2012 1:05 pm

Re: selection feature(s)

Post by smf » Sat Aug 04, 2012 1:28 pm

Thanks for the try :D

As far as I know, you only have to copy the files into the correct directory - no special installation is required. I have:
/qcad/ - the qcad directory
/qcad/scripts/ - the qcad scripts directory
/qcad/scripts/MyTools/ - a new directory created below "scripts"
/qcad/scripts/MyTools/SelectWidget/ - a new directory created below "MyTools" named "SelectWidget" (this directory name must not be changed)

The three files reside inside ..../SelectWidget/ and should result in a new widget near the original PropertyEditor. If it does not appear, in the "view" menu there should be an entry "Select Widget" (unfortunately unordered and without suitable icon).

I hope this helps.

User avatar
Clive
Moderator
Posts: 1329
Joined: Thu Aug 25, 2011 9:28 pm
Location: UK

Re: selection feature(s)

Post by Clive » Sat Aug 04, 2012 2:25 pm

Right - OK, I did have the files set up properly, but I needed to set some permissions!

I can view this widget now but when I select e.g a line - both the Property Editor and the 'SelectWidget' show this but I can only use the property Editor.

I cannot independently use your widget, it doesn`t allow me to select or use any of the input fields.

The only difference I see with your widget is the addition of the radial buttons 'reduction to - by'.
Could these buttons be added directly to the property Editor instead of having another widget?

[Edit: I think your idea is great Stefan and maybe Andrew would consider introducing your addition to the current Property Editor]

smf
Premier Member
Posts: 177
Joined: Tue Feb 28, 2012 1:05 pm

Re: selection feature(s)

Post by smf » Sat Aug 04, 2012 5:11 pm

Thank you for trying it and for your feedback! :D

If you select only one entity, all fields in the Selection Widget should be disabled. If you select multiple entities, all fields for diverse properties should be enabled. If those are changed, the selection should be updated. For example 1) selecting a red and a yellow line, changing the color field in Select Widget should result in a changed selection, or 2) selecting a line and a text, changing the type field in Select Widget, should deselect either the line or the text.

Indeed most of the code is identical to the Property Editor. If there would be an option "reduce selection instead of modifying selected entities" a merge of Property Editor and Select Widget (most likely together with some fixes in my code) should be easy.

I would be pleased to receive further feedback! :D
Last edited by smf on Sat Aug 04, 2012 7:23 pm, edited 1 time in total.

User avatar
Clive
Moderator
Posts: 1329
Joined: Thu Aug 25, 2011 9:28 pm
Location: UK

Re: selection feature(s)

Post by Clive » Sat Aug 04, 2012 5:51 pm

Very good Stefan, I like it - now I`ve got my head around it. Very useful indeed :wink:

I`ll test it some more and give you some more feedback over the next day or so, I`ll test it on some bigger/complex files that I have!

smf
Premier Member
Posts: 177
Joined: Tue Feb 28, 2012 1:05 pm

Re: selection feature(s)

Post by smf » Sat Aug 04, 2012 7:30 pm

Unfortunately, at the moment my script is "a bit" slow :( for large selections. Checking the "closed"-property of polylines with appriate selection update took ~100 seconds for ~2000 selected entities. Probably my usage of the "eval"-statement slows things down, perhaps a callback-method instead of the eval-string would be faster. I'll try this out in a quiet moment.

I don't even know if this functionallity is best as widget (consumes valuable space) or as dialog (only useful if not used too often). What do you think?

smf
Premier Member
Posts: 177
Joined: Tue Feb 28, 2012 1:05 pm

Re: selection feature(s)

Post by smf » Sun Aug 05, 2012 8:07 am

The "eval" function is not the slow down master. :) I changed the eval to a callback, but the consumed time is nearly equal. For beautyness reasons, I will keep the callback variant. :D

Inside the following code snippet:

Code: Select all

    var entityIds = doc.querySelectedEntities();
    for (var es = 0; es < entityIds.length; ++es) {
        var id = entityIds[es];
        var e = doc.queryEntity(id);
        /* ... */
     }
I suspect the doc.queryEntity(id) taking reasonable time (using only the first entity every time the loop is executed in the twinkling of an eye).

So: is there a better way to get all selected entities than getting a list of ids and getting one after one (I don't need the id elsewhere)?

smf
Premier Member
Posts: 177
Joined: Tue Feb 28, 2012 1:05 pm

Re: selection feature(s)

Post by smf » Sun Aug 05, 2012 8:18 am

smf wrote: Inside the following code snippet:

Code: Select all

    var entityIds = doc.querySelectedEntities();
    for (var es = 0; es < entityIds.length; ++es) {
        var id = entityIds[es];
        var e = doc.queryEntity(id);
        /* ... */
     }
I suspect the doc.queryEntity(id) taking reasonable time (using only the first entity every time the loop is executed in the twinkling of an eye).
I was wrong. :oops: It was calling di.deselectEntity too often instead of calling di.delesectEntites once. :D Now it takes less than a second instead of ~100 seconds to process about 2000 entities. :D I will upload a new package to the bugtracker.

User avatar
Clive
Moderator
Posts: 1329
Joined: Thu Aug 25, 2011 9:28 pm
Location: UK

Re: selection feature(s)

Post by Clive » Sun Aug 05, 2012 8:38 am

Ok I will download it in a while and check it out.

User avatar
Clive
Moderator
Posts: 1329
Joined: Thu Aug 25, 2011 9:28 pm
Location: UK

Re: selection feature(s)

Post by Clive » Sun Aug 05, 2012 10:28 am

Your latest package (zip 4) is working better, I`ve tested this on quite a complex drawing and so far so good, yes much faster performance now.
smf wrote:I don't even know if this functionallity is best as widget (consumes valuable space) or as dialog (only useful if not used too often). What do you think?
I think that your effort here is commendable and this 'extra' much needed selection option is so very useful, I for one will use it :wink: I don`think it takes up too much space - for me its only a little button that I can click and bring up the little dialog window when I need to.
All you need to do now is design a little icon image for it :wink:

Post Reply

Return to “QCAD Suggestions and Feedback”