One Object in 2 Layers / Groups / Building Parts

A forum dedicated to the Draft, Arch and BIM workbenches development.
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
paullee
Veteran
Posts: 5097
Joined: Wed May 04, 2016 3:58 pm

One Object in 2 Layers / Groups / Building Parts

Post by paullee »

Tested behaviour of Layers, Groups and Building Parts (in 0.20 release) :)

  1. 1 Object Can Not exists in 2 Groups at the same time
    • Seems to be the known behaviour, not sure if this is advertised anywhere in wiki (or not)
  2. 1 Object Can exists in 2 Layers at the same time
    • Seems to be a known problem previously discussed, seems not corrected ?
  3. 1 Object Can exists in 2 Building Parts at the same time
    • Not sure if this is behaviour as designed, seems not a problem
  4. 1 Object Can exists in 2 or more of different types of container at the same time (Layer, Group, Building Part)
    • Not sure if this is behaviour as designed, seems not a problem
Any comments ?

Test_ Group_Layer_BldgPart_01.FCStd
(11.62 KiB) Downloaded 27 times
Screenshot from 2022-08-03 00-34-33.png
Screenshot from 2022-08-03 00-34-33.png (204.5 KiB) Viewed 1522 times
Screenshot from 2022-08-02 23-09-21.png
Screenshot from 2022-08-02 23-09-21.png (283.08 KiB) Viewed 1522 times

Code: Select all

OS: Fedora Linux 36 (Workstation Edition) (GNOME/gnome)
Word size of FreeCAD: 64-bit
Version: 0.20.29177 (Git)
Build type: Release
Branch: (HEAD detached at 0.20)
Hash: 68e337670e227889217652ddac593c93b5e8dc94
Python 3.9.13, Qt 5.12.9, Coin 4.0.0, Vtk 9.1.0, OCC 7.5.3
Locale: English/United States (en_US)
Installed mods: 
  * dodo
  * DynamicData 2.46.0
  * ArchTextures
  * BIM 2021.12.0
User avatar
yorik
Founder
Posts: 13640
Joined: Tue Feb 17, 2009 9:16 pm
Location: Brussels
Contact:

Re: One Object in 2 Layers / Groups / Building Parts

Post by yorik »

I think indeed an object should not be in 2 different layers, nor in 2 different buildingparts.
Note that in theory a same object could be referenced by 2 groups. It's only the group's addObject functionality that checks and removes objects from other groups.
We should maybe copy that function, and use it in layers and BuildingParts. Actually there is Group extension that might be handy here.
paullee
Veteran
Posts: 5097
Joined: Wed May 04, 2016 3:58 pm

Re: One Object in 2 Layers / Groups / Building Parts

Post by paullee »

yorik wrote: Thu Aug 04, 2022 11:50 am We should maybe copy that function, and use it in layers and BuildingParts. Actually there is Group extension that might be handy here.
For simplicity of consistency in behaviour, maybe BuildingPart should works similarly as Group (and Layer).


Just thinking, BuildingPart is associated with spatial concept :

Say, should an elevator shaft and staircase belong to several BuildingPart (Floors / Levels) ?

Or a Door for communication between to zones / rooms etc. belongs to 2 BuildingParts ?


Any idea how these should be organised.
User avatar
Roy_043
Veteran
Posts: 8450
Joined: Thu Dec 27, 2018 12:28 pm

Re: One Object in 2 Layers / Groups / Building Parts

Post by Roy_043 »

yorik wrote: Thu Aug 04, 2022 11:50 am We should maybe copy that function, and use it in layers and BuildingParts.
For drag-and-drop no distinction is made between the containers. An object that is nested in a group cannot, through a Tree view Ctrl+drag-and-drop, be put in a layer, and vice versa. The same goes for BuildingParts and layers. Which is a problem IMO.

So perhaps we need a different addObject function for layers.
User avatar
Roy_043
Veteran
Posts: 8450
Joined: Thu Dec 27, 2018 12:28 pm

Re: One Object in 2 Layers / Groups / Building Parts

Post by Roy_043 »

