Arch: More minor fixes

This commit is contained in:
Yorik van Havre 2014-06-10 23:13:23 -03:00
parent 7e20c0c01c
commit 57999cb78d
2 changed files with 9 additions and 6 deletions

View File

@ -600,11 +600,13 @@ def check(objectslist,includehidden=False):
def getTuples(data,scale=1,placement=None,normal=None,close=True):
"""getTuples(data,[scale,placement,normal,close]): returns a tuple or a list of tuples from a vector
or from the vertices of a shape. Scale can indicate a scale factor"""
rnd = True
import Part
if isinstance(data,FreeCAD.Vector):
if placement:
data = placement.multVec(data)
data = DraftVecUtils.rounded(data)
if rnd:
data = DraftVecUtils.rounded(data)
return (data.x*scale,data.y*scale,data.z*scale)
elif isinstance(data,Part.Shape):
t = []
@ -626,7 +628,8 @@ def getTuples(data,scale=1,placement=None,normal=None,close=True):
if placement:
if not placement.isNull():
pt = placement.multVec(pt)
pt = DraftVecUtils.rounded(pt)
if rnd:
pt = DraftVecUtils.rounded(pt)
t.append((pt.x*scale,pt.y*scale,pt.z*scale))
if close: # faceloops must not be closed, but ifc profiles must.

View File

@ -1036,6 +1036,7 @@ def export(exportList,filename):
if not fdata:
if obj.isDerivedFrom("Part::Feature"):
print " Error retrieving the shape of object ", obj.Label
unprocessed.append(obj)
continue
else:
if DEBUG: print " No geometry"
@ -1081,11 +1082,9 @@ def export(exportList,filename):
ifctype = "IfcBuildingElementProxy"
extra = ["ELEMENT"]
if representation:
p = ifc.addProduct( ifctype, representation, storey=parent, placement=placement, name=name, description=descr, extra=extra )
p = ifc.addProduct( ifctype, representation, storey=parent, placement=placement, name=name, description=descr, extra=extra )
if p:
# removing openings
if SEPARATE_OPENINGS and gdata:
for o in obj.Subtractions:
@ -1102,7 +1101,7 @@ def export(exportList,filename):
else:
unprocessed.append(obj)
else:
if DEBUG: print "IFC export: object type ", otype, " is not supported yet."
if DEBUG: print "Object type ", otype, " is not supported yet."
ifc.write()
@ -1131,6 +1130,7 @@ def export(exportList,filename):
FreeCAD.ActiveDocument.recompute()
if unprocessed:
print ""
print "WARNING: Some objects were not exported. See importIFC.unprocessed"