Detect Duplicates / Auto Refresh

Use this forum to ask questions about how to do things in QCAD.

Moderator: andrew

Forum rules
Always indicate Operating system, QCAD version
Attach Drawing files, Screenshots
Post one question per topic.
Post Reply
User avatar
Husky
Moderator/Drawing Help/Testing
Posts: 2146
Joined: Wed May 11, 2011 9:25 am
Location: USA

Detect Duplicates / Auto Refresh

Post by Husky » Mon Aug 06, 2018 3:01 am

Hi,
what is the purpose of this switch? On/Off doesn't matter and changes to layer visibility or layer locks are also ignored. For what can I use it .... ?

Husky-2018.08.05-01.png
Husky-2018.08.05-01.png (20.76 KiB) Viewed 953 times
Work smart, not hard: QCad Pro

TSG
Premier Member
Posts: 174
Joined: Thu Oct 08, 2015 9:39 am
Location: Germany, Lower Saxony

Re: Detect Duplicates / Auto Refresh

Post by TSG » Mon Aug 06, 2018 11:21 am

When you change the option "Ignore Layer" and/or "Ignore Direction" the selection is automatically refreshed.
Otherwise you've to refresh manually.

regards Thomas

User avatar
Husky
Moderator/Drawing Help/Testing
Posts: 2146
Joined: Wed May 11, 2011 9:25 am
Location: USA

Re: Detect Duplicates / Auto Refresh

Post by Husky » Mon Aug 06, 2018 8:56 pm

Hi THomas - thanks but I have still trouble to understand that feature.
TSG wrote:
Mon Aug 06, 2018 11:21 am
When you change the option "Ignore Layer" and/or "Ignore Direction" the selection is automatically refreshed.
Auto Refresh is an extra Button. My understanding is that a ticked Auto Refresh will automatically detect changes in the result. It works in some cases but I don't understand why it isn't working in all cases.

