mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-14 11:24:19 +00:00
Use property_unset instead of in and del
This commit is contained in:
@@ -193,9 +193,8 @@ def update_is_adding_representation_layer(self: "BIMObjectGeometryProperties", c
|
||||
return
|
||||
return
|
||||
|
||||
if "representation_layer" in self:
|
||||
del self["representation_layer"]
|
||||
del self["is_adding_representation_layer"]
|
||||
self.property_unset("representation_layer")
|
||||
self.property_unset("is_adding_representation_layer")
|
||||
|
||||
|
||||
def update_is_editing_item_layer(self: "BIMObjectGeometryProperties", context: bpy.types.Context) -> None:
|
||||
@@ -216,9 +215,8 @@ def update_is_editing_item_layer(self: "BIMObjectGeometryProperties", context: b
|
||||
self.representation_item_layer = str(layer.id())
|
||||
return
|
||||
|
||||
if "representation_item_layer" in self:
|
||||
del self["representation_item_layer"]
|
||||
del self["is_editing_item_layer"]
|
||||
self.property_unset("representation_item_layer")
|
||||
self.property_unset("is_editing_item_layer")
|
||||
|
||||
|
||||
class BIMObjectGeometryProperties(PropertyGroup):
|
||||
|
||||
@@ -119,8 +119,7 @@ class Clash(bonsai.core.tool.Clash):
|
||||
if not clash_set:
|
||||
return
|
||||
clash_set.clashes.clear()
|
||||
if "clashes_loaded" in clash_set:
|
||||
del clash_set["clashes_loaded"]
|
||||
clash_set.property_unset("clashes_loaded")
|
||||
|
||||
@classmethod
|
||||
def load_clash_sets(cls, fn: str) -> None:
|
||||
|
||||
@@ -319,8 +319,7 @@ class Owner(bonsai.core.tool.Owner):
|
||||
@classmethod
|
||||
def clear_application(cls) -> None:
|
||||
props = cls.get_owner_props()
|
||||
if "active_application_id" in props:
|
||||
del props["active_application_id"]
|
||||
props.property_unset("active_application_id")
|
||||
|
||||
@classmethod
|
||||
def import_application_attributes(cls) -> None:
|
||||
|
||||
Reference in New Issue
Block a user