Skip to content

BIM: fix deletion of BuildingPart in strict IFC mode#26219

Merged
chennes merged 3 commits intoFreeCAD:mainfrom
Roy-043:BIM-fix-deletion-of-BuildingPart-in-strict-IFC-mode
Dec 22, 2025
Merged

BIM: fix deletion of BuildingPart in strict IFC mode#26219
chennes merged 3 commits intoFreeCAD:mainfrom
Roy-043:BIM-fix-deletion-of-BuildingPart-in-strict-IFC-mode

Conversation

@Roy-043
Copy link
Contributor

@Roy-043 Roy-043 commented Dec 16, 2025

Fixes #26191.

In ifc_tools.py we need to explicitly call obj.ViewObject.Proxy.attach(obj.ViewObject) in add_object. This is probably because the ViewObject of the BuildingPart has already been attached, we are replacing/updating it.

Additionally:

  • ifc_vp_buildingpart wrongly used the attach function from ifc_vp_object.
  • onDelete in ArchBuildingPart.py did not define sg.

Add `sg = FreeCADGui.ActiveDocument.ActiveView.getSceneGraph()` to `onDelete`.
Explicitly call `obj.ViewObject.Proxy.attach(obj.ViewObject)`.
In `ifc_vp_buildingpart` call `attach` from `ArchBuildingPart.ViewProviderBuildingPart`.
@Roy-043 Roy-043 added this to the 1.1 milestone Dec 16, 2025
@Roy-043 Roy-043 added Type: Bug This issue or PR is related to a bug Mod: BIM Related to the BIM Workbench labels Dec 16, 2025
@Roy-043 Roy-043 added Blocker Issue is a release blocker backport releases/FreeCAD-1-1 Applied to a PR that is on main to trigger the automatic creation of another PR onto 1.1 labels Dec 16, 2025
@maxwxyz maxwxyz moved this from Queue to Merge Meeting in Merge Queue Dec 16, 2025
@Roy-043 Roy-043 removed the Blocker Issue is a release blocker label Dec 16, 2025
@chennes chennes merged commit 0af2294 into FreeCAD:main Dec 22, 2025
18 checks passed
@github-project-automation github-project-automation bot moved this from Merge Meeting to Done in Merge Queue Dec 22, 2025
github-actions bot pushed a commit that referenced this pull request Dec 22, 2025
* 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`.

(cherry picked from commit 0af2294)
@github-actions
Copy link
Contributor

Successfully created backport PR for releases/FreeCAD-1-1:

chennes pushed a commit that referenced this pull request Dec 22, 2025
* 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`.

(cherry picked from commit 0af2294)
@Roy-043 Roy-043 deleted the BIM-fix-deletion-of-BuildingPart-in-strict-IFC-mode branch December 22, 2025 08:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport releases/FreeCAD-1-1 Applied to a PR that is on main to trigger the automatic creation of another PR onto 1.1 Mod: BIM Related to the BIM Workbench Type: Bug This issue or PR is related to a bug

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

BIM: Unable to delete native IfcBuilding and IfcLevel objects

2 participants