mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-11 02:02:22 +00:00
Fix #1672. Bug where style attributes couldn't be edited.
This commit is contained in:
@@ -53,7 +53,7 @@ def draw_attribute(attribute, layout, copy_operator=None):
|
||||
def import_attributes(ifc_class, props, data, callback=None):
|
||||
for attribute in IfcStore.get_schema().declaration_by_name(ifc_class).all_attributes():
|
||||
data_type = ifcopenshell.util.attribute.get_primitive_type(attribute)
|
||||
if data_type == "entity" or (isinstance(data_type, tuple) and "entity" in ".".join(data_type)):
|
||||
if isinstance(data_type, tuple) or data_type == "entity":
|
||||
callback(attribute.name(), None, data) if callback else None
|
||||
continue
|
||||
new = props.add()
|
||||
|
||||
@@ -3,10 +3,12 @@ def get_primitive_type(attribute_or_data_type):
|
||||
data_type = str(attribute_or_data_type.type_of_attribute())
|
||||
else:
|
||||
data_type = str(attribute_or_data_type)
|
||||
if "<select" in data_type:
|
||||
return "select"
|
||||
elif "<list" in data_type:
|
||||
return ("list", get_primitive_type(data_type.replace("<list", "")))
|
||||
if data_type.find("<list") == 0:
|
||||
return ("list", get_primitive_type(data_type[data_type[1:].find("<")+1:]))
|
||||
elif data_type.find("<set") == 0:
|
||||
return ("set", get_primitive_type(data_type[data_type[1:].find("<")+1:]))
|
||||
elif data_type.find("<select") == 0:
|
||||
return ("select", get_primitive_type(data_type[data_type[1:].find("<")+1:]))
|
||||
elif "<entity" in data_type:
|
||||
return "entity"
|
||||
elif "<string>" in data_type:
|
||||
|
||||
Reference in New Issue
Block a user