mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-10 17:58:20 +00:00
fixed bug removing representation item
if you'd click on "remove item" button for some item it wouldn't remove the corresponding item but would go for removing active item instead
This commit is contained in:
@@ -1619,6 +1619,8 @@ class RemoveRepresentationItem(bpy.types.Operator, Operator):
|
||||
bl_label = "Remove Representation Item"
|
||||
bl_options = {"REGISTER", "UNDO"}
|
||||
|
||||
representation_item_id: bpy.props.IntProperty()
|
||||
|
||||
@classmethod
|
||||
def poll(cls, context):
|
||||
if context.active_object is None or len(context.active_object.BIMGeometryProperties.items) <= 1:
|
||||
@@ -1633,8 +1635,7 @@ class RemoveRepresentationItem(bpy.types.Operator, Operator):
|
||||
props = obj.BIMGeometryProperties
|
||||
ifc_file = tool.Ifc.get()
|
||||
|
||||
representation_item_id = props.items[props.active_item_index].ifc_definition_id
|
||||
representation_item = ifc_file.by_id(representation_item_id)
|
||||
representation_item = ifc_file.by_id(self.representation_item_id)
|
||||
tool.Geometry.remove_representation_item(representation_item)
|
||||
tool.Geometry.reload_representation(obj)
|
||||
|
||||
|
||||
@@ -510,4 +510,5 @@ class BIM_UL_representation_items(UIList):
|
||||
row.label(text=item.name, icon=icon)
|
||||
if item.layer:
|
||||
row.label(text="", icon="STICKY_UVS_LOC")
|
||||
row.operator("bim.remove_representation_item", icon="X", text="")
|
||||
op = row.operator("bim.remove_representation_item", icon="X", text="")
|
||||
op.representation_item_id = item.ifc_definition_id
|
||||
|
||||
Reference in New Issue
Block a user