Page 1 of 1

Hierarchical layer list

Posted: Wed Nov 13, 2013 9:40 pm
by J-J
I just installed 3.4.3 and activated the hierarchical layer list. I really think it is a nice addition and the new presentation is quite neat and ergonomic: I like the way you moved the "eye" and the "lock" to the other side, now I won't click the lock accidentally...
Thanks for all that, keep-up the good work

Re: Hierarchical layer list

Posted: Wed Nov 13, 2013 10:00 pm
by andrew
Thanks for the encouragement!

I'm glad you like the new layer list. Please let me know if you experience any problems with it.
Otherwise, this will likely be the new default layer list for one of the next releases.

Re: Hierarchical layer list

Posted: Wed Nov 13, 2013 10:26 pm
by Husky
I agree with J-J ... yes, really nice additions! :D :D :D

But please allow me a question :oops:

Right now the tool "Purge unused layers" will not work if we have an empty layer between used layers. Is it possible to get a "Purge unused layers" tool which will also work in that particular scenario?

Re: Hierarchical layer list

Posted: Thu Nov 14, 2013 10:13 am
by Clive
Husky wrote:Right now the tool "Purge unused layers" will not work if we have an empty layer between used layers. Is it possible to get a "Purge unused layers" tool which will also work in that particular scenario?
Hi Husky, On my simple test it works!

1. 1 Parent layer set up 'Draw' and sub-layers - Draw 1, Draw 2 and Draw 3. Rectangle drawn on each layer except layer 'Draw 1'.
Purge layers 1.png
Purge layers 1.png (12.07 KiB) Viewed 18140 times
2. Layer > Purge Unused layers (YP). Unused layer 'Draw 1' deleted 8) .
Purge layers 2.png
Purge layers 2.png (9.06 KiB) Viewed 18140 times
So it works for me. maybe your scenario is different, please explain or attach a test case here.

Regards...Clive

Re: Hierarchical layer list

Posted: Thu Nov 14, 2013 10:35 am
by J-J
Hi Guys,
I confirm Clive's results, only parent layer, even if empty is not deleted, which is normal.

Re: Hierarchical layer list

Posted: Thu Nov 14, 2013 12:51 pm
by andrew
J-J wrote:only parent layer, even if empty is not deleted, which is normal.
Yes, that is expected behavior indeed. In fact, parent layers are quite often empty.

Husky: if you meant that, consider this example layer structure (attached image).
Layer 'walls', 'interior' and 'exterior' are likely empty. All walls are likely constructed on layers 'walls ... interior ... 20cm', 'walls ... interior ... 12cm', etc.

However, the purge tool should never delete layers 'walls', 'interior' and 'exterior' as long as there are non-empty sub-layers.
One could also say that if a layer has sub-layers which are being used, the layer itself is also used (indirectly).

Re: Hierarchical layer list

Posted: Thu Nov 14, 2013 7:31 pm
by Husky
andrew wrote:However, the purge tool should never delete layers 'walls', 'interior' and 'exterior' as long as there are non-empty sub-layers.
One could also say that if a layer has sub-layers which are being used, the layer itself is also used (indirectly).
Yep - considered from this angle - it makes sense! Thanks guys!

Re: Hierarchical layer list

Posted: Wed Dec 04, 2013 4:56 pm
by khad
Just enabled hierarchical layers, and the feature looks really nice so far... I especially like the name-based approach. I wrote a small tool for ACADr12 ages ago, which followed the same path (see pic). Of course, the integration in qcad is much more elegant than my old lisp script was, but it had a feature that I would really love to see:
The hierarchy was not based on a fixed delimiter (is " ... " borrowed form somewhere?), but configurable to a certain extent (I used a choice of "|, _,-,$" ), to cope mainly with xrefs and naming schemes like AIA and the like.
Better still would be to allow the delimiter to be freely specified (e.g., bound xrefs would require somenthing like "$0$").
Any chance to see this?

Re: Hierarchical layer list

Posted: Wed Dec 04, 2013 6:01 pm
by andrew
I had actually considered a configurable delimiter at one point.

"..." was chosen for two reasons:
- the visual appearance is acceptable in other contexts than the layer list (e.g. in combo boxes, as plain text, etc)
- it's unlikely to appear in existing drawings (much more unlikely than single characters such as '|' or '-')

A configurable delimiter has the disadvantage that a DXF file with hierarchical layers produced by user A will not show hierarchical layers for user B. By enforcing one approach for QCAD files, hierarchical layers are at least compatible among QCAD users. Users of other CAD systems will simply see a flat list of layers containing '...' as delimiters.

How about a conversion / import tool instead?
Something like 'make my layer list hierarchical, based on the assumption that I have used '|' (or any other sequence of characters) as delimiter'?

Re: Hierarchical layer list

Posted: Wed Dec 04, 2013 10:45 pm
by khad
Well, I see...
If the purpose is to give QCAD a unique way to create a layer tree, with minimal risk of perturbation and with the inner workings mostly hidden from the users, this makes sense (" . " would probably have been enough, though - I did not encounter this in layer names in 25 years, and it would look nicer when opened in other programs).
My approach was rather to have a versatile sorting filter to deal with all kind of (mostly xref) drawings. One of the wilder ideas I didn't implement anymore was an option to revert the token order, so that e.g. A-WALL-PATT would then be sorted as PATT-WALL-A. Probably too nerdy, I know.

Re: Hierarchical layer list

Posted: Thu Mar 10, 2016 1:32 pm
by andrew
dfriasb: your new and not directly related question was split into a new topic at: viewtopic.php?f=33&t=4053