mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-10 09:48:32 +00:00
You can now select individual Task Inputs & Task Ouputs directly from the task quantity assignments.
This commit is contained in:
@@ -503,6 +503,8 @@ class BIM_UL_task_inputs(UIList):
|
||||
def draw_item(self, context, layout, data, item, icon, active_data, active_propname):
|
||||
if item:
|
||||
row = layout.row(align=True)
|
||||
op = row.operator("bim.select_product", text="", icon="RESTRICT_SELECT_OFF")
|
||||
op.product = item.ifc_definition_id
|
||||
row.prop(item, "name", emboss=False, text="")
|
||||
# row.operator("bim.remove_task_column", text="", icon="X").name = item.name
|
||||
|
||||
@@ -527,6 +529,8 @@ class BIM_UL_task_outputs(UIList):
|
||||
def draw_item(self, context, layout, data, item, icon, active_data, active_propname):
|
||||
if item:
|
||||
row = layout.row(align=True)
|
||||
op = row.operator("bim.select_product", text="", icon="RESTRICT_SELECT_OFF")
|
||||
op.product = item.ifc_definition_id
|
||||
row.prop(item, "name", emboss=False, text="")
|
||||
|
||||
|
||||
|
||||
@@ -30,6 +30,7 @@ classes = (
|
||||
operator.RemoveContainer,
|
||||
operator.SelectContainer,
|
||||
operator.SelectSimilarContainer,
|
||||
operator.SelectProduct,
|
||||
prop.SpatialElement,
|
||||
prop.BIMSpatialProperties,
|
||||
prop.BIMObjectSpatialProperties,
|
||||
|
||||
@@ -160,3 +160,14 @@ class SelectSimilarContainer(bpy.types.Operator, tool.Ifc.Operator):
|
||||
|
||||
def _execute(self, context):
|
||||
core.select_similar_container(tool.Ifc, tool.Spatial, obj=context.active_object)
|
||||
|
||||
|
||||
class SelectProduct(bpy.types.Operator):
|
||||
bl_idname = "bim.select_product"
|
||||
bl_label = "Select Product"
|
||||
bl_options = {"REGISTER", "UNDO"}
|
||||
product: bpy.props.IntProperty()
|
||||
|
||||
def execute(self, context):
|
||||
core.select_product(tool.Spatial, product=tool.Ifc.get().by_id(self.product))
|
||||
return {"FINISHED"}
|
||||
|
||||
@@ -92,3 +92,7 @@ def select_similar_container(ifc, spatial, obj=None):
|
||||
element = ifc.get_entity(obj)
|
||||
if element:
|
||||
spatial.select_products(spatial.get_decomposed_elements(spatial.get_container(element)))
|
||||
|
||||
|
||||
def select_product(spatial, product):
|
||||
spatial.select_products([product])
|
||||
|
||||
Reference in New Issue
Block a user