From 3f236d042aa61e94276b5d1615460079fcb6bf84 Mon Sep 17 00:00:00 2001 From: Yorik van Havre Date: Fri, 8 Aug 2014 19:07:26 -0300 Subject: [PATCH] Arch: minor bugfixes --- src/Mod/Arch/importIFC.py | 6 +++--- src/Mod/Draft/Draft.py | 4 ++-- src/Mod/Draft/DraftTools.py | 3 ++- src/Mod/Draft/WorkingPlane.py | 1 + 4 files changed, 8 insertions(+), 6 deletions(-) diff --git a/src/Mod/Arch/importIFC.py b/src/Mod/Arch/importIFC.py index 7714ab140bf5..d416ff61e4b9 100644 --- a/src/Mod/Arch/importIFC.py +++ b/src/Mod/Arch/importIFC.py @@ -282,7 +282,7 @@ def export(exportList,filename): uid = None if hasattr(obj,"IfcAttributes"): if "IfcUID" in obj.IfcAttributes.keys(): - uid = obj.IfcAttributes["IfcUID"] + uid = str(obj.IfcAttributes["IfcUID"]) if not uid: uid = ifcopenshell.guid.compress(uuid.uuid1().hex) @@ -317,7 +317,7 @@ def export(exportList,filename): # setting the arguments args = [uid,history,name,description,None,placement,representation,None] - if ifctype in ["IfcSlab","IfcFooting"]: + if ifctype in ["IfcSlab","IfcFooting","IfcRoof"]: args = args + ["NOTDEFINED"] elif ifctype in ["IfcWindow","IfcDoor"]: args = args + [obj.Width.Value, obj.Height.Value] @@ -576,7 +576,7 @@ def getRepresentation(ifcfile,context,obj,forcebrep=False,subtraction=False,tess if shapes: - if FreeCAD.GuiUp and not subtraction: + if FreeCAD.GuiUp and (not subtraction) and hasattr(obj.ViewObject,"ShapeColor"): rgb = obj.ViewObject.ShapeColor col = ifcfile.createIfcColourRgb(None,rgb[0],rgb[1],rgb[2]) ssr = ifcfile.createIfcSurfaceStyleRendering(col,None,None,None,None,None,None,None,"FLAT") diff --git a/src/Mod/Draft/Draft.py b/src/Mod/Draft/Draft.py index 9ccc3303a562..c767eb4c046a 100644 --- a/src/Mod/Draft/Draft.py +++ b/src/Mod/Draft/Draft.py @@ -963,9 +963,9 @@ def makeCopy(obj,force=None,reparent=False): ArchWindow._ViewProviderWindow(newobj.ViewObject) elif (getType(obj) == "Sketch") or (force == "Sketch"): newobj = FreeCAD.ActiveDocument.addObject("Sketcher::SketchObject",getRealName(obj.Name)) - for geo in obj.Geometries: + for geo in obj.Geometry: newobj.addGeometry(geo) - for con in obj.constraints: + for con in obj.Constraints: newobj.addConstraint(con) elif obj.isDerivedFrom("Part::Feature"): newobj = FreeCAD.ActiveDocument.addObject("Part::Feature",getRealName(obj.Name)) diff --git a/src/Mod/Draft/DraftTools.py b/src/Mod/Draft/DraftTools.py index 6c789551c628..63e1d75bf727 100644 --- a/src/Mod/Draft/DraftTools.py +++ b/src/Mod/Draft/DraftTools.py @@ -155,8 +155,9 @@ def getSupport(args=None): if sel.HasSubObjects: if len(sel.SubElementNames) == 1: if "Face" in sel.SubElementNames[0]: + if plane.weak: plane.alignToFace(sel.SubObjects[0]) - return sel.Object + return sel.Object return None snapped = Draft.get3DView().getObjectInfo((args["Position"][0],args["Position"][1])) diff --git a/src/Mod/Draft/WorkingPlane.py b/src/Mod/Draft/WorkingPlane.py index 796a6c9f9c14..933bfe31ea44 100644 --- a/src/Mod/Draft/WorkingPlane.py +++ b/src/Mod/Draft/WorkingPlane.py @@ -233,6 +233,7 @@ def alignToFace(self, shape, offset=0): if not DraftVecUtils.equals(self.u.cross(self.v),self.axis): self.u = q[2] self.v = q[1] + self.weak = False return True else: return False