Arch: small bugfix in IFC importer
This commit is contained in:
parent
686f2adc58
commit
5ae28eb038
|
@ -90,7 +90,7 @@ def decode(filename,utf=False):
|
|||
if isinstance(filename,unicode):
|
||||
# workaround since ifcopenshell currently can't handle unicode filenames
|
||||
if utf:
|
||||
encoding = True
|
||||
encoding = "utf8"
|
||||
else:
|
||||
import sys
|
||||
encoding = sys.getfilesystemencoding()
|
||||
|
@ -681,22 +681,22 @@ def export(exportList,filename):
|
|||
s = owner.split("<")
|
||||
owner = s[0]
|
||||
email = s[1].strip(">")
|
||||
global ifctemplate
|
||||
ifctemplate = ifctemplate.replace("$version",version[0]+"."+version[1]+" build "+version[2])
|
||||
ifctemplate = ifctemplate.replace("$owner",owner)
|
||||
ifctemplate = ifctemplate.replace("$company",FreeCAD.ActiveDocument.Company)
|
||||
ifctemplate = ifctemplate.replace("$email",email)
|
||||
ifctemplate = ifctemplate.replace("$now",str(int(time.time())))
|
||||
ifctemplate = ifctemplate.replace("$projectid",FreeCAD.ActiveDocument.Uid[:22].replace("-","_"))
|
||||
ifctemplate = ifctemplate.replace("$project",FreeCAD.ActiveDocument.Name)
|
||||
ifctemplate = ifctemplate.replace("$filename",filename)
|
||||
ifctemplate = ifctemplate.replace("$timestamp",str(time.strftime("%Y-%m-%dT%H:%M:%S", time.gmtime())))
|
||||
template = tempfile.mkstemp(suffix=".ifc")[1]
|
||||
of = pyopen(template,"wb")
|
||||
of.write(ifctemplate.encode("utf8"))
|
||||
global template
|
||||
template = ifctemplate.replace("$version",version[0]+"."+version[1]+" build "+version[2])
|
||||
template = template.replace("$owner",owner)
|
||||
template = template.replace("$company",FreeCAD.ActiveDocument.Company)
|
||||
template = template.replace("$email",email)
|
||||
template = template.replace("$now",str(int(time.time())))
|
||||
template = template.replace("$projectid",FreeCAD.ActiveDocument.Uid[:22].replace("-","_"))
|
||||
template = template.replace("$project",FreeCAD.ActiveDocument.Name)
|
||||
template = template.replace("$filename",filename)
|
||||
template = template.replace("$timestamp",str(time.strftime("%Y-%m-%dT%H:%M:%S", time.gmtime())))
|
||||
templatefile = tempfile.mkstemp(suffix=".ifc")[1]
|
||||
of = pyopen(templatefile,"wb")
|
||||
of.write(template.encode("utf8"))
|
||||
of.close()
|
||||
global ifcfile, surfstyles
|
||||
ifcfile = ifcopenshell.open(template)
|
||||
ifcfile = ifcopenshell.open(templatefile)
|
||||
history = ifcfile.by_type("IfcOwnerHistory")[0]
|
||||
context = ifcfile.by_type("IfcGeometricRepresentationContext")[0]
|
||||
project = ifcfile.by_type("IfcProject")[0]
|
||||
|
|
Loading…
Reference in New Issue
Block a user