diff --git a/src/bonsai/bonsai/bim/module/drawing/sheeter.py b/src/bonsai/bonsai/bim/module/drawing/sheeter.py index b3e4c556db..a2048f8ea8 100644 --- a/src/bonsai/bonsai/bim/module/drawing/sheeter.py +++ b/src/bonsai/bonsai/bim/module/drawing/sheeter.py @@ -397,13 +397,17 @@ class SheetBuilder: data.update({"Sheet" + k: v for k, v in sheet.get_info().items()}) if not data["Name"]: data["Name"] = ntpath.basename(foreground_path)[0:-4] - - #If a perspective drawing, don't add scale to view title + + # If a perspective drawing, don't add scale to view title try: - is_perspective = drawing.Representation.Representations[0].Items[0].TreeRootExpression.FirstOperand.is_a("IfcRectangularPyramid") + is_perspective = ( + drawing.Representation.Representations[0] + .Items[0] + .TreeRootExpression.FirstOperand.is_a("IfcRectangularPyramid") + ) except AttributeError: is_perspective = False - + if not is_perspective: data["Scale"] = tool.Drawing.get_drawing_human_scale(drawing) view.append(self.parse_embedded_svg(view_title, data)) diff --git a/src/bonsai/bonsai/bim/module/geometry/operator.py b/src/bonsai/bonsai/bim/module/geometry/operator.py index ff41e388f4..ed6324d67d 100644 --- a/src/bonsai/bonsai/bim/module/geometry/operator.py +++ b/src/bonsai/bonsai/bim/module/geometry/operator.py @@ -1109,7 +1109,7 @@ class OverrideDuplicateMove(bpy.types.Operator): single_obj = False if len(old_to_new) == 1: single_obj = True - + for new in old_to_new.values(): if not hasattr(new[0], "ConnectedTo"): continue diff --git a/src/bonsai/bonsai/bim/module/model/wall.py b/src/bonsai/bonsai/bim/module/model/wall.py index 5bb38cc3ef..84383ee7d8 100644 --- a/src/bonsai/bonsai/bim/module/model/wall.py +++ b/src/bonsai/bonsai/bim/module/model/wall.py @@ -1565,7 +1565,7 @@ class DumbWallJoiner: axis1 = tool.Model.get_wall_axis(wall1, layers1) bases = [axis1["base"][0].to_3d(), axis1["base"][1].to_3d(), axis1["side"][0].to_3d(), axis1["side"][1].to_3d()] - bases = [Vector((v[0], v[1], wall1.matrix_world.translation.z)) for v in bases] # add wall Z location + bases = [Vector((v[0], v[1], wall1.matrix_world.translation.z)) for v in bases] # add wall Z location extrusion = self.get_extrusion_data(tool.Ifc.get().by_id(wall1.data.BIMMeshProperties.ifc_definition_id)) wall_dir = wall1.matrix_world.to_quaternion() @ extrusion["direction"] diff --git a/src/ifcopenshell-python/ifcopenshell/alignment.py b/src/ifcopenshell-python/ifcopenshell/alignment.py index 9b52da0d84..a40151068d 100644 --- a/src/ifcopenshell-python/ifcopenshell/alignment.py +++ b/src/ifcopenshell-python/ifcopenshell/alignment.py @@ -47,7 +47,7 @@ def evaluate_representation(shape_rep: entity_instance, dist_along: float) -> np s = ifcopenshell.geom.settings() piecewise_function = ifcopenshell_wrapper.map_shape(s, shape_rep.wrapped_data) - pwf_evaluator = ifcopenshell_wrapper.piecewise_function_evaluator(piecewise_function,s) + pwf_evaluator = ifcopenshell_wrapper.piecewise_function_evaluator(piecewise_function, s) trans_matrix = pwf_evaluator.evaluate(dist_along) @@ -69,7 +69,7 @@ def evaluate_segment(segment: entity_instance, dist_along: float) -> np.ndarray: s = ifcopenshell.geom.settings() piecewise_function = ifcopenshell_wrapper.map_shape(s, segment.wrapped_data) - pwf_evaluator = ifcopenshell_wrapper.piecewise_function_evaluator(piecewise_function,s) + pwf_evaluator = ifcopenshell_wrapper.piecewise_function_evaluator(piecewise_function, s) trans_matrix = pwf_evaluator.evaluate(dist_along)