mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-18 14:31:39 +00:00
black .
This commit is contained in:
@@ -122,6 +122,7 @@ class ExtendWallsToWall(bpy.types.Operator, tool.Ifc.Operator):
|
|||||||
else:
|
else:
|
||||||
self.report({"ERROR"}, "Please select at least one LAYER2 element and one active LAYER2 element")
|
self.report({"ERROR"}, "Please select at least one LAYER2 element and one active LAYER2 element")
|
||||||
|
|
||||||
|
|
||||||
class ExtendWallsToPolylinePoint(bpy.types.Operator, PolylineOperator, tool.Ifc.Operator):
|
class ExtendWallsToPolylinePoint(bpy.types.Operator, PolylineOperator, tool.Ifc.Operator):
|
||||||
bl_idname = "bim.extend_walls_to_polyline_point"
|
bl_idname = "bim.extend_walls_to_polyline_point"
|
||||||
bl_label = "Extend Walls To Polyline Point"
|
bl_label = "Extend Walls To Polyline Point"
|
||||||
@@ -150,7 +151,7 @@ class ExtendWallsToPolylinePoint(bpy.types.Operator, PolylineOperator, tool.Ifc.
|
|||||||
start = Vector((axis["reference"][0][0], axis["reference"][0][1], obj.location.z))
|
start = Vector((axis["reference"][0][0], axis["reference"][0][1], obj.location.z))
|
||||||
end = Vector((axis["reference"][1][0], axis["reference"][1][1], obj.location.z))
|
end = Vector((axis["reference"][1][0], axis["reference"][1][1], obj.location.z))
|
||||||
direcion = end - start
|
direcion = end - start
|
||||||
value = end if connection=="ATSTART" else start
|
value = end if connection == "ATSTART" else start
|
||||||
self.input_ui.set_value("X", value[0])
|
self.input_ui.set_value("X", value[0])
|
||||||
self.input_ui.set_value("Y", value[1])
|
self.input_ui.set_value("Y", value[1])
|
||||||
self.input_ui.set_value("Z", value[2])
|
self.input_ui.set_value("Z", value[2])
|
||||||
@@ -194,13 +195,10 @@ class ExtendWallsToPolylinePoint(bpy.types.Operator, PolylineOperator, tool.Ifc.
|
|||||||
|
|
||||||
if event.value == "RELEASE" and event.type == "F":
|
if event.value == "RELEASE" and event.type == "F":
|
||||||
tool.Polyline.clear_polyline()
|
tool.Polyline.clear_polyline()
|
||||||
self.connection = "ATSTART" if self.connection=="ATEND" else "ATEND"
|
self.connection = "ATSTART" if self.connection == "ATEND" else "ATEND"
|
||||||
self.set_origin(context, event, self.connection)
|
self.set_origin(context, event, self.connection)
|
||||||
|
|
||||||
if (
|
if event.value == "RELEASE" and event.type in {"RET", "NUMPAD_ENTER", "RIGHTMOUSE", "LEFTMOUSE"}:
|
||||||
event.value == "RELEASE"
|
|
||||||
and event.type in {"RET", "NUMPAD_ENTER", "RIGHTMOUSE", "LEFTMOUSE"}
|
|
||||||
):
|
|
||||||
if self.tool_state.is_input_on:
|
if self.tool_state.is_input_on:
|
||||||
is_valid = self.recalculate_inputs(context)
|
is_valid = self.recalculate_inputs(context)
|
||||||
if is_valid:
|
if is_valid:
|
||||||
@@ -235,7 +233,6 @@ class ExtendWallsToPolylinePoint(bpy.types.Operator, PolylineOperator, tool.Ifc.
|
|||||||
tool.Blender.update_viewport()
|
tool.Blender.update_viewport()
|
||||||
return {"FINISHED"}
|
return {"FINISHED"}
|
||||||
|
|
||||||
|
|
||||||
self.handle_keyboard_input(context, event)
|
self.handle_keyboard_input(context, event)
|
||||||
|
|
||||||
cancel = self.handle_cancelation(context, event)
|
cancel = self.handle_cancelation(context, event)
|
||||||
@@ -256,6 +253,7 @@ class ExtendWallsToPolylinePoint(bpy.types.Operator, PolylineOperator, tool.Ifc.
|
|||||||
tool.Blender.update_viewport()
|
tool.Blender.update_viewport()
|
||||||
return {"RUNNING_MODAL"}
|
return {"RUNNING_MODAL"}
|
||||||
|
|
||||||
|
|
||||||
class AlignWall(bpy.types.Operator):
|
class AlignWall(bpy.types.Operator):
|
||||||
bl_idname = "bim.align_wall"
|
bl_idname = "bim.align_wall"
|
||||||
bl_label = "Align Wall"
|
bl_label = "Align Wall"
|
||||||
|
|||||||
@@ -733,7 +733,7 @@ class SelectSimilar(Operator, tool.Ifc.Operator):
|
|||||||
objects = context.selected_objects or [context.active_object]
|
objects = context.selected_objects or [context.active_object]
|
||||||
if not objects:
|
if not objects:
|
||||||
self.report({"WARNING"}, "No selected or active object found.")
|
self.report({"WARNING"}, "No selected or active object found.")
|
||||||
return {'CANCELLED'}
|
return {"CANCELLED"}
|
||||||
for obj in objects:
|
for obj in objects:
|
||||||
element = tool.Ifc.get_entity(obj)
|
element = tool.Ifc.get_entity(obj)
|
||||||
key = self.key
|
key = self.key
|
||||||
|
|||||||
@@ -51,7 +51,7 @@ def extend_walls(
|
|||||||
joiner: DumbWallJoiner,
|
joiner: DumbWallJoiner,
|
||||||
model: tool.Model,
|
model: tool.Model,
|
||||||
target: Vector,
|
target: Vector,
|
||||||
connection: Optional[str]=None,
|
connection: Optional[str] = None,
|
||||||
) -> None:
|
) -> None:
|
||||||
"""Extend selected walls to the target."""
|
"""Extend selected walls to the target."""
|
||||||
for obj in blender.get_selected_objects():
|
for obj in blender.get_selected_objects():
|
||||||
|
|||||||
Reference in New Issue
Block a user