diff --git a/src/Mod/Arch/ArchAxis.py b/src/Mod/Arch/ArchAxis.py index e65bf40b68..2101cefc7b 100644 --- a/src/Mod/Arch/ArchAxis.py +++ b/src/Mod/Arch/ArchAxis.py @@ -531,8 +531,8 @@ class _ViewProviderAxis: pts = re.findall("point \[(.*?)\]",buf)[0] pts = pts.split(",") pc = [] - for p in pts: - v = p.strip().split() + for point in pts: + v = point.strip().split() pc.append([float(v[0]),float(v[1]),float(v[2])]) coords = coin.SoCoordinate3() coords.point.setValues(0,len(pc),pc) diff --git a/src/Mod/Arch/ArchCommands.py b/src/Mod/Arch/ArchCommands.py index 876f8d910e..d31b27a5b4 100644 --- a/src/Mod/Arch/ArchCommands.py +++ b/src/Mod/Arch/ArchCommands.py @@ -416,7 +416,6 @@ def getCutVolume(cutplane,shapes,clip=False,depth=None): bb.add(sh.BoundBox) bb.enlarge(1) # building cutplane space - placement = None um = vm = wm = 0 try: if hasattr(cutplane,"Shape"): @@ -578,9 +577,8 @@ def meshToShape(obj,mark=True,fast=True,tol=0.001,flat=False,cut=True): name = obj.Name if "Mesh" in obj.PropertiesList: - faces = [] mesh = obj.Mesh - plac = obj.Placement + #plac = obj.Placement solid = getShapeFromMesh(mesh,fast,tol,flat,cut) if solid: if solid.isClosed() and solid.isValid(): @@ -635,7 +633,7 @@ def removeShape(objs,mark=True): v1 = dims[0].multVec(v1) v2 = dims[0].multVec(v2) line = Draft.makeLine(v1,v2) - wal = ArchWall.makeWall(line,width=width,height=dims[3],name=name) + ArchWall.makeWall(line,width=width,height=dims[3],name=name) else: if mark: obj.ViewObject.ShapeColor = (1.0,0.0,0.0,1.0) @@ -1336,14 +1334,14 @@ def printMessage( message ): if FreeCAD.GuiUp : if sys.version_info.major < 3: message = message.decode("utf8") - reply = QtGui.QMessageBox.information( None , "" , message ) + QtGui.QMessageBox.information( None , "" , message ) def printWarning( message ): FreeCAD.Console.PrintMessage( message ) if FreeCAD.GuiUp : if sys.version_info.major < 3: message = message.decode("utf8") - reply = QtGui.QMessageBox.warning( None , "" , message ) + QtGui.QMessageBox.warning( None , "" , message ) # command definitions ############################################### diff --git a/src/Mod/Arch/ArchComponent.py b/src/Mod/Arch/ArchComponent.py index 69b063a04b..b454feec3e 100644 --- a/src/Mod/Arch/ArchComponent.py +++ b/src/Mod/Arch/ArchComponent.py @@ -1060,7 +1060,6 @@ class Component(ArchIFC.IfcProduct): if obj.IfcType.endswith("Standard Case"): return True # Try to guess - import ArchIFC if obj.IfcType + " Standard Case" in ArchIFC.IfcTypes: # this type has a standard case if obj.Additions or obj.Subtractions: diff --git a/src/Mod/Arch/ArchCurtainWall.py b/src/Mod/Arch/ArchCurtainWall.py index 4696a79483..6f85f31113 100644 --- a/src/Mod/Arch/ArchCurtainWall.py +++ b/src/Mod/Arch/ArchCurtainWall.py @@ -602,7 +602,7 @@ class ViewProviderCurtainWall(ArchComponent.ViewProviderComponent): colors = [] nmullions = obj.VerticalMullionNumber + obj.HorizontalMullionNumber + obj.DiagonalMullionNumber for i,solid in enumerate(obj.Shape.Solids): - for f in solid.Faces: + for _ in solid.Faces: if i < nmullions: colors.append(basecolor) else: diff --git a/src/Mod/Arch/ArchCutPlane.py b/src/Mod/Arch/ArchCutPlane.py index 00ac07d8d8..fbc804a647 100644 --- a/src/Mod/Arch/ArchCutPlane.py +++ b/src/Mod/Arch/ArchCutPlane.py @@ -119,7 +119,7 @@ class _CutPlaneTaskPanel: self.linecut=linecut self.plan=None if linecut: - self.plan=plan=getPlanWithLine(FreeCADGui.Selection.getSelectionEx()[1].SubObjects[0]) + self.plan = getPlanWithLine(FreeCADGui.Selection.getSelectionEx()[1].SubObjects[0]) else : self.plan = FreeCADGui.Selection.getSelectionEx()[1].SubObjects[0] diff --git a/src/Mod/Arch/ArchIFC.py b/src/Mod/Arch/ArchIFC.py index 3ab5ea20eb..f2c439932f 100644 --- a/src/Mod/Arch/ArchIFC.py +++ b/src/Mod/Arch/ArchIFC.py @@ -289,7 +289,6 @@ class IfcRoot: QT_TRANSLATE_NOOP("App::Property", "Description of IFC attributes are not yet implemented")) setattr(obj, attribute["name"], attribute["enum_values"]) else: - import ArchIFCSchema propertyType = "App::" + ArchIFCSchema.IfcTypes[attribute["type"]]["property"] obj.addProperty(propertyType, attribute["name"], diff --git a/src/Mod/Arch/ArchMaterial.py b/src/Mod/Arch/ArchMaterial.py index 1b125a2bad..6dbcce39f2 100644 --- a/src/Mod/Arch/ArchMaterial.py +++ b/src/Mod/Arch/ArchMaterial.py @@ -21,7 +21,8 @@ import FreeCAD if FreeCAD.GuiUp: - import FreeCADGui, Arch_rc, os + import FreeCADGui, os + import Arch_rc # Needed for access to icons # lgtm [py/unused_import] from PySide import QtCore, QtGui from DraftTools import translate from PySide.QtCore import QT_TRANSLATE_NOOP @@ -537,7 +538,6 @@ class _ArchMaterialTaskPanel: except Exception: self.form.ButtonCode.hide() else: - import os self.form.ButtonCode.setIcon(QtGui.QIcon(os.path.join(os.path.dirname(BimClassification.__file__),"icons","BIM_Classification.svg"))) if self.obj: if hasattr(self.obj,"Material"): diff --git a/src/Mod/Arch/ArchNesting.py b/src/Mod/Arch/ArchNesting.py index 45ca853378..a9eff2a0e7 100644 --- a/src/Mod/Arch/ArchNesting.py +++ b/src/Mod/Arch/ArchNesting.py @@ -291,7 +291,6 @@ class Nester: nofitpol = [] for placed in sheet: pts = [] - pi = 0 for placedvert in self.order(placed[1],right=True): fpts = [] for i,rotvert in enumerate(rotverts): diff --git a/src/Mod/Arch/ArchReference.py b/src/Mod/Arch/ArchReference.py index 861db01306..c62321b8c4 100644 --- a/src/Mod/Arch/ArchReference.py +++ b/src/Mod/Arch/ArchReference.py @@ -183,14 +183,14 @@ class ArchReference: for edge in shape.Edges: found = False for solid in shape.Solids: - if found: - break for soledge in solid.Edges: - if found: - break if edge.hashCode() == soledge.hashCode(): found = True break + if found: + break + if found: + break else: shapes.append(edge) print("solids:",len(shape.Solids),"mattable:",materials) diff --git a/src/Mod/Arch/ArchSectionPlane.py b/src/Mod/Arch/ArchSectionPlane.py index 1bdeb66ff3..af649de304 100644 --- a/src/Mod/Arch/ArchSectionPlane.py +++ b/src/Mod/Arch/ArchSectionPlane.py @@ -469,8 +469,8 @@ def getSVG(source, hshapes = source.Proxy.shapecache[1] sshapes = source.Proxy.shapecache[2] cutface = source.Proxy.shapecache[3] - cutvolume = source.Proxy.shapecache[4] - invcutvolume = source.Proxy.shapecache[5] + # cutvolume = source.Proxy.shapecache[4] # Unused + # invcutvolume = source.Proxy.shapecache[5] # Unused objectSshapes = source.Proxy.shapecache[6] else: if showFill: @@ -638,10 +638,6 @@ def getDXF(obj): return result if not allOn: objs = Draft.removeHidden(objs) - # separate spaces and Draft objects - spaces = [] - nonspaces = [] - drafts = [] objs = [o for o in objs if ((not(Draft.getType(o) in ["Space","Dimension","Annotation"])) and (not (o.isDerivedFrom("Part::Part2DObject"))))] vshapes,hshapes,sshapes,cutface,cutvolume,invcutvolume = getCutShapes(objs,cutplane,onlySolids,clip,False,showHidden) if vshapes: diff --git a/src/Mod/Arch/ArchSite.py b/src/Mod/Arch/ArchSite.py index a2eed40cca..da55e26a61 100644 --- a/src/Mod/Arch/ArchSite.py +++ b/src/Mod/Arch/ArchSite.py @@ -232,7 +232,7 @@ def makeSolarDiagram(longitude,latitude,scale=1,complete=False,tz=None): numsep = coin.SoSeparator() pathsep = coin.SoSeparator() hoursep = coin.SoSeparator() - hournumsep = coin.SoSeparator() + #hournumsep = coin.SoSeparator() mastersep.addChild(circlesep) mastersep.addChild(numsep) mastersep.addChild(pathsep) diff --git a/src/Mod/Arch/ArchStairs.py b/src/Mod/Arch/ArchStairs.py index 6906fd06de..d247fe9d98 100644 --- a/src/Mod/Arch/ArchStairs.py +++ b/src/Mod/Arch/ArchStairs.py @@ -60,7 +60,6 @@ def makeStairs(baseobj=None,length=None,width=None,height=None,steps=None,name=" return p = FreeCAD.ParamGet("User parameter:BaseApp/Preferences/Mod/Arch") - bases = [] stairs = [] additions = []