when I use the Arch subtract tool to remove a Part box from a wall, this fails because a site object exists in the document. The Python trace says:
I tracked it further down to find, which grp fails. It turns out that the remove command tries to ungroup the removed object from any group object. To do so, it iterates over all group object and asks them, whether they belong the removed object. This iteration fails on the site object in the document.Running the Python command 'Arch_Remove' failed:
Traceback (most recent call last):
File "/home/walter/FreeCAD/build/Mod/Arch/ArchCommands.py", line 1083, in Activated
FreeCADGui.doCommand("Arch.removeComponents("+ss+",FreeCAD.ActiveDocument."+host.Name+")")
File "<string>", line 1, in <module>
File "/home/walter/FreeCAD/build/Mod/Arch/ArchCommands.py", line 160, in removeComponents
setAsSubcomponent(o)
File "/home/walter/FreeCAD/build/Mod/Arch/ArchCommands.py", line 232, in setAsSubcomponent
Draft.ungroup(obj)
File "/home/walter/FreeCAD/build/Mod/Draft/Draft.py", line 247, in ungroup
if grp.hasObject(obj):
'FeaturePython' object has no attribute 'hasObject'
Thus the code expects that a site behaves like (inherits from) a group object.
I further found out: While a building object is of type App::DocumentObjectGroupPython, a site object is of type Part::FeaturePython. Maybe this is the critical difference. But I did not change it yet, because a site object can be drawn, while a building object is a pure container. Thus the difference could be no bug but a meaningful well chosen difference.
Some more tests brought up the following results. I attached a minimal example so you can easily repeat the tests.
- A site misses the context menu entry to create a group (German translation label "Gruppe erstellen ...").
- When I drag an existing group object, I cannot drop it on a site object.
- I can select the group object and the site object and press the add button of the Arch workbench. Thus adding it basically works.
- I cannot drag a group object, which is part of a site object away from the site object.
- As already written above: When I use the Arch subtract tool to remove a Part object from a Wall object, this fails because of the site object existing in the tree.
- "The Arch Site is a special object that combines properties of a standard FreeCAD group object and Arch objects."
- "After creating a site, you can add more objects to it by drag and dropping them in the Tree View or by using the Arch Add.png Arch Add tool."
- "You can remove objects from a site by drag and dropping them out of it the Tree View or by using the Arch Remove.png Arch Remove tool."
- Is this problem known?
- What is the right strategy to fix this? Maybe I can do it?
--
OS: Ubuntu 14.04.5 LTS
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.17.10544 (Git)
Build type: Unknown
Branch: master
Hash: 69af452bc3b2b71942c1b92cef9a147feb7d5a43
Python version: 2.7.6
Qt version: 4.8.6
Coin version: 4.0.0a
OCC version: 7.1.0