Skip to content

Commit

Permalink
Arch: minor bugfixes
Browse files Browse the repository at this point in the history
  • Loading branch information
yorikvanhavre committed Aug 8, 2014
1 parent 8a24f0f commit 3f236d0
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 6 deletions.
6 changes: 3 additions & 3 deletions src/Mod/Arch/importIFC.py
Expand Up @@ -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)

Expand Down Expand Up @@ -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]
Expand Down Expand Up @@ -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")
Expand Down
4 changes: 2 additions & 2 deletions src/Mod/Draft/Draft.py
Expand Up @@ -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))
Expand Down
3 changes: 2 additions & 1 deletion src/Mod/Draft/DraftTools.py
Expand Up @@ -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]))
Expand Down
1 change: 1 addition & 0 deletions src/Mod/Draft/WorkingPlane.py
Expand Up @@ -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
Expand Down

0 comments on commit 3f236d0

Please sign in to comment.