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!
carlopav
Veteran
Posts: 2062
Joined: Mon Dec 31, 2018 1:49 pm
Location: Venice, Italy

Re: Draft Layers

Post by carlopav »

rmz wrote: Sun Aug 16, 2020 4:04 pm 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
There should be an option in the layer object to disable that behaviour...
follow my experiments on BIM modelling for architecture design
rmz
Posts: 5
Joined: Sat May 25, 2019 11:31 am

Re: Draft Layers

Post by rmz »

I created a small test file to check this. I did not find a repective property setting. When dragging an object into a layer the following is printed on the python console:

Code: Select all

App.getDocument('Unnamed').getObject('Layer001').ViewObject.dropObject(App.getDocument('Unnamed').getObject('Wall'),None,'',[])
So it seem the dragged object is intentionally deleted from the source group. When adding objects through the Group attribute of the layer it works as expected. However, this is not as convenient.

Also, I noticed the following:
  • Moving Groups to the layer leads to an error

    Code: Select all

       setattr(o.ViewObject, p, getattr(vobj, p)) <class 'AttributeError'>: 'Gui.ViewProviderDocumentObject' object has no attribute 'ShapeColor'

    That means for larger number of objects all single objects must be explicitly moved
  • When empyting a layer trough the Group attribute, the following error occurs:

    Code: Select all

    <Exception> type must be 'DocumentObject' or list of 'DocumentObject', not NoneType

    That means the GUI sets a None, but an empty array [] must be set.
Finally it seems to me that the layer implementation is not yet mature enough in order to be used.

Unfortunately, it's not possible for me to contribute to improving that. FreeCAD is quite complex. Just for my interest, is the source code / project structure and architecture of FreeCAD somewhere explained in a document?

Cheers,
-Rainer
User avatar
Roy_043
Veteran
Posts: 8576
Joined: Thu Dec 27, 2018 12:28 pm

Re: Draft Layers

Post by Roy_043 »

rmz wrote: Mon Aug 17, 2020 8:15 pm So it seem the dragged object is intentionally deleted from the source group.
Are you holding down the Ctrl key when you drop the object(s)?
rmz
Posts: 5
Joined: Sat May 25, 2019 11:31 am

Re: Draft Layers

Post by rmz »

Roy_043 wrote: Sat Aug 22, 2020 6:35 pm
rmz wrote: Mon Aug 17, 2020 8:15 pm So it seem the dragged object is intentionally deleted from the source group.
Are you holding down the Ctrl key when you drop the object(s)?
No, I didn't, because this was not explained anywhere. But now, as you mentioned it, I did and the behavior was indeed as expected. Thanks!
Post Reply