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!
User avatar
yorik
Site Admin
Posts: 11400
Joined: Tue Feb 17, 2009 9:16 pm
Location: São Paulo, Brazil
Contact:

Draft Layers

Postby yorik » Wed Jun 05, 2019 10:00 pm

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 1996 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
Posts: 264
Joined: Wed Feb 06, 2019 10:30 pm

Re: Draft Layers

Postby HakanSeven12 » Wed Jun 05, 2019 11:48 pm

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


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

Re: Draft Layers

Postby bitacovir » Thu Jun 06, 2019 12:16 am

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)

My Blog
Mini Airflow Tunnel Project
User avatar
HakanSeven12
Posts: 264
Joined: Wed Feb 06, 2019 10:30 pm

Re: Draft Layers

Postby HakanSeven12 » 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.
jmaustpc
Posts: 9536
Joined: Tue Jul 26, 2011 6:28 am
Location: Australia

Re: Draft Layers

Postby jmaustpc » Thu Jun 06, 2019 1:20 pm

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
Site Admin
Posts: 11400
Joined: Tue Feb 17, 2009 9:16 pm
Location: São Paulo, Brazil
Contact:

Re: Draft Layers

Postby yorik » Thu Jun 06, 2019 2:31 pm

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
Posts: 264
Joined: Wed Feb 06, 2019 10:30 pm

Re: Draft Layers

Postby HakanSeven12 » Thu Jun 06, 2019 4:33 pm

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
Site Admin
Posts: 11400
Joined: Tue Feb 17, 2009 9:16 pm
Location: São Paulo, Brazil
Contact:

Re: Draft Layers

Postby yorik » Fri Jun 07, 2019 3:56 pm

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

Re: Draft Layers

Postby nic » Mon Jun 10, 2019 8:25 am

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
Site Admin
Posts: 11400
Joined: Tue Feb 17, 2009 9:16 pm
Location: São Paulo, Brazil
Contact:

Re: Draft Layers

Postby yorik » Mon Jun 10, 2019 7:26 pm

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?