Example: I have a drawing with an invisible layer (test drawing/I know there are duplicates!)
Start Detect Duplicates - it finds and listed the duplicates,
Now I turn the invisible layer to visible what means I should have more duplicates ...
... but the Detect Duplicate tool doesn't shows any changes. Same with locked layer. If I then restart Detect Duplicates the new duplicates are detected.
That is in my opinion not an "Auto Refresh". :(

duplicates.dxf
(159.01 KiB) Downloaded 17 times

TSG wrote:
Mon Aug 06, 2018 11:21 am
Otherwise you've to refresh manually.
There is no "manually" refresh - I've to restart the tool.
Work smart, not hard: QCad Pro

TSG
Premier Member
Posts: 174
Joined: Thu Oct 08, 2015 9:39 am
Location: Germany, Lower Saxony

Re: Detect Duplicates / Auto Refresh

Post by TSG » Tue Aug 07, 2018 8:40 am

Hi Husky,

in my installation (3.21.1 on macOS) the tool menu looks like this:
Werkzeug Doppelte Linien.jpeg
Werkzeug Doppelte Linien.jpeg (18.04 KiB) Viewed 907 times
As you can see there is an additional manual refresh button left to "Auto".
And it works like I said before when changing the options "Layer ignorieren" or "Richtung ignorieren".
You can try it with the attached example:
Hope it helps

regards Thomas
Attachments
Doppelte Linien.dxf
(103.47 KiB) Downloaded 19 times

User avatar
Husky
Moderator/Drawing Help/Testing
Posts: 2146
Joined: Wed May 11, 2011 9:25 am
Location: USA

Re: Detect Duplicates / Auto Refresh

Post by Husky » Tue Aug 07, 2018 9:02 am

TSG wrote:
Tue Aug 07, 2018 8:40 am
As you can see there is an additional manual refresh button left to "Auto".
Very interesting!!! :lol: :lol: :lol:
Have a look what you can find left to "Auto" in my version.

Husky-2018.08.07-04.png
Husky-2018.08.07-04.png (6.91 KiB) Viewed 902 times
Work smart, not hard: QCad Pro

TSG
Premier Member
Posts: 174
Joined: Thu Oct 08, 2015 9:39 am
Location: Germany, Lower Saxony

Re: Detect Duplicates / Auto Refresh

Post by TSG » Tue Aug 07, 2018 9:16 am

Indeed, in QCAD 3.21.2 the button is gone.
At this point only Andrew can help us.

By the way, I downgraded back to 3.21.1 because of the missing sorting in the layer pulldown menu.
As we see there are also other reasons to go back.

regards Thomas

PS: the button is still there. Only the toolbar icon is missing
Last edited by TSG on Tue Aug 07, 2018 9:54 am, edited 1 time in total.

TSG
Premier Member
Posts: 174
Joined: Thu Oct 08, 2015 9:39 am
Location: Germany, Lower Saxony

Re: Detect Duplicates / Auto Refresh

Post by TSG » Tue Aug 07, 2018 9:49 am

@Husky I can understand why you said in another thread you cannot understand the logic behind the tool "Detect Duplicates". Neither do I.

Example:
In a drawing with 6 identical lines one 3 different layers you have 1 original and 5 duplicates.
If you use the tool "Detect Duplicates" 5 duplicates are selected and you can erase them within the tool.
But how can you determine which line is the original that the tool will not select?
I thought that the original line is on the activated layer but that is not true even though it would be logical.

Has anybody an idea how I can determine the layer with the original line?

regards Thomas

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

Re: Detect Duplicates / Auto Refresh

Post by andrew » Tue Aug 07, 2018 9:58 am

TSG wrote:
Tue Aug 07, 2018 9:49 am
But how can you determine which line is the original that the tool will not select?
You cannot. By definition, there is no such thing as an original when it comes to duplicates. Having an original would imply that one of the lines is somehow linked to the others or marked as being more important than the others. This is not the case. All lines are created equal :wink:
TSG wrote:
Tue Aug 07, 2018 9:49 am
I thought that the original line is on the activated layer but that is not true even though it would be logical.
Can you please elaborate why you would consider a line on the current layer as being the original? What if there are multiple lines on the current layer?

TSG
Premier Member
Posts: 174
Joined: Thu Oct 08, 2015 9:39 am
Location: Germany, Lower Saxony

Re: Detect Duplicates / Auto Refresh

Post by TSG » Tue Aug 07, 2018 11:12 am

andrew wrote:
Tue Aug 07, 2018 9:58 am

... there is no such thing as an original when it comes to duplicates. Having an original would imply that one of the lines is somehow linked to the others or marked as being more important than the others. This is not the case. All lines are created equal :wink:
This is not completely true. QCAD selects from 6 "identical" lines only 5. So there is already one line on a specific layer that is something special.
Identical lines means only same coordinates for start and end point but they can be different in layer properties (thickness, line style, color ...)
example:
2 lines layer blue
2 lines layer black
2 lines layer red
I want to keep 1 line on the black layer. Of course I can lock the black layer but this is sometimes to much work because in a second step I've to unlock this layer black and lock all other "100" layers and start the tool for a second run only on layer black.
andrew wrote:
Tue Aug 07, 2018 9:58 am
Can you please elaborate why you would consider a line on the current layer as being the original?
I often got drawings which were elaborated by some other people (civil engineer, architect, process engineer ...). And they all created their own layers and copied some entities from other layers to their layers. And finally I got the drawing with thousands of double entities on different layers. The working speed slows down and I have to clean the drawing first.
When I delete the double entities without defining the original layer with the original entity it can happen e.g. that the double entities of the process engineer layers are deleted and the double entities of the architect layers are kept. If I later on want to use only the process engineer layers for my own purposes and erase or hide the architect layers it could happen that on the process engineer layers some entities are missed (because I deleted them previously as double entities). So I have to give the process engineer layers a priority. That means from all double entities in the drawing one entity on the process engineer layers will not be deleted.
andrew wrote:
Tue Aug 07, 2018 9:58 am
What if there are multiple lines on the current layer?
Same procedure as always: One line on the current layer is kept the others will be deleted.

regards Thomas
Last edited by TSG on Tue Aug 07, 2018 11:43 am, edited 3 times in total.

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

Re: Detect Duplicates / Auto Refresh

Post by andrew » Tue Aug 07, 2018 11:25 am

Unchecking "Ignore Layer" should do the trick for a first step to make sure every line only exists once per layer.

BTW: The "original" is completely arbitrary. The algorithm simply iterates through all entities and looks for duplicates. Whichever entity is discovered first is treated as "original".

I guess what you are asking for is a different tool / option to "prioritise" a layer. E.g. if there are multiple entities and one of them is on my prioritised layer, keep the one on the prioritised layer. As you can imagine this would lead to an even more complex tool, with an output that is even harder to understand than the current tool apparently is e_confused

TSG
Premier Member
Posts: 174
Joined: Thu Oct 08, 2015 9:39 am
Location: Germany, Lower Saxony

Re: Detect Duplicates / Auto Refresh

Post by TSG » Tue Aug 07, 2018 11:54 am

andrew wrote:
Tue Aug 07, 2018 11:25 am
I guess what you are asking for is a different tool / option to "prioritise" a layer. E.g. if there are multiple entities and one of them is on my prioritised layer, keep the one on the prioritised layer. As you can imagine this would lead to an even more complex tool, with an output that is even harder to understand than the current tool apparently is e_confused
From my point of view it is quite simple. You've got the first appearance of the later double entity and then n other entities. Now you look which layer has the priority (maybe the current layer or maybe one in the tool selected layer). This entity is excluded and the others are selected / deleted.
I can imagine that it is lightly more complicated to program but I can't imagine that is too complicated for you because you are my hero. :D


regards Thomas

User avatar
Husky
Moderator/Drawing Help/Testing
Posts: 2146
Joined: Wed May 11, 2011 9:25 am
Location: USA

Re: Detect Duplicates / Auto Refresh

Post by Husky » Tue Aug 07, 2018 8:30 pm

TSG wrote:
Tue Aug 07, 2018 11:54 am

Now you look which layer has the priority (maybe the current layer or maybe one in the tool selected layer). This entity is excluded and the others are selected / deleted.
My thinking was pretty similar ... :wink:

TSG wrote:
Mon Aug 06, 2018 11:21 am
When you change the option "Ignore Layer" and/or "Ignore Direction" the selection is automatically refreshed.
Otherwise you've to refresh manually.
Ok, thanks! After we solved the mystery of the missing Refresh Button I tested it again and I have still the same question!
Auto refresh is ticked and if I then make a layer visible (or unlock) Auto refresh will not recognize any additional duplicates. If I then use Refresh (manually) the duplicates are found. Where is the logic? I should never be in need to use Refresh when Auto Refresh is active or do I miss something?
Work smart, not hard: QCad Pro

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

Re: Detect Duplicates / Auto Refresh

Post by andrew » Wed Aug 08, 2018 10:50 am

Husky wrote:
Tue Aug 07, 2018 8:30 pm
I should never be in need to use Refresh when Auto Refresh is active or do I miss something?
Auto refresh refreshes the selection automatically when changing the options of the tool (tolerance, ignore layer, etc). It is in the nature of QCAD that you can do a million other things while a tool is running. Auto refresh does not cover any of those cases.

User avatar
Husky
Moderator/Drawing Help/Testing
Posts: 2146
Joined: Wed May 11, 2011 9:25 am
Location: USA

Re: Detect Duplicates / Auto Refresh

Post by Husky » Wed Aug 08, 2018 5:43 pm

Thanks.
Work smart, not hard: QCad Pro

Post Reply

Return to “QCAD 'How Do I' Questions”