diff --git a/src/Mod/Arch/ArchMaterial.py b/src/Mod/Arch/ArchMaterial.py index bc035f7bf..71c71ca8e 100644 --- a/src/Mod/Arch/ArchMaterial.py +++ b/src/Mod/Arch/ArchMaterial.py @@ -219,6 +219,7 @@ class _ArchMaterialTaskPanel: self.obj.Material = self.material self.obj.Label = self.material['Name'] FreeCADGui.ActiveDocument.resetEdit() + FreeCADGui.Control.closeDialog() def chooseMat(self, card): "sets self.material from a card" @@ -247,7 +248,7 @@ class _ArchMaterialTaskPanel: if e.upper() == ".FCMAT": self.cards[b] = p + os.sep + f if self.cards: - for k,i in self.cards.items(): + for k in sorted(self.cards.keys()): self.form.comboBox_MaterialsInDir.addItem(k) def openEditor(self): diff --git a/src/Mod/Arch/ArchSectionPlane.py b/src/Mod/Arch/ArchSectionPlane.py index fce4ff8fd..8963c6850 100644 --- a/src/Mod/Arch/ArchSectionPlane.py +++ b/src/Mod/Arch/ArchSectionPlane.py @@ -357,20 +357,28 @@ class _ArchDrawingView: os.append(o) objs = os self.svg = '' + fillpattern = '\n' for f in self.faces: if f: fill = self.getFill(f[1]) - svg +='\n' + svg += '\n' return svg - def getSectionSVG(self,linewidth=0.02): + def getSectionSVG(self,linewidth=0.02,fillpattern=None): "Returns a SVG fragment from cut faces" if DEBUG: print "Printing ", len(self.sections), " sections" if not self.oriented: self.reorient() - svg = '' + svg = '\n' for f in self.sections: if f: - fill = self.getFill(f[1]) + if fillpattern: + if "#" in fillpattern: # color + fill = fillpattern + else: + fill="url(#"+fillpattern+")" # pattern name + else: + fill = 'none' # none svg +='\n' + svg += '\n' return svg def getHiddenSVG(self,linewidth=0.02): @@ -637,19 +632,13 @@ class Renderer: if DEBUG: print "Printing ", len(self.sections), " hidden faces" if not self.oriented: self.reorient() - svg = '' + svg = '\n' for e in self.hiddenEdges: svg +=' 2: obj.setEditorMode('Start',2) obj.setEditorMode('End',2) - obj.setEditorMode('Length',2) + if hasattr(obj,"Length"): + obj.setEditorMode('Length',2) class _ViewProviderWire(_ViewProviderDraft): diff --git a/src/Mod/Draft/WorkingPlane.py b/src/Mod/Draft/WorkingPlane.py index 2c6f4bec8..de0a385d6 100644 --- a/src/Mod/Draft/WorkingPlane.py +++ b/src/Mod/Draft/WorkingPlane.py @@ -302,6 +302,11 @@ class plane: self.u = rot.multVec(FreeCAD.Vector(1,0,0)) self.v = rot.multVec(FreeCAD.Vector(0,1,0)) self.axis = rot.multVec(FreeCAD.Vector(0,0,1)) + + def inverse(self): + "inverts the direction of the working plane" + self.u = self.u.negative() + self.axis = self.axis.negative() def save(self): "stores the current plane state"