diff --git a/src/Mod/BIM/ArchBuildingPart.py b/src/Mod/BIM/ArchBuildingPart.py index ef4b67bf9f..8f026cd51b 100644 --- a/src/Mod/BIM/ArchBuildingPart.py +++ b/src/Mod/BIM/ArchBuildingPart.py @@ -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): diff --git a/src/Mod/BIM/nativeifc/ifc_tools.py b/src/Mod/BIM/nativeifc/ifc_tools.py index 2f55339a91..383df7e514 100644 --- a/src/Mod/BIM/nativeifc/ifc_tools.py +++ b/src/Mod/BIM/nativeifc/ifc_tools.py @@ -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) diff --git a/src/Mod/BIM/nativeifc/ifc_viewproviders.py b/src/Mod/BIM/nativeifc/ifc_viewproviders.py index 205e99bed5..ccb76e3ba1 100644 --- a/src/Mod/BIM/nativeifc/ifc_viewproviders.py +++ b/src/Mod/BIM/nativeifc/ifc_viewproviders.py @@ -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"""