Draft Layers

Info about new community or project announcements, implemented features, classes, modules or APIs. Might get technical!
PLEASE DO NOT POST HELP REQUESTS OR OTHER DISCUSSIONS HERE!
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
User avatar
yorik
Founder
Posts: 13640
Joined: Tue Feb 17, 2009 9:16 pm
Location: Brussels
Contact:

Draft Layers

Post by yorik »

cross-posting https://forum.freecadweb.org/viewtopic. ... 81#p312581 here...

I tweaked a bit the Draft VisGroup today, and bingo, we have a layers system in FreeCAD!
Screenshot from 2019-06-05 18-42-49.png
Screenshot from 2019-06-05 18-42-49.png (227.33 KiB) Viewed 7125 times
It is now in master in git commit 5ee99ca4e

It's basically just an extension of the former Draft VisGroup tool, that has been renamed to Layer, since it's not a group anymore.

- You can add objects to/from layers by dragging them to/from the layers in the tree
- It doesn't remove objects from their groups, so an object can be both in a group and a layer. The layers system is fully independent
- Layers have an "OverrideChildren" property that you can set to False if you don't want to apply the layer colors to children
- If you turn a layer on/off, everything inside is turned on/off too
- Layers live in a special "Layers" group
- Brand new experimental feature: layer icons take the color of the layer! I'm not sure if this won't make things heavy, so let's keep an eye on it!

I had never played before with drag and drop support in python objects... Pretty cool, lots of possibilities...

I'lll let it live its life a little bit, if all goes well we can add support to it to the IFC and DXF importers.
User avatar
HakanSeven12
Veteran
Posts: 1481
Joined: Wed Feb 06, 2019 10:30 pm

Re: Draft Layers

Post by HakanSeven12 »

Good work :) I think layers must have its own window like this


images.png
images.png (12.02 KiB) Viewed 6556 times
User avatar
bitacovir
Veteran
Posts: 1570
Joined: Sat Apr 19, 2014 6:23 am
Contact:

Re: Draft Layers

Post by bitacovir »

Well done! I can't wait to try it...
The problem with a panel for the layers is there is no room for so many panels. I have no problem because I have a secondary screen on my desktop, but that is not the case for the general of people.
::bitacovir::
==================
One must be absolutely modern.
Arthur Rimbaud (A Season in Hell -1873)

Canal Youtube Grupo Telegram de FreeCAD Español

My personal web site
My GitHub repository
Mini Airflow Tunnel Project
User avatar
HakanSeven12
Veteran
Posts: 1481
Joined: Wed Feb 06, 2019 10:30 pm

Re: Draft Layers

Post by HakanSeven12 »

I'm not talking about a panel. I wanna see something like AutoCAD layers. We need a layer selector combo box in toolbars and a button that open layer menager windows. Maybe some extra buttons for general things. Like open all layers, close all layer or lock layers.
jmaustpc
Veteran
Posts: 11207
Joined: Tue Jul 26, 2011 6:28 am
Location: Australia

Re: Draft Layers

Post by jmaustpc »

yorik wrote: Wed Jun 05, 2019 10:00 pm I tweaked a bit the Draft VisGroup today, and bingo, we have a layers system in FreeCAD!
Great!
yorik wrote: Wed Jun 05, 2019 10:00 pm Brand new experimental feature: layer icons take the color of the layer! I'm not sure if this won't make things heavy, so let's keep an eye on it!
that is interesting!
User avatar
yorik
Founder
Posts: 13640
Joined: Tue Feb 17, 2009 9:16 pm
Location: Brussels
Contact:

Re: Draft Layers

Post by yorik »

HakanSeven12 wrote: Wed Jun 05, 2019 11:48 pm Good work :) I think layers must have its own window like this
images.png
That would be easy to do...
User avatar
HakanSeven12
Veteran
Posts: 1481
Joined: Wed Feb 06, 2019 10:30 pm

Re: Draft Layers

Post by HakanSeven12 »

yorik wrote: Thu Jun 06, 2019 2:31 pm That would be easy to do...
Also have this features will be good.
HakanSeven12 wrote: Thu Jun 06, 2019 6:20 am I'm not talking about a panel. I wanna see something like AutoCAD layers. We need a layer selector combo box in toolbars and a button that open layer menager windows. Maybe some extra buttons for general things. Like open all layers, close all layer or lock layers.
And when a layer selected from combo box the new objects must added automaticly to active layer.
User avatar
yorik
Founder
Posts: 13640
Joined: Tue Feb 17, 2009 9:16 pm
Location: Brussels
Contact:

Re: Draft Layers

Post by yorik »

We could modify the Draft autogroup system... I believe nobody ever used that feature, not even me :D
nic
Posts: 135
Joined: Thu Apr 18, 2019 1:14 pm
Location: France

Re: Draft Layers

Post by nic »

I just played with layers, and I think it's a great addition. It helps me to keep separated the structure of my geometry/project (groups) and the structure of what is displayed (layers).

I have a question though: is there a way to automatically create a layer with, let say, all the sketches?
User avatar
yorik
Founder
Posts: 13640
Joined: Tue Feb 17, 2009 9:16 pm
Location: Brussels
Contact:

Re: Draft Layers

Post by yorik »

We could modify the command so that, upon creation, it already swallows all selected objects. But I'm not sure it's such a good behaviour? Is it always what we'll want to happen?
Post Reply