mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-18 22:33:33 +00:00
Black
This commit is contained in:
@@ -83,6 +83,7 @@ class BIM_PT_bsdd(Panel):
|
|||||||
row = self.layout.row()
|
row = self.layout.row()
|
||||||
row.operator("bim.load_bsdd_dictionaries")
|
row.operator("bim.load_bsdd_dictionaries")
|
||||||
|
|
||||||
|
|
||||||
class BIM_UL_bsdd_dictionaries(UIList):
|
class BIM_UL_bsdd_dictionaries(UIList):
|
||||||
def draw_item(
|
def draw_item(
|
||||||
self,
|
self,
|
||||||
|
|||||||
@@ -106,23 +106,37 @@ class CadTool(WorkSpaceTool):
|
|||||||
)
|
)
|
||||||
|
|
||||||
row = layout.row(align=True)
|
row = layout.row(align=True)
|
||||||
add_layout_hotkey_operator(row, "Extend", "S_E", bpy.ops.bim.cad_trim_extend.__doc__.split("\n", 1)[1].strip(), ui_context)
|
add_layout_hotkey_operator(
|
||||||
|
row, "Extend", "S_E", bpy.ops.bim.cad_trim_extend.__doc__.split("\n", 1)[1].strip(), ui_context
|
||||||
|
)
|
||||||
row = row if ui_context == "TOOL_HEADER" else layout.row(align=True)
|
row = row if ui_context == "TOOL_HEADER" else layout.row(align=True)
|
||||||
add_layout_hotkey_operator(
|
add_layout_hotkey_operator(
|
||||||
row, "Join", "S_T", bpy.ops.bim.cad_mitre.__doc__.split("\n", 1)[1].strip(), ui_context
|
row, "Join", "S_T", bpy.ops.bim.cad_mitre.__doc__.split("\n", 1)[1].strip(), ui_context
|
||||||
)
|
)
|
||||||
row = row if ui_context == "TOOL_HEADER" else layout.row(align=True)
|
row = row if ui_context == "TOOL_HEADER" else layout.row(align=True)
|
||||||
add_layout_hotkey_operator(row, "Fillet", "S_F", bpy.ops.bim.add_ifcarcindex_fillet.__doc__.split("\n", 1)[1].strip(), ui_context)
|
add_layout_hotkey_operator(
|
||||||
|
row, "Fillet", "S_F", bpy.ops.bim.add_ifcarcindex_fillet.__doc__.split("\n", 1)[1].strip(), ui_context
|
||||||
|
)
|
||||||
row = row if ui_context == "TOOL_HEADER" else layout.row(align=True)
|
row = row if ui_context == "TOOL_HEADER" else layout.row(align=True)
|
||||||
add_layout_hotkey_operator(row, "Offset", "S_O", bpy.ops.bim.cad_offset.__doc__.split("\n", 1)[1].strip(), ui_context)
|
add_layout_hotkey_operator(
|
||||||
|
row, "Offset", "S_O", bpy.ops.bim.cad_offset.__doc__.split("\n", 1)[1].strip(), ui_context
|
||||||
|
)
|
||||||
row = row if ui_context == "TOOL_HEADER" else layout.row(align=True)
|
row = row if ui_context == "TOOL_HEADER" else layout.row(align=True)
|
||||||
add_layout_hotkey_operator(row, "Rectangle", "S_R", bpy.ops.bim.add_rectangle.__doc__.split("\n", 1)[1].strip(), ui_context)
|
add_layout_hotkey_operator(
|
||||||
|
row, "Rectangle", "S_R", bpy.ops.bim.add_rectangle.__doc__.split("\n", 1)[1].strip(), ui_context
|
||||||
|
)
|
||||||
row = row if ui_context == "TOOL_HEADER" else layout.row(align=True)
|
row = row if ui_context == "TOOL_HEADER" else layout.row(align=True)
|
||||||
add_layout_hotkey_operator(row, "Circle", "S_C", bpy.ops.bim.add_ifccircle.__doc__.split("\n", 1)[1].strip(), ui_context)
|
add_layout_hotkey_operator(
|
||||||
|
row, "Circle", "S_C", bpy.ops.bim.add_ifccircle.__doc__.split("\n", 1)[1].strip(), ui_context
|
||||||
|
)
|
||||||
row = row if ui_context == "TOOL_HEADER" else layout.row(align=True)
|
row = row if ui_context == "TOOL_HEADER" else layout.row(align=True)
|
||||||
add_layout_hotkey_operator(row, "3-Point Arc", "S_V", bpy.ops.bim.set_arc_index.__doc__.split("\n", 1)[1].strip(), ui_context)
|
add_layout_hotkey_operator(
|
||||||
|
row, "3-Point Arc", "S_V", bpy.ops.bim.set_arc_index.__doc__.split("\n", 1)[1].strip(), ui_context
|
||||||
|
)
|
||||||
row = row if ui_context == "TOOL_HEADER" else layout.row(align=True)
|
row = row if ui_context == "TOOL_HEADER" else layout.row(align=True)
|
||||||
add_layout_hotkey_operator(row, "Reset Vertex", "S_X", bpy.ops.bim.reset_vertex.__doc__.split("\n", 1)[1].strip(), ui_context)
|
add_layout_hotkey_operator(
|
||||||
|
row, "Reset Vertex", "S_X", bpy.ops.bim.reset_vertex.__doc__.split("\n", 1)[1].strip(), ui_context
|
||||||
|
)
|
||||||
|
|
||||||
elif (
|
elif (
|
||||||
isinstance(data, tool.Geometry.TYPES_WITH_MESH_PROPERTIES)
|
isinstance(data, tool.Geometry.TYPES_WITH_MESH_PROPERTIES)
|
||||||
@@ -132,15 +146,21 @@ class CadTool(WorkSpaceTool):
|
|||||||
layout, "Edit Axis", "bim.edit_extrusion_axis", "bim.disable_editing_extrusion_axis", ui_context
|
layout, "Edit Axis", "bim.edit_extrusion_axis", "bim.disable_editing_extrusion_axis", ui_context
|
||||||
)
|
)
|
||||||
row = layout.row(align=True)
|
row = layout.row(align=True)
|
||||||
add_layout_hotkey_operator(row, "Extend", "S_E", bpy.ops.bim.cad_trim_extend.__doc__.split("\n", 1)[1].strip(), ui_context)
|
add_layout_hotkey_operator(
|
||||||
|
row, "Extend", "S_E", bpy.ops.bim.cad_trim_extend.__doc__.split("\n", 1)[1].strip(), ui_context
|
||||||
|
)
|
||||||
row = row if ui_context == "TOOL_HEADER" else layout.row(align=True)
|
row = row if ui_context == "TOOL_HEADER" else layout.row(align=True)
|
||||||
add_layout_hotkey_operator(
|
add_layout_hotkey_operator(
|
||||||
row, "Join", "S_T", bpy.ops.bim.cad_mitre.__doc__.split("\n", 1)[1].strip(), ui_context
|
row, "Join", "S_T", bpy.ops.bim.cad_mitre.__doc__.split("\n", 1)[1].strip(), ui_context
|
||||||
)
|
)
|
||||||
row = row if ui_context == "TOOL_HEADER" else layout.row(align=True)
|
row = row if ui_context == "TOOL_HEADER" else layout.row(align=True)
|
||||||
add_layout_hotkey_operator(row, "Fillet", "S_F", bpy.ops.bim.cad_fillet.__doc__.split("\n", 1)[1].strip(), ui_context)
|
add_layout_hotkey_operator(
|
||||||
|
row, "Fillet", "S_F", bpy.ops.bim.cad_fillet.__doc__.split("\n", 1)[1].strip(), ui_context
|
||||||
|
)
|
||||||
row = row if ui_context == "TOOL_HEADER" else layout.row(align=True)
|
row = row if ui_context == "TOOL_HEADER" else layout.row(align=True)
|
||||||
add_layout_hotkey_operator(row, "Offset", "S_O", bpy.ops.bim.cad_offset.__doc__.split("\n", 1)[1].strip(), ui_context)
|
add_layout_hotkey_operator(
|
||||||
|
row, "Offset", "S_O", bpy.ops.bim.cad_offset.__doc__.split("\n", 1)[1].strip(), ui_context
|
||||||
|
)
|
||||||
|
|
||||||
else:
|
else:
|
||||||
if (
|
if (
|
||||||
@@ -168,19 +188,37 @@ class CadTool(WorkSpaceTool):
|
|||||||
add_layout_hotkey_operator(row, "Set Gable Roof Angle", "S_R", "Set Gable Roof Angle", ui_context)
|
add_layout_hotkey_operator(row, "Set Gable Roof Angle", "S_R", "Set Gable Roof Angle", ui_context)
|
||||||
|
|
||||||
row = layout.row(align=True)
|
row = layout.row(align=True)
|
||||||
add_layout_hotkey_operator(row, "Extend", "S_E", bpy.ops.bim.cad_trim_extend.__doc__.split("\n", 1)[1].strip(), ui_context)
|
add_layout_hotkey_operator(
|
||||||
|
row, "Extend", "S_E", bpy.ops.bim.cad_trim_extend.__doc__.split("\n", 1)[1].strip(), ui_context
|
||||||
|
)
|
||||||
row = row if ui_context == "TOOL_HEADER" else layout.row(align=True)
|
row = row if ui_context == "TOOL_HEADER" else layout.row(align=True)
|
||||||
add_layout_hotkey_operator(
|
add_layout_hotkey_operator(
|
||||||
row, "Join", "S_T", bpy.ops.bim.cad_mitre.__doc__.split("\n", 1)[1].strip(), ui_context
|
row, "Join", "S_T", bpy.ops.bim.cad_mitre.__doc__.split("\n", 1)[1].strip(), ui_context
|
||||||
)
|
)
|
||||||
row = row if ui_context == "TOOL_HEADER" else layout.row(align=True)
|
row = row if ui_context == "TOOL_HEADER" else layout.row(align=True)
|
||||||
add_layout_hotkey_operator(row, "Fillet", "S_F", bpy.ops.bim.add_ifcarcindex_fillet.__doc__.split("\n", 1)[1].strip(), ui_context)
|
add_layout_hotkey_operator(
|
||||||
|
row, "Fillet", "S_F", bpy.ops.bim.add_ifcarcindex_fillet.__doc__.split("\n", 1)[1].strip(), ui_context
|
||||||
|
)
|
||||||
row = row if ui_context == "TOOL_HEADER" else layout.row(align=True)
|
row = row if ui_context == "TOOL_HEADER" else layout.row(align=True)
|
||||||
add_layout_hotkey_operator(row, "Offset", "S_O", bpy.ops.bim.cad_offset.__doc__.split("\n", 1)[1].strip(), ui_context)
|
add_layout_hotkey_operator(
|
||||||
|
row, "Offset", "S_O", bpy.ops.bim.cad_offset.__doc__.split("\n", 1)[1].strip(), ui_context
|
||||||
|
)
|
||||||
row = row if ui_context == "TOOL_HEADER" else layout.row(align=True)
|
row = row if ui_context == "TOOL_HEADER" else layout.row(align=True)
|
||||||
add_layout_hotkey_operator(row, "2-Point Arc", "S_C", bpy.ops.bim.cad_arc_from_2_points.__doc__.split("\n", 1)[1].strip(), ui_context)
|
add_layout_hotkey_operator(
|
||||||
|
row,
|
||||||
|
"2-Point Arc",
|
||||||
|
"S_C",
|
||||||
|
bpy.ops.bim.cad_arc_from_2_points.__doc__.split("\n", 1)[1].strip(),
|
||||||
|
ui_context,
|
||||||
|
)
|
||||||
row = row if ui_context == "TOOL_HEADER" else layout.row(align=True)
|
row = row if ui_context == "TOOL_HEADER" else layout.row(align=True)
|
||||||
add_layout_hotkey_operator(row, "3-Point Arc", "S_V", bpy.ops.bim.cad_arc_from_3_points.__doc__.split("\n", 1)[1].strip(), ui_context)
|
add_layout_hotkey_operator(
|
||||||
|
row,
|
||||||
|
"3-Point Arc",
|
||||||
|
"S_V",
|
||||||
|
bpy.ops.bim.cad_arc_from_3_points.__doc__.split("\n", 1)[1].strip(),
|
||||||
|
ui_context,
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
class CadHotkey(bpy.types.Operator):
|
class CadHotkey(bpy.types.Operator):
|
||||||
|
|||||||
@@ -143,7 +143,9 @@ def assign_material(
|
|||||||
material_tool.add_material_to_set(material_set=material, material=default_material)
|
material_tool.add_material_to_set(material_set=material, material=default_material)
|
||||||
elif material_tool.is_a_material_set(assigned_material):
|
elif material_tool.is_a_material_set(assigned_material):
|
||||||
material_tool.add_material_to_set(material_set=assigned_material, material=material)
|
material_tool.add_material_to_set(material_set=assigned_material, material=material)
|
||||||
material_tool.ensure_material_assigned(elements=[element], material_type=element_material_type, material=material)
|
material_tool.ensure_material_assigned(
|
||||||
|
elements=[element], material_type=element_material_type, material=material
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
def unassign_material(ifc: type[tool.Ifc], material_tool: type[tool.Material], objects: list[bpy.types.Object]) -> None:
|
def unassign_material(ifc: type[tool.Ifc], material_tool: type[tool.Material], objects: list[bpy.types.Object]) -> None:
|
||||||
|
|||||||
Reference in New Issue
Block a user