mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-05 23:41:44 +00:00
Fix #7519. Do not import parametrically locked item attributes.
The previous fix by @theoryshaw had the correct conclusion but had some issues: 1. Don't implement anything that fetches IFC data in the UI draw calls. This historically has lead to race conditions and crashes. The data classes are much preferred. 2. Rather than load the inapplicable attribute then selectively omit it in the UI, it's preferred to just never load it in the first place.
This commit is contained in:
@@ -1797,6 +1797,10 @@ class Geometry(bonsai.core.tool.Geometry):
|
||||
def import_item_attributes(cls, obj: bpy.types.Object) -> None:
|
||||
props = tool.Geometry.get_mesh_props(obj.data)
|
||||
props.item_attributes.clear()
|
||||
element = tool.Ifc.get_entity(tool.Geometry.get_geometry_props().representation_obj)
|
||||
if tool.Model.get_usage_type(element) == "LAYER3":
|
||||
return # All LAYER3 attributes are parametrically determined from the IfcMaterialLayerSet
|
||||
|
||||
item = tool.Ifc.get().by_id(props.ifc_definition_id)
|
||||
allowed_attributes = [
|
||||
a.name()
|
||||
|
||||
Reference in New Issue
Block a user