... Actually the Layer class already has a addObject method. But this never executes AFAICT.
paullee
Veteran
Posts: 5097
Joined: Wed May 04, 2016 3:58 pm

Re: One Object in 2 Layers / Groups / Building Parts

Post by paullee »

Another thing below to consider ? :)

If BuildingParts is considered to accept objects simultaneously in another BuildingPart / Group / Layer, when drag and drop an item from those latter to a BuildingPart, should a dialogue box appears to ask :- If the user when to remove the item from the originating BuildingParts / Group / Layer at the same time ?

( Currently, when drag and drop to a BuildingPart, the item is removed from the originating BuildingParts / Group / Layer. Need to use Group attribute to add the item without removing from the originating BuildingParts / Group / Layer )
User avatar
Roy_043
Veteran
Posts: 8450
Joined: Thu Dec 27, 2018 12:28 pm

Re: One Object in 2 Layers / Groups / Building Parts

Post by Roy_043 »

Holding down the Ctrl key should govern this behavior IMO.
paullee
Veteran
Posts: 5097
Joined: Wed May 04, 2016 3:58 pm

Re: One Object in 2 Layers / Groups / Building Parts

Post by paullee »

Sounds to be easy and intuitive :D
User avatar
Roy_043
Veteran
Posts: 8450
Joined: Thu Dec 27, 2018 12:28 pm

Re: One Object in 2 Layers / Groups / Building Parts

Post by Roy_043 »

The Ctrl+Drop behavior has changed between V0.19.1 and V0.19.2. In V0.19.1 you can hold down Ctrl and Drop an object nested in a Group on a Layer, the object is then added to the Layer and not removed from the Group. In V0.19.2 and later this is no longer possible, the object is first removed from the Group and then added to the Layer.

In V0.19.2 and later you see this in the Python console:

Code: Select all

>>> App.getDocument("layer_drop_test").getObject("Group").removeObject(App.getDocument("later_drop_test").getObject("Line"))
>>> App.getDocument('layer_drop_test').getObject('Line').adjustRelativeLinks(App.getDocument('later_drop_test').getObject('Layer001'))
>>> App.getDocument('layer_drop_test').getObject('Layer001').ViewObject.dropObject(App.getDocument('later_drop_test').getObject('Line'),None,'',[])
An Arch_BuildingPart shows the same behavior as a Std_Group. And, AFAICT, this the result of using App::GroupExtensionPython.

Objects should be in single Layer, Group or BuildingPart, but it should be possible for them to be in a Group AND a Layer, or in a BuildingPart AND a Layer. Ideally you would want two types of Drag-and-Drop behavior to support this.

V0.19.1:

Code: Select all

OS: Windows 8.1 Version 6.3 (Build 9600)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.24276 (Git)
Build type: Release
Branch: releases/FreeCAD-0-19
Hash: a88db11e0a908f6e38f92bfc5187b13ebe470438
Python version: 3.8.6+
Qt version: 5.15.1
Coin version: 4.0.1
OCC version: 7.5.0
Locale: Dutch/Netherlands (nl_NL)
V0.19.2:

Code: Select all

OS: Windows 8.1 Version 6.3 (Build 9600)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.24291 (Git)
Build type: Release
Branch: releases/FreeCAD-0-19
Hash: 7b5e18a0759de778b74d3a5c17eba9cb815035ac
Python version: 3.8.6+
Qt version: 5.15.2
Coin version: 4.0.1
OCC version: 7.5.0
Locale: Dutch/Netherlands (nl_NL)
paullee
Veteran
Posts: 5097
Joined: Wed May 04, 2016 3:58 pm

Re: One Object in 2 Layers / Groups / Building Parts

Post by paullee »

Roy_043 wrote: Mon Aug 15, 2022 10:03 am Objects should be in single Layer, Group or BuildingPart, but it should be possible for them to be in a Group AND a Layer, or in a BuildingPart AND a Layer. Ideally you would want two types of Drag-and-Drop behavior to support this.
So for whatever reason one want an object be in >1 Group or BuildingPart, should use App:Link right? And then Arch/BIM needs to supprt Link universally ?

Thanks :)
Post Reply