Don't edit IFC when simply disabling window editing.

This commit is contained in:
Dion Moult
2023-02-09 19:33:08 +11:00
parent f0502c123e
commit 25c650f4cd
@@ -415,13 +415,21 @@ class CancelEditingWindow(bpy.types.Operator, tool.Ifc.Operator):
psets = ifcopenshell.util.element.get_psets(element) psets = ifcopenshell.util.element.get_psets(element)
data = json.loads(psets["BBIM_Window"]["Data"]) data = json.loads(psets["BBIM_Window"]["Data"])
props = obj.BIMWindowProperties props = obj.BIMWindowProperties
# restore previous settings since editing was canceled
for prop_name in data: for prop_name in data:
setattr(props, prop_name, data[prop_name]) setattr(props, prop_name, data[prop_name])
update_window_modifier_representation(context)
body = ifcopenshell.util.representation.get_representation(element, "Model", "Body", "MODEL_VIEW")
core.switch_representation(
tool.Ifc,
tool.Geometry,
obj=obj,
representation=body,
should_reload=True,
is_global=True,
should_sync_changes_first=False,
)
props.is_editing = -1 props.is_editing = -1
return {"FINISHED"} return {"FINISHED"}