mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-09 09:21:46 +00:00
style.edit_surface_style - fix crash setting attribute to None
Occured on setting IfcColourOrFactor attribute to None (e.g. DiffuseColour).
This commit is contained in:
@@ -112,11 +112,13 @@ class Usecase:
|
||||
attribute[1] = value["Red"]
|
||||
attribute[2] = value["Green"]
|
||||
attribute[3] = value["Blue"]
|
||||
else:
|
||||
else: # assume it's float value for IfcNormalisedRatioMeasure or None
|
||||
existing_value = getattr(self.settings["style"], name)
|
||||
if existing_value and existing_value.id():
|
||||
self.file.remove(existing_value)
|
||||
setattr(self.settings["style"], name, self.file.createIfcNormalisedRatioMeasure(value))
|
||||
if value is not None:
|
||||
value = self.file.createIfcNormalisedRatioMeasure(value)
|
||||
setattr(self.settings["style"], name, value)
|
||||
|
||||
def edit_specular_highlight(self, value):
|
||||
if value is None:
|
||||
|
||||
Reference in New Issue
Block a user