mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-19 06:39:13 +00:00
black .
This commit is contained in:
@@ -61,7 +61,7 @@ class SelectByMaterial(bpy.types.Operator):
|
|||||||
material: bpy.props.IntProperty()
|
material: bpy.props.IntProperty()
|
||||||
|
|
||||||
def execute(self, context):
|
def execute(self, context):
|
||||||
material=tool.Ifc.get().by_id(self.material)
|
material = tool.Ifc.get().by_id(self.material)
|
||||||
core.select_by_material(tool.Material, tool.Spatial, material=material)
|
core.select_by_material(tool.Material, tool.Spatial, material=material)
|
||||||
|
|
||||||
# copy selection query to clipboard
|
# copy selection query to clipboard
|
||||||
|
|||||||
@@ -1157,6 +1157,7 @@ class ProductDecorator:
|
|||||||
"TRIS", product_preview_data["verts"], transparent_color(decorator_color), product_preview_data["tris"]
|
"TRIS", product_preview_data["verts"], transparent_color(decorator_color), product_preview_data["tris"]
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
class WallAxisDecorator:
|
class WallAxisDecorator:
|
||||||
is_installed = False
|
is_installed = False
|
||||||
handlers = []
|
handlers = []
|
||||||
@@ -1166,9 +1167,7 @@ class WallAxisDecorator:
|
|||||||
if cls.is_installed:
|
if cls.is_installed:
|
||||||
cls.uninstall()
|
cls.uninstall()
|
||||||
handler = cls()
|
handler = cls()
|
||||||
cls.handlers.append(
|
cls.handlers.append(SpaceView3D.draw_handler_add(handler.draw_wall_axis, (context,), "WINDOW", "POST_VIEW"))
|
||||||
SpaceView3D.draw_handler_add(handler.draw_wall_axis, (context,), "WINDOW", "POST_VIEW")
|
|
||||||
)
|
|
||||||
cls.is_installed = True
|
cls.is_installed = True
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
@@ -1206,9 +1205,7 @@ class WallAxisDecorator:
|
|||||||
if element.is_a("IfcWall"):
|
if element.is_a("IfcWall"):
|
||||||
layers = tool.Model.get_material_layer_parameters(element)
|
layers = tool.Model.get_material_layer_parameters(element)
|
||||||
axis = tool.Model.get_wall_axis(obj, layers)
|
axis = tool.Model.get_wall_axis(obj, layers)
|
||||||
verts = [tuple(list(v) + [0.0] )for v in axis["reference"]]
|
verts = [tuple(list(v) + [0.0]) for v in axis["reference"]]
|
||||||
self.draw_batch("LINES", verts, selected_elements_color, [(0,1)])
|
self.draw_batch("LINES", verts, selected_elements_color, [(0, 1)])
|
||||||
verts = [tuple(list(v) + [0.0] )for v in axis["side"]]
|
verts = [tuple(list(v) + [0.0]) for v in axis["side"]]
|
||||||
self.draw_batch("LINES", verts, unselected_elements_color, [(0,1)])
|
self.draw_batch("LINES", verts, unselected_elements_color, [(0, 1)])
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -770,12 +770,16 @@ class AddSlabFromWall(bpy.types.Operator, tool.Ifc.Operator):
|
|||||||
return {"FINISHED"}
|
return {"FINISHED"}
|
||||||
walls, is_closed_loop = tool.Model.get_connected_walls(bpy.context.selected_objects)
|
walls, is_closed_loop = tool.Model.get_connected_walls(bpy.context.selected_objects)
|
||||||
if not is_closed_loop:
|
if not is_closed_loop:
|
||||||
self.report({"WARNING"}, "Please select a closed loop of walls, or deselect the walls to add a slab using the polyline tool.")
|
self.report(
|
||||||
|
{"WARNING"},
|
||||||
|
"Please select a closed loop of walls, or deselect the walls to add a slab using the polyline tool.",
|
||||||
|
)
|
||||||
return {"FINISHED"}
|
return {"FINISHED"}
|
||||||
|
|
||||||
DumbSlabGenerator(self.relating_type).generate("WALLS")
|
DumbSlabGenerator(self.relating_type).generate("WALLS")
|
||||||
return {"FINISHED"}
|
return {"FINISHED"}
|
||||||
|
|
||||||
|
|
||||||
class DrawPolylineSlab(bpy.types.Operator, PolylineOperator):
|
class DrawPolylineSlab(bpy.types.Operator, PolylineOperator):
|
||||||
bl_idname = "bim.draw_polyline_slab"
|
bl_idname = "bim.draw_polyline_slab"
|
||||||
bl_label = "Draw Polyline Slab"
|
bl_label = "Draw Polyline Slab"
|
||||||
|
|||||||
@@ -518,7 +518,7 @@ class SelectIfcClass(Operator):
|
|||||||
if element := tool.Ifc.get_entity(obj):
|
if element := tool.Ifc.get_entity(obj):
|
||||||
classes.add(element.is_a())
|
classes.add(element.is_a())
|
||||||
predefined_types.add(ifcopenshell.util.element.get_predefined_type(element))
|
predefined_types.add(ifcopenshell.util.element.get_predefined_type(element))
|
||||||
result = ''
|
result = ""
|
||||||
for cls in classes:
|
for cls in classes:
|
||||||
for element in tool.Ifc.get().by_type(cls):
|
for element in tool.Ifc.get().by_type(cls):
|
||||||
if (
|
if (
|
||||||
@@ -759,10 +759,9 @@ class SelectSimilar(Operator, tool.Ifc.Operator):
|
|||||||
else:
|
else:
|
||||||
self.report({"INFO"}, f"Selected all objects that share the same ({key}) value")
|
self.report({"INFO"}, f"Selected all objects that share the same ({key}) value")
|
||||||
|
|
||||||
|
|
||||||
# copy selection query to clipboard
|
# copy selection query to clipboard
|
||||||
if not self.calculate_sum:
|
if not self.calculate_sum:
|
||||||
result = ''
|
result = ""
|
||||||
if value == True:
|
if value == True:
|
||||||
value = "TRUE"
|
value = "TRUE"
|
||||||
if value == False:
|
if value == False:
|
||||||
|
|||||||
@@ -198,7 +198,7 @@ class SelectSimilarType(bpy.types.Operator):
|
|||||||
continue
|
continue
|
||||||
relating_types.add(relating_type)
|
relating_types.add(relating_type)
|
||||||
|
|
||||||
result = ''
|
result = ""
|
||||||
for relating_type in relating_types:
|
for relating_type in relating_types:
|
||||||
related_objects = ifcopenshell.util.element.get_types(relating_type)
|
related_objects = ifcopenshell.util.element.get_types(relating_type)
|
||||||
|
|
||||||
@@ -211,13 +211,12 @@ class SelectSimilarType(bpy.types.Operator):
|
|||||||
related_objects_class = related_objects[0].is_a()
|
related_objects_class = related_objects[0].is_a()
|
||||||
relating_type_name = relating_type.Name
|
relating_type_name = relating_type.Name
|
||||||
if not result:
|
if not result:
|
||||||
result = f"{related_objects_class}, type=\"{relating_type_name}\""
|
result = f'{related_objects_class}, type="{relating_type_name}"'
|
||||||
else:
|
else:
|
||||||
result += f" + {related_objects_class}, type=\"{relating_type_name}\""
|
result += f' + {related_objects_class}, type="{relating_type_name}"'
|
||||||
bpy.context.window_manager.clipboard = result
|
bpy.context.window_manager.clipboard = result
|
||||||
self.report({"INFO"}, f"({result}) was copied to the clipboard.")
|
self.report({"INFO"}, f"({result}) was copied to the clipboard.")
|
||||||
|
|
||||||
|
|
||||||
return {"FINISHED"}
|
return {"FINISHED"}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user