Repository: FreeCAD/FreeCAD
File: src/Mod/BIM/ArchWall.py (Python)

Code before:
                        else:
                            FreeCAD.Console.PrintWarning(
                                translate("Arch", "Cannot compute blocks for wall")
                                + obj.Label
                                + "\n"
                            )

            elif obj.Base.isDerivedFrom("Mesh::Feature"):
                if obj.Base.Mesh.isSolid():
                    if obj.Base.Mesh.countComponents() == 1:
                        sh = ArchCommands.getShapeFromMesh(obj.Base.Mesh)
                        if sh.isClosed() and sh.isValid() and sh.Solids and (not sh.isNull()):
                            base = sh
                        else:
                            FreeCAD.Console.PrintWarning(
                                translate("Arch", "This mesh is an invalid solid") + "\n"
                            )
                            obj.Base.ViewObject.show()

        # Check if there is base, and if width and height is provided or not
        # Provide users message below to check the setting of the Wall object
        if not base and (self.noWidths or self.noHeight):
            print("Wall object.Label : ", obj.Label)
            if self.noWidths:
                print(
                    "- Found 0 in Width, OverrideWidth and return width 0 from Base ArchSketch (if using)."
                )
            if self.noHeight:
                print("- Found 0 in Height.")
            print(
                "- In this case, the Wall object would have no volume if  1) its Base has no object which has Solid and  2) its Additions has no object etc."
            )
        if not base:
            # FreeCAD.Console.PrintError(translate("Arch","Error: Invalid base object")+"\n")
            # return
            # walls can be made of only a series of additions and have no base shape
            base = Part.Shape()
        base = self.processSubShapes(obj, base, pl)
        self.applyShape(obj, base, pl)

        # count blocks
        if hasattr(obj, "MakeBlocks"):
            if obj.MakeBlocks:
                fvol = obj.BlockLength.Value * obj.BlockHeight.Value * obj.Width.Value
                if fvol:
                    # print("base volume:",fvol)
                    # for s in base.Solids:
                    # print(abs(s.Volume - fvol))
                    ents = [s for s in base.Solids if abs(s.Volume - fvol) < 1]
                    obj.CountEntire = len(ents)
                    obj.CountBroken = len(base.Solids) - len(ents)

Review comment (suggestion):
Most of these comments apply to all the `print()` messages:

- Use `FreeCAD.Console.PrintWarning()` or any of the other `FreeCAD.Console.Print*` functions instead of `print()`. 
- Please consider not mentioning `ArchSketch` here - only those users who have installed it will know what it is, but it will confuse other users
- The text should be translatable
- The text itself needs some improvements for readability

Code after:
                                + "\n"
                            )

            elif obj.Base.isDerivedFrom("Mesh::Feature"):
                if obj.Base.Mesh.isSolid():
                    if obj.Base.Mesh.countComponents() == 1:
                        sh = ArchCommands.getShapeFromMesh(obj.Base.Mesh)
                        if sh.isClosed() and sh.isValid() and sh.Solids and (not sh.isNull()):
                            base = sh
                        else:
                            FreeCAD.Console.PrintWarning(
                                translate("Arch", "This mesh is an invalid solid") + "\n"
                            )
                            obj.Base.ViewObject.show()
        if not base:
            # FreeCAD.Console.PrintError(translate("Arch","Error: Invalid base object")+"\n")
            # return
            # walls can be made of only a series of additions and have no base shape
            base = Part.Shape()
        base = self.processSubShapes(obj, base, pl)
        self.applyShape(obj, base, pl)

        # Check if there is base, and if width and height is provided or not
        # Provide users message below to check the setting of the Wall object
        if base.isNull() and (self.noWidths or self.noHeight):
            FreeCAD.Console.PrintWarning(
                translate(
                    "Arch",
                    f"Cannot create or update {obj.Label} as its length, height or width is zero, and there are no solids in its additions",
                )
                + "\n"
            )

        # count blocks
        if hasattr(obj, "MakeBlocks"):
            if obj.MakeBlocks:
                fvol = obj.BlockLength.Value * obj.BlockHeight.Value * obj.Width.Value
                if fvol:
                    # print("base volume:",fvol)
                    # for s in base.Solids:
                    # print(abs(s.Volume - fvol))
                    ents = [s for s in base.Solids if abs(s.Volume - fvol) < 1]
                    obj.CountEntire = len(ents)
                    obj.CountBroken = len(base.Solids) - len(ents)
                else:
                    obj.CountEntire = 0
                    obj.CountBroken = 0

        # set the length property
        if self.connectEdges:
            l = float(0)