mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-19 14:41:25 +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[1] = value["Red"]
|
||||||
attribute[2] = value["Green"]
|
attribute[2] = value["Green"]
|
||||||
attribute[3] = value["Blue"]
|
attribute[3] = value["Blue"]
|
||||||
else:
|
else: # assume it's float value for IfcNormalisedRatioMeasure or None
|
||||||
existing_value = getattr(self.settings["style"], name)
|
existing_value = getattr(self.settings["style"], name)
|
||||||
if existing_value and existing_value.id():
|
if existing_value and existing_value.id():
|
||||||
self.file.remove(existing_value)
|
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):
|
def edit_specular_highlight(self, value):
|
||||||
if value is None:
|
if value is None:
|
||||||
|
|||||||
Reference in New Issue
Block a user