mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-19 22:50:21 +00:00
Null automatically toggles when you set a property in a pset now
This commit is contained in:
@@ -40,11 +40,12 @@ def updateIfcFile(self, context):
|
|||||||
IfcStore.schema = None
|
IfcStore.schema = None
|
||||||
# Purge data cache
|
# Purge data cache
|
||||||
from blenderbim.bim import modules
|
from blenderbim.bim import modules
|
||||||
|
|
||||||
for module in modules.values():
|
for module in modules.values():
|
||||||
if not module:
|
if not module:
|
||||||
continue
|
continue
|
||||||
try:
|
try:
|
||||||
getattr(getattr(module, 'data'), 'Data').purge()
|
getattr(getattr(module, "data"), "Data").purge()
|
||||||
except AttributeError:
|
except AttributeError:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
@@ -267,17 +268,42 @@ class Variable(PropertyGroup):
|
|||||||
prop_key: StringProperty(name="Property Key")
|
prop_key: StringProperty(name="Property Key")
|
||||||
|
|
||||||
|
|
||||||
|
def updateAttributeStringValue(self, context):
|
||||||
|
updateAttributeValue(self, self.string_value)
|
||||||
|
|
||||||
|
|
||||||
|
def updateAttributeBoolValue(self, context):
|
||||||
|
updateAttributeValue(self, self.bool_value)
|
||||||
|
|
||||||
|
|
||||||
|
def updateAttributeIntValue(self, context):
|
||||||
|
updateAttributeValue(self, self.int_value)
|
||||||
|
|
||||||
|
|
||||||
|
def updateAttributeFloatValue(self, context):
|
||||||
|
updateAttributeValue(self, self.float_value)
|
||||||
|
|
||||||
|
|
||||||
|
def updateAttributeEnumValue(self, context):
|
||||||
|
updateAttributeValue(self, self.enum_value)
|
||||||
|
|
||||||
|
|
||||||
|
def updateAttributeValue(self, value):
|
||||||
|
if value:
|
||||||
|
self.is_null = False
|
||||||
|
|
||||||
|
|
||||||
class Attribute(PropertyGroup):
|
class Attribute(PropertyGroup):
|
||||||
name: StringProperty(name="Name")
|
name: StringProperty(name="Name")
|
||||||
data_type: StringProperty(name="Data Type")
|
data_type: StringProperty(name="Data Type")
|
||||||
string_value: StringProperty(name="Value")
|
string_value: StringProperty(name="Value", update=updateAttributeStringValue)
|
||||||
bool_value: BoolProperty(name="Value")
|
bool_value: BoolProperty(name="Value", update=updateAttributeBoolValue)
|
||||||
int_value: IntProperty(name="Value")
|
int_value: IntProperty(name="Value", update=updateAttributeIntValue)
|
||||||
float_value: FloatProperty(name="Value")
|
float_value: FloatProperty(name="Value", update=updateAttributeFloatValue)
|
||||||
is_null: BoolProperty(name="Is Null")
|
is_null: BoolProperty(name="Is Null")
|
||||||
is_optional: BoolProperty(name="Is Optional")
|
is_optional: BoolProperty(name="Is Optional")
|
||||||
enum_items: StringProperty(name="Value")
|
enum_items: StringProperty(name="Value")
|
||||||
enum_value: EnumProperty(items=getAttributeEnumValues, name="Value")
|
enum_value: EnumProperty(items=getAttributeEnumValues, name="Value", update=updateAttributeEnumValue)
|
||||||
|
|
||||||
|
|
||||||
class Drawing(PropertyGroup):
|
class Drawing(PropertyGroup):
|
||||||
|
|||||||
Reference in New Issue
Block a user