BIM: fix deletion of BuildingPart in strict IFC mode (#26219)
* BIM: fix deletion of BuildingPart in strict IFC mode Add `sg = FreeCADGui.ActiveDocument.ActiveView.getSceneGraph()` to `onDelete`. * BIM: fix deletion of BuildingPart in strict IFC mode Explicitly call `obj.ViewObject.Proxy.attach(obj.ViewObject)`. * BIM: fix deletion of BuildingPart in strict IFC mode In `ifc_vp_buildingpart` call `attach` from `ArchBuildingPart.ViewProviderBuildingPart`.
This commit is contained in:
@@ -1112,6 +1112,7 @@ class ViewProviderBuildingPart:
|
||||
def onDelete(self, vobj, subelements):
|
||||
|
||||
if self.clip:
|
||||
sg = FreeCADGui.ActiveDocument.ActiveView.getSceneGraph()
|
||||
sg.removeChild(self.clip)
|
||||
self.clip = None
|
||||
for o in Draft.get_group_contents(vobj.Object.Group, walls=True):
|
||||
|
||||
@@ -575,6 +575,7 @@ def add_object(document, otype=None, oname="IfcObject"):
|
||||
obj.ViewObject.ShowLevel = False
|
||||
obj.ViewObject.ShowLabel = False
|
||||
obj.ViewObject.Proxy = ifc_viewproviders.ifc_vp_buildingpart(obj.ViewObject)
|
||||
obj.ViewObject.Proxy.attach(obj.ViewObject)
|
||||
for p in obj.PropertiesList:
|
||||
if obj.getGroupOfProperty(p) in ["BuildingPart", "IFC Attributes", "Children"]:
|
||||
obj.removeProperty(p)
|
||||
|
||||
@@ -620,6 +620,9 @@ class ifc_vp_buildingpart(ifc_vp_object, ArchBuildingPart.ViewProviderBuildingPa
|
||||
def __init__(self, vobj):
|
||||
ArchBuildingPart.ViewProviderBuildingPart.__init__(self, vobj)
|
||||
|
||||
def attach(self, vobj):
|
||||
ArchBuildingPart.ViewProviderBuildingPart.attach(self, vobj)
|
||||
|
||||
|
||||
def overlay(icon1, icon2):
|
||||
"""Overlays icon2 onto icon1"""
|
||||
|
||||
Reference in New Issue
Block a user