mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-20 15:08:51 +00:00
improve update_existing_properties
explicit class check error out on a not supported type better methods names
This commit is contained in:
@@ -203,12 +203,14 @@ class Usecase:
|
|||||||
continue
|
continue
|
||||||
|
|
||||||
if prop.is_a("IfcPropertyEnumeratedValue"):
|
if prop.is_a("IfcPropertyEnumeratedValue"):
|
||||||
self.update_existing_enum(prop)
|
self.update_existing_prop_enum(prop)
|
||||||
|
|
||||||
else:
|
elif prop.is_a("IfcPropertySingleValue"):
|
||||||
self.update_existing_property(prop)
|
self.update_existing_prop_single_value(prop)
|
||||||
|
|
||||||
def update_existing_enum(self, prop):
|
raise NotImplementedError(f"Updating '{prop.is_a()}' properties is not supported yet")
|
||||||
|
|
||||||
|
def update_existing_prop_enum(self, prop):
|
||||||
"""
|
"""
|
||||||
NOTE: Assumes the prop exists
|
NOTE: Assumes the prop exists
|
||||||
"""
|
"""
|
||||||
@@ -243,7 +245,7 @@ class Usecase:
|
|||||||
prop.Unit = unit
|
prop.Unit = unit
|
||||||
del self.settings["properties"][prop.Name]
|
del self.settings["properties"][prop.Name]
|
||||||
|
|
||||||
def update_existing_property(self, prop):
|
def update_existing_prop_single_value(self, prop):
|
||||||
"""
|
"""
|
||||||
NOTE: Assumes the prop exists
|
NOTE: Assumes the prop exists
|
||||||
"""
|
"""
|
||||||
|
|||||||
Reference in New Issue
Block a user