Skip to content

Commit

Permalink
Arch: More minor fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
yorikvanhavre committed Jun 11, 2014
1 parent 7e20c0c commit 57999cb
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
7 changes: 5 additions & 2 deletions src/Mod/Arch/ArchCommands.py
Expand Up @@ -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 = []
Expand All @@ -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.
Expand Down
8 changes: 4 additions & 4 deletions src/Mod/Arch/importIFC.py
Expand Up @@ -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"
Expand Down Expand Up @@ -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:
Expand All @@ -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()
Expand Down Expand Up @@ -1131,6 +1130,7 @@ def export(exportList,filename):
FreeCAD.ActiveDocument.recompute()

if unprocessed:
print ""
print "WARNING: Some objects were not exported. See importIFC.unprocessed"


Expand Down

0 comments on commit 57999cb

Please sign in to comment.