Skip to content

Commit

Permalink
Arch: Fixed use of IfcOpenShell serializer
Browse files Browse the repository at this point in the history
  • Loading branch information
yorikvanhavre committed May 27, 2020
1 parent ff3cdfa commit 8752bc1
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/Mod/Arch/exportIFC.py
Expand Up @@ -2000,7 +2000,12 @@ def getRepresentation(ifcfile,context,obj,forcebrep=False,subtraction=False,tess
sh = obj.Shape.copy()
sh.Placement = obj.getGlobalPlacement()
sh.scale(preferences['SCALE_FACTOR']) # to meters
p = geom.serialise(sh.exportBrepToString())
try:
p = geom.serialise(sh.exportBrepToString())
except TypeError:
# IfcOpenShell v0.6.0
# Serialization.cpp:IfcUtil::IfcBaseClass* IfcGeom::serialise(const std::string& schema_name, const TopoDS_Shape& shape, bool advanced)
p = geom.serialise(preferences['SCHEMA'],sh.exportBrepToString())
if p:
productdef = ifcfile.add(p)
for rep in productdef.Representations:
Expand Down

0 comments on commit 8752bc1

Please sign in to comment.