mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-09 13:52:23 +00:00
Convenient Pie Menu shortcut to aggregate selected objects to active object
This commit is contained in:
@@ -126,6 +126,7 @@ classes = (
|
|||||||
pie.OpenPieClass,
|
pie.OpenPieClass,
|
||||||
pie.PieUpdateContainer,
|
pie.PieUpdateContainer,
|
||||||
pie.PieAddOpening,
|
pie.PieAddOpening,
|
||||||
|
pie.PieAssignObjectAggregation,
|
||||||
pie.VIEW3D_MT_PIE_bim,
|
pie.VIEW3D_MT_PIE_bim,
|
||||||
pie.VIEW3D_MT_PIE_bim_class,
|
pie.VIEW3D_MT_PIE_bim_class,
|
||||||
sverchok_modifier.CreateNewSverchokGraph,
|
sverchok_modifier.CreateNewSverchokGraph,
|
||||||
|
|||||||
@@ -19,6 +19,7 @@
|
|||||||
import bpy
|
import bpy
|
||||||
import blenderbim.tool as tool
|
import blenderbim.tool as tool
|
||||||
import blenderbim.core.spatial
|
import blenderbim.core.spatial
|
||||||
|
import blenderbim.core.aggregate
|
||||||
from blenderbim.bim.ifc import IfcStore
|
from blenderbim.bim.ifc import IfcStore
|
||||||
|
|
||||||
|
|
||||||
@@ -75,6 +76,22 @@ class PieUpdateContainer(bpy.types.Operator):
|
|||||||
break
|
break
|
||||||
return {"FINISHED"}
|
return {"FINISHED"}
|
||||||
|
|
||||||
|
class PieAssignObjectAggregation(bpy.types.Operator,tool.Ifc.Operator):
|
||||||
|
bl_idname = "bim.pie_assign_object_aggregation"
|
||||||
|
bl_label = "Assign Parts to Active Object"
|
||||||
|
bl_options = {"REGISTER", "UNDO"}
|
||||||
|
|
||||||
|
def _execute(self, context):
|
||||||
|
for obj in context.selected_objects:
|
||||||
|
if obj == context.active_object:
|
||||||
|
continue
|
||||||
|
blenderbim.core.aggregate.assign_object(
|
||||||
|
tool.Ifc,
|
||||||
|
tool.Aggregate,
|
||||||
|
tool.Collector,
|
||||||
|
relating_obj=context.active_object,
|
||||||
|
related_obj=obj,
|
||||||
|
)
|
||||||
|
|
||||||
class VIEW3D_MT_PIE_bim(bpy.types.Menu):
|
class VIEW3D_MT_PIE_bim(bpy.types.Menu):
|
||||||
bl_label = "Geometry"
|
bl_label = "Geometry"
|
||||||
@@ -86,6 +103,7 @@ class VIEW3D_MT_PIE_bim(bpy.types.Menu):
|
|||||||
pie.operator("bim.pie_add_opening")
|
pie.operator("bim.pie_add_opening")
|
||||||
pie.operator("bim.pie_update_container")
|
pie.operator("bim.pie_update_container")
|
||||||
pie.operator("bim.open_pie_class", text="Assign IFC Class")
|
pie.operator("bim.open_pie_class", text="Assign IFC Class")
|
||||||
|
pie.operator("bim.pie_assign_object_aggregation", text ="Assign Aggregation")
|
||||||
|
|
||||||
|
|
||||||
class VIEW3D_MT_PIE_bim_class(bpy.types.Menu):
|
class VIEW3D_MT_PIE_bim_class(bpy.types.Menu):
|
||||||
|
|||||||
@@ -268,9 +268,6 @@ def highlight_product_cost_item(spatial, cost, cost_item):
|
|||||||
else:
|
else:
|
||||||
return "Cost schedule is not active"
|
return "Cost schedule is not active"
|
||||||
|
|
||||||
def toggle_cost_item_parent(cost, cost_item):
|
|
||||||
cost.toggle_cost_item_parent(cost_item)
|
|
||||||
|
|
||||||
|
|
||||||
def change_parent_cost_item(ifc, cost, new_parent):
|
def change_parent_cost_item(ifc, cost, new_parent):
|
||||||
cost_item = cost.get_active_cost_item()
|
cost_item = cost.get_active_cost_item()
|
||||||
|
|||||||
Reference in New Issue
Block a user