mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-28 19:27:10 +00:00
WIP migrate attribute management to partial editing with 4 new features! See #1222.
New features include: - New clarity between null and empty string attributes - Attribute editing now shows appropriate UI widgets depending on data type - Attribute editing for enumerations now show a dropdown - Attribute editing is now schema sensitive
This commit is contained in:
@@ -10,7 +10,9 @@ class Data:
|
||||
if not file:
|
||||
return
|
||||
product = file.by_id(product_id)
|
||||
if product.ContainedInStructure:
|
||||
if not hasattr(product, "ContainedInStructure"):
|
||||
cls.products[product_id] = None
|
||||
elif product.ContainedInStructure:
|
||||
structure = product.ContainedInStructure[0].RelatingStructure
|
||||
cls.products[product_id] = {"type": structure.is_a(), "Name": structure.Name, "id": int(structure.id())}
|
||||
else:
|
||||
|
||||
@@ -11,7 +11,14 @@ class BIM_PT_spatial(Panel):
|
||||
|
||||
@classmethod
|
||||
def poll(cls, context):
|
||||
return bool(context.active_object.BIMObjectProperties.ifc_definition_id)
|
||||
props = context.active_object.BIMObjectProperties
|
||||
if not props.ifc_definition_id:
|
||||
return False
|
||||
if props.ifc_definition_id not in Data.products:
|
||||
Data.load(props.ifc_definition_id)
|
||||
if not Data.products[props.ifc_definition_id]:
|
||||
return False
|
||||
return True
|
||||
|
||||
def draw(self, context):
|
||||
props = context.active_object.BIMObjectProperties
|
||||
@@ -20,9 +27,6 @@ class BIM_PT_spatial(Panel):
|
||||
if props.ifc_definition_id not in Data.products:
|
||||
Data.load(props.ifc_definition_id)
|
||||
|
||||
if "Ifc" not in context.active_object.name:
|
||||
return
|
||||
|
||||
row = self.layout.row(align=True)
|
||||
name = "{}/{}".format(
|
||||
Data.products[props.ifc_definition_id]["type"], Data.products[props.ifc_definition_id]["Name"]
|
||||
|
||||
Reference in New Issue
Block a user