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!
nic
Posts: 136
Joined: Thu Apr 18, 2019 1:14 pm
Location: France

Re: Draft Layers

Post by nic »

Probably not, and it wouldn't help with the problem: "collect all {obj} and put them in a layer", {obj} being one of {sketches, walls, part, whatever}.
User avatar
bitacovir
Veteran
Posts: 1570
Joined: Sat Apr 19, 2014 6:23 am
Contact:

Re: Draft Layers

Post by bitacovir »

In my case, the layer's icon doesn't show any color.
FreeCAD_2019-06-11_10-51-30.png
FreeCAD_2019-06-11_10-51-30.png (26.79 KiB) Viewed 2618 times
Also, one question. How do you create a new layer in the Layers group?
OS: Windows 10 (10.0)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.16945 (Git)
Build type: Release
Branch: master
Hash: d818a9638424a934bd9da74d187a1af4cb773f05
Python version: 3.6.8
Qt version: 5.12.1
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: English/Australia (en_AU)
::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
yorik
Founder
Posts: 13659
Joined: Tue Feb 17, 2009 9:16 pm
Location: Brussels
Contact:

Re: Draft Layers

Post by yorik »

Layers go automatically into the layer group.
I found that the tree doesn't request new icons all the time. Only at certain moments, for ex. when hiding/showing layers. Not sure yet how to attack that issue...
User avatar
Chris_G
Veteran
Posts: 2598
Joined: Tue Dec 31, 2013 4:10 pm
Location: France
Contact:

Re: Draft Layers

Post by Chris_G »

Hi Yorik,
I am glad to see Layers implemented.
I made an experiment about this.
I have not been able to solve the "update icon" issue.
It would be really great to be able to force icon update.
This little icon is a very "UX friendly" way to communicate some information to the user.
I suppose it means something like adding a "updateIcon" method to the viewprovider ???
I have never been much outside PartWB code, so I don't know all the mechanics up there :D .
User avatar
yorik
Founder
Posts: 13659
Joined: Tue Feb 17, 2009 9:16 pm
Location: Brussels
Contact:

Re: Draft Layers

Post by yorik »

Oh wow, I hadn't seen you had done something similar...
Will have a better look, there might be stuff to merge between the two.

For the icons, basically, the getIcon() method accepts two possibilities: a file path to an image, or XPM data. So I made another function that produces an XPM icon, simply by "drawing" it with Qt painting tools: https://github.com/FreeCAD/FreeCAD/blob ... er.py#L211
and then caching the XPM data so the getIcon() can serve it when needed without the need to recalculate it.

But indeed I haven't been able to force an icon recompute...
User avatar
wandererfan
Veteran
Posts: 6309
Joined: Tue Nov 06, 2012 5:42 pm
Contact:

Re: Draft Layers

Post by wandererfan »

yorik wrote: Sun Jun 16, 2019 3:02 am But indeed I haven't been able to force an icon recompute...
Don't have a Python example, but here is how I change the icon for the various dimension types. Might spark something for you.

Code: Select all

void ViewProviderDimension::updateData(const App::Property* p)
{
    if (p == &(getViewObject()->Type)) {
        if (getViewObject()->Type.isValue("DistanceX")) {
            sPixmap = "TechDraw_Dimension_Horizontal";
        } else if (getViewObject()->Type.isValue("DistanceY")) {
            sPixmap = "TechDraw_Dimension_Vertical";
        } else if (getViewObject()->Type.isValue("Radius")) {
            sPixmap = "TechDraw_Dimension_Radius";
        } else if (getViewObject()->Type.isValue("Diameter")) {
            sPixmap = "TechDraw_Dimension_Diameter";
        } else if (getViewObject()->Type.isValue("Angle")) {
            sPixmap = "TechDraw_Dimension_Angle";
        } else if (getViewObject()->Type.isValue("Angle3Pt")) {
            sPixmap = "TechDraw_Dimension_Angle3Pt";
        }
    }
    ViewProviderDrawingView::updateData(p);
}
RatonLaveur
Posts: 991
Joined: Wed Mar 27, 2019 10:45 am

Re: Draft Layers

Post by RatonLaveur »

Hello gents,

the implementation of layers seems really cool. Coming from the laser cutting point of view, this is exactly the method needed to have control over more complex .dxf cutting files.

in a more CAD oriented aspect, my experience with other CAD packages such as Siemens NX, shows that using layers is also very useful within a single part design, where layers can be used to separate or suppress the skeleton and master sketches. I'm sure down the line this will enable a part design workflow that will not phase new people coming from this background, which definitely propels FreeCAD front and center.

Just a positive thought on your work and tribulations.
User avatar
Roy_043
Veteran
Posts: 8544
Joined: Thu Dec 27, 2018 12:28 pm

Re: Draft Layers

Post by Roy_043 »

Layers now have a Line Color and a Shape Color. I wonder if Point Color should be added (Draft_Point objects).
rmz
Posts: 5
Joined: Sat May 25, 2019 11:31 am

Re: Draft Layers

Post by rmz »

Hello,

I tried to use the new Draft layer feature but it does not work as described by Yorik at the beginning of this thread as the layer seems to "consume" the object. I did the following:
  • Open an existing document which has a group tree (Site --> Building --> Floor --> objests ..)
  • Change to the Draft bench
  • Create some layers
  • Changed to the BIM bench
  • Dragged an object from a group to a layer with the mouse
Dragging the object to the layer removes the object from the original parent group which should not be the case. In fact it renders the layer concept unusable for controlling the display. Am I doing something wrong, or did I misunderstand the purpose of layers?

This is the build information (but I don't think it matters):

Code: Select all

OS: Ubuntu 20.04.1 LTS (MATE/mate)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.22039 (Git) AppImage
Build type: Release
Branch: master
Hash: 2bfc6301bc80c0344cbf13dbfe041fbd78cac93d
Python version: 3.8.2
Qt version: 5.12.5
Coin version: 4.0.0
OCC version: 7.4.0
Locale: German/Germany (de_DE)
Thanks for all your work and engangement on FreeCAD, it is really great!
-Rainer
paullee
Veteran
Posts: 5118
Joined: Wed May 04, 2016 3:58 pm

Re: Draft Layers

Post by paullee »

rmz wrote: Sun Aug 16, 2020 4:04 pm

Code: Select all

OS: Ubuntu 20.04.1 LTS (MATE/mate)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.22039 (Git) AppImage
Build type: Release
Branch: master
Hash: 2bfc6301bc80c0344cbf13dbfe041fbd78cac93d
Python version: 3.8.2
Qt version: 5.12.5
Coin version: 4.0.0
OCC version: 7.4.0
Locale: German/Germany (de_DE)
@yorik seems do not have proper access to the network recently, you may try to ping him so he may have a better idea which thread needs him
yorik wrote: Ping
BTW, the FC info is good to have for ease of debugging by developers.
Post Reply