Skip to content

Commit

Permalink
Fixed drag-n-drop - issue #48
Browse files Browse the repository at this point in the history
  • Loading branch information
yorikvanhavre committed Mar 18, 2024
1 parent 5c10b6a commit 95e87f3
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions ifc_tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -1040,6 +1040,10 @@ def create_relationship(old_obj, obj, parent, element, ifcfile):
parent_element = get_ifc_element(parent)
# case 1: element inside spatiual structure
if parent_element.is_a("IfcSpatialStructureElement") and element.is_a("IfcElement"):
# first remove the FreeCAD object from any parent
for old_par in old_obj.InList:
if hasattr(old_par, "Group") and old_obj in old_par.Group:
old_par.Group = [o for o in old_par.Group if o != old_obj]
api_run("spatial.unassign_container", ifcfile, product=element)
uprel = api_run(
"spatial.assign_container",
Expand Down

0 comments on commit 95e87f3

Please sign in to comment.