mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-09 17:31:45 +00:00
Remove elements menu and purge the "potential" openings feature as this is now properly integrated in the new element menu
This commit is contained in:
@@ -77,8 +77,6 @@ classes = (
|
||||
wall.SplitWall,
|
||||
wall.UnjoinWalls,
|
||||
opening.AddBoolean,
|
||||
opening.AddPotentialHalfSpaceSolid,
|
||||
opening.AddPotentialOpening,
|
||||
opening.CloneOpening,
|
||||
opening.EditOpenings,
|
||||
opening.FlipFill,
|
||||
@@ -148,7 +146,6 @@ classes = (
|
||||
ui.BIM_MT_type_menu,
|
||||
ui.LaunchTypeMenu,
|
||||
ui.LaunchTypeManager,
|
||||
ui.BIM_MT_elements,
|
||||
grid.BIM_OT_add_object,
|
||||
stair.BIM_OT_add_stair,
|
||||
stair.AddStair,
|
||||
|
||||
@@ -440,84 +440,6 @@ class FlipFill(bpy.types.Operator, tool.Ifc.Operator):
|
||||
return {"FINISHED"}
|
||||
|
||||
|
||||
class AddPotentialOpening(Operator, AddObjectHelper):
|
||||
bl_idname = "bim.add_potential_opening"
|
||||
bl_label = "Add Opening"
|
||||
bl_description = "Add an Opening object which can be applied on an Element"
|
||||
bl_options = {"REGISTER", "UNDO"}
|
||||
x: FloatProperty(name="Size X", default=0.5, subtype="DISTANCE")
|
||||
y: FloatProperty(name="Y", default=0.5, subtype="DISTANCE")
|
||||
z: FloatProperty(name="Z", default=0.5, subtype="DISTANCE")
|
||||
|
||||
def execute(self, context):
|
||||
props = context.scene.BIMModelProperties
|
||||
|
||||
new_matrix = None
|
||||
if context.selected_objects and context.active_object:
|
||||
new_matrix = context.active_object.matrix_world.copy()
|
||||
new_matrix.translation = context.scene.cursor.location
|
||||
|
||||
x = self.x / 2
|
||||
y = self.y / 2
|
||||
z = self.z / 2
|
||||
verts = [
|
||||
Vector((-x, -y, -z)),
|
||||
Vector((-x, -y, z)),
|
||||
Vector((-x, y, -z)),
|
||||
Vector((-x, y, z)),
|
||||
Vector((x, -y, -z)),
|
||||
Vector((x, -y, z)),
|
||||
Vector((x, y, -z)),
|
||||
Vector((x, y, z)),
|
||||
]
|
||||
edges = []
|
||||
faces = [
|
||||
[0, 1, 3, 2],
|
||||
[2, 3, 7, 6],
|
||||
[6, 7, 5, 4],
|
||||
[4, 5, 1, 0],
|
||||
[2, 6, 4, 0],
|
||||
[7, 3, 1, 5],
|
||||
]
|
||||
mesh = bpy.data.meshes.new(name="Opening")
|
||||
mesh.from_pydata(verts, edges, faces)
|
||||
obj = object_data_add(context, mesh, operator=self)
|
||||
obj.name = "Opening"
|
||||
|
||||
if new_matrix:
|
||||
obj.matrix_world = new_matrix
|
||||
|
||||
tool.Model.purge_scene_openings()
|
||||
tool.Root.add_tracked_opening(obj, "OPENING")
|
||||
|
||||
DecorationsHandler.install(context)
|
||||
return {"FINISHED"}
|
||||
|
||||
|
||||
class AddPotentialHalfSpaceSolid(Operator, AddObjectHelper):
|
||||
bl_idname = "bim.add_potential_half_space_solid"
|
||||
bl_label = "Add Potential Half Space Solid"
|
||||
bl_options = {"REGISTER", "UNDO"}
|
||||
|
||||
def execute(self, context):
|
||||
bm = bmesh.new()
|
||||
bmesh.ops.create_grid(bm, size=0.5)
|
||||
bm.verts.ensure_lookup_table()
|
||||
bm.edges.ensure_lookup_table()
|
||||
bm.faces.ensure_lookup_table()
|
||||
mesh = bpy.data.meshes.new(name="Dumb Opening")
|
||||
bm.to_mesh(mesh)
|
||||
bm.free()
|
||||
obj = object_data_add(context, mesh, operator=self)
|
||||
obj.name = "HalfSpaceSolid"
|
||||
|
||||
tool.Model.purge_scene_openings()
|
||||
tool.Root.add_tracked_opening(obj, "BOOLEAN")
|
||||
|
||||
DecorationsHandler.install(context)
|
||||
return {"FINISHED"}
|
||||
|
||||
|
||||
class AddBoolean(Operator, tool.Ifc.Operator):
|
||||
bl_idname = "bim.add_boolean"
|
||||
bl_label = "Add Boolean"
|
||||
|
||||
@@ -692,17 +692,6 @@ class BIM_PT_roof(bpy.types.Panel):
|
||||
row.operator("bim.add_roof", icon="ADD", text="")
|
||||
|
||||
|
||||
class BIM_MT_elements(Menu):
|
||||
bl_idname = "BIM_MT_elements"
|
||||
bl_label = "IFC Elements"
|
||||
|
||||
def draw(self, context):
|
||||
# TODO consolidate in Item mode UI then remove
|
||||
self.layout.operator("bim.add_potential_half_space_solid", text="Half Space", icon="ORIENTATION_NORMAL")
|
||||
self.layout.operator("bim.add_potential_opening", text="Opening", icon="CUBE")
|
||||
|
||||
|
||||
def add_menu(self, context):
|
||||
self.layout.operator("bim.launch_add_element", icon_value=bonsai.bim.icons["IFC"].icon_id, text="IFC Element")
|
||||
self.layout.menu("BIM_MT_elements", icon_value=bonsai.bim.icons["IFC"].icon_id)
|
||||
self.layout.separator()
|
||||
|
||||
Reference in New Issue
Block a user