mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-20 06:58:56 +00:00
Improve UX of assigning classes to multiple objects. See #1222.
This commit is contained in:
@@ -17,6 +17,8 @@ classes = (
|
|||||||
pie.AssignIfcStair,
|
pie.AssignIfcStair,
|
||||||
pie.AssignIfcDoor,
|
pie.AssignIfcDoor,
|
||||||
pie.AssignIfcWindow,
|
pie.AssignIfcWindow,
|
||||||
|
pie.AssignIfcColumn,
|
||||||
|
pie.AssignIfcBeam,
|
||||||
pie.VIEW3D_MT_PIE_bim,
|
pie.VIEW3D_MT_PIE_bim,
|
||||||
pie.VIEW3D_MT_PIE_bim_class,
|
pie.VIEW3D_MT_PIE_bim_class,
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -15,9 +15,7 @@ class AssignIfcWall(bpy.types.Operator):
|
|||||||
bl_label = "IfcWall"
|
bl_label = "IfcWall"
|
||||||
|
|
||||||
def execute(self, context):
|
def execute(self, context):
|
||||||
for obj in context.selected_objects:
|
bpy.ops.bim.assign_class(ifc_class="IfcWall")
|
||||||
if not obj.BIMObjectProperties.ifc_definition_id:
|
|
||||||
bpy.ops.bim.assign_class(obj=obj.name, ifc_class="IfcWall")
|
|
||||||
return {"FINISHED"}
|
return {"FINISHED"}
|
||||||
|
|
||||||
|
|
||||||
@@ -26,9 +24,7 @@ class AssignIfcSlab(bpy.types.Operator):
|
|||||||
bl_label = "IfcSlab"
|
bl_label = "IfcSlab"
|
||||||
|
|
||||||
def execute(self, context):
|
def execute(self, context):
|
||||||
for obj in context.selected_objects:
|
bpy.ops.bim.assign_class(ifc_class="IfcSlab")
|
||||||
if not obj.BIMObjectProperties.ifc_definition_id:
|
|
||||||
bpy.ops.bim.assign_class(obj=obj.name, ifc_class="IfcSlab")
|
|
||||||
return {"FINISHED"}
|
return {"FINISHED"}
|
||||||
|
|
||||||
|
|
||||||
@@ -37,9 +33,7 @@ class AssignIfcStair(bpy.types.Operator):
|
|||||||
bl_label = "IfcStair"
|
bl_label = "IfcStair"
|
||||||
|
|
||||||
def execute(self, context):
|
def execute(self, context):
|
||||||
for obj in context.selected_objects:
|
bpy.ops.bim.assign_class(ifc_class="IfcStair")
|
||||||
if not obj.BIMObjectProperties.ifc_definition_id:
|
|
||||||
bpy.ops.bim.assign_class(obj=obj.name, ifc_class="IfcStair")
|
|
||||||
return {"FINISHED"}
|
return {"FINISHED"}
|
||||||
|
|
||||||
|
|
||||||
@@ -48,9 +42,7 @@ class AssignIfcDoor(bpy.types.Operator):
|
|||||||
bl_label = "IfcDoor"
|
bl_label = "IfcDoor"
|
||||||
|
|
||||||
def execute(self, context):
|
def execute(self, context):
|
||||||
for obj in context.selected_objects:
|
bpy.ops.bim.assign_class(ifc_class="IfcDoor")
|
||||||
if not obj.BIMObjectProperties.ifc_definition_id:
|
|
||||||
bpy.ops.bim.assign_class(obj=obj.name, ifc_class="IfcDoor")
|
|
||||||
return {"FINISHED"}
|
return {"FINISHED"}
|
||||||
|
|
||||||
|
|
||||||
@@ -59,9 +51,25 @@ class AssignIfcWindow(bpy.types.Operator):
|
|||||||
bl_label = "IfcWindow"
|
bl_label = "IfcWindow"
|
||||||
|
|
||||||
def execute(self, context):
|
def execute(self, context):
|
||||||
for obj in context.selected_objects:
|
bpy.ops.bim.assign_class(ifc_class="IfcWindow")
|
||||||
if not obj.BIMObjectProperties.ifc_definition_id:
|
return {"FINISHED"}
|
||||||
bpy.ops.bim.assign_class(obj=obj.name, ifc_class="IfcWindow")
|
|
||||||
|
|
||||||
|
class AssignIfcColumn(bpy.types.Operator):
|
||||||
|
bl_idname = "bim.assign_ifc_column"
|
||||||
|
bl_label = "IfcColumn"
|
||||||
|
|
||||||
|
def execute(self, context):
|
||||||
|
bpy.ops.bim.assign_class(ifc_class="IfcColumn")
|
||||||
|
return {"FINISHED"}
|
||||||
|
|
||||||
|
|
||||||
|
class AssignIfcBeam(bpy.types.Operator):
|
||||||
|
bl_idname = "bim.assign_ifc_beam"
|
||||||
|
bl_label = "IfcBeam"
|
||||||
|
|
||||||
|
def execute(self, context):
|
||||||
|
bpy.ops.bim.assign_class(ifc_class="IfcBeam")
|
||||||
return {"FINISHED"}
|
return {"FINISHED"}
|
||||||
|
|
||||||
|
|
||||||
@@ -123,3 +131,5 @@ class VIEW3D_MT_PIE_bim_class(bpy.types.Menu):
|
|||||||
pie.operator("bim.assign_ifc_stair")
|
pie.operator("bim.assign_ifc_stair")
|
||||||
pie.operator("bim.assign_ifc_door")
|
pie.operator("bim.assign_ifc_door")
|
||||||
pie.operator("bim.assign_ifc_window")
|
pie.operator("bim.assign_ifc_window")
|
||||||
|
pie.operator("bim.assign_ifc_column")
|
||||||
|
pie.operator("bim.assign_ifc_beam")
|
||||||
|
|||||||
@@ -42,7 +42,6 @@ class BIM_PT_class(Panel):
|
|||||||
self.draw_class_dropdowns()
|
self.draw_class_dropdowns()
|
||||||
row = self.layout.row(align=True)
|
row = self.layout.row(align=True)
|
||||||
op = row.operator("bim.assign_class")
|
op = row.operator("bim.assign_class")
|
||||||
op.obj = context.active_object.name
|
|
||||||
op.ifc_class = bpy.context.scene.BIMRootProperties.ifc_class
|
op.ifc_class = bpy.context.scene.BIMRootProperties.ifc_class
|
||||||
op.predefined_type = bpy.context.scene.BIMRootProperties.ifc_predefined_type
|
op.predefined_type = bpy.context.scene.BIMRootProperties.ifc_predefined_type
|
||||||
op.userdefined_type = bpy.context.scene.BIMRootProperties.ifc_userdefined_type
|
op.userdefined_type = bpy.context.scene.BIMRootProperties.ifc_userdefined_type
|
||||||
|
|||||||
Reference in New Issue
Block a user