Merge branch 'master' of https://github.com/FreeCAD/FreeCAD
This commit is contained in:
commit
b20dd3f7ab
|
@ -282,12 +282,14 @@ class _BimServerTaskPanel:
|
|||
FreeCAD.Console.PrintMessage(translate("Arch","Opening file...\n"))
|
||||
self.form.labelStatus.setText(translate("Arch","Opening file..."))
|
||||
if not tf:
|
||||
tf = tempfile.mkstemp(suffix=".ifc")[1]
|
||||
th,tf = tempfile.mkstemp(suffix=".ifc")
|
||||
f = open(tf,"wb")
|
||||
f.write(base64.b64decode(downloaddata))
|
||||
f.close()
|
||||
os.close(th)
|
||||
import importIFC
|
||||
importIFC.open(tf)
|
||||
os.remove(tf)
|
||||
self.form.labelStatus.setText("")
|
||||
|
||||
def uploadFile(self):
|
||||
|
|
|
@ -923,10 +923,11 @@ def export(exportList,filename):
|
|||
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]
|
||||
templatefilehandle,templatefile = tempfile.mkstemp(suffix=".ifc")
|
||||
of = pyopen(templatefile,"wb")
|
||||
of.write(template.encode("utf8"))
|
||||
of.close()
|
||||
os.close(templatefilehandle)
|
||||
global ifcfile, surfstyles, clones, sharedobjects
|
||||
ifcfile = ifcopenshell.open(templatefile)
|
||||
history = ifcfile.by_type("IfcOwnerHistory")[0]
|
||||
|
@ -1280,6 +1281,8 @@ def export(exportList,filename):
|
|||
if STORE_UID:
|
||||
# some properties might have been changed
|
||||
FreeCAD.ActiveDocument.recompute()
|
||||
|
||||
os.remove(templatefile)
|
||||
|
||||
|
||||
def getRepresentation(ifcfile,context,obj,forcebrep=False,subtraction=False,tessellation=1):
|
||||
|
|
|
@ -691,10 +691,11 @@ def getShape(obj,objid):
|
|||
try:
|
||||
if MAKETEMPFILES:
|
||||
import tempfile
|
||||
tf = tempfile.mkstemp(suffix=".brp")[1]
|
||||
th,tf = tempfile.mkstemp(suffix=".brp")
|
||||
of = pyopen(tf,"wb")
|
||||
of.write(brep_data)
|
||||
of.close()
|
||||
os.close(th)
|
||||
sh = Part.read(tf)
|
||||
os.remove(tf)
|
||||
else:
|
||||
|
|
|
@ -125,10 +125,11 @@ class SH3DHandler(xml.sax.ContentHandler):
|
|||
elif tag == "pieceOfFurniture":
|
||||
name = attributes["name"]
|
||||
data = self.z.read(attributes["model"])
|
||||
tf = tempfile.mkstemp(suffix=".obj")[1]
|
||||
th,tf = tempfile.mkstemp(suffix=".obj")
|
||||
f = pyopen(tf,"wb")
|
||||
f.write(data)
|
||||
f.close()
|
||||
os.close(th)
|
||||
m = Mesh.read(tf)
|
||||
fx = (float(attributes["width"])/100)/m.BoundBox.XLength
|
||||
fy = (float(attributes["height"])/100)/m.BoundBox.YLength
|
||||
|
@ -153,10 +154,11 @@ class SH3DHandler(xml.sax.ContentHandler):
|
|||
elif tag == "doorOrWindow":
|
||||
name = attributes["name"]
|
||||
data = self.z.read(attributes["model"])
|
||||
tf = tempfile.mkstemp(suffix=".obj")[1]
|
||||
th,tf = tempfile.mkstemp(suffix=".obj")
|
||||
f = pyopen(tf,"wb")
|
||||
f.write(data)
|
||||
f.close()
|
||||
os.close(th)
|
||||
m = Mesh.read(tf)
|
||||
fx = (float(attributes["width"])/100)/m.BoundBox.XLength
|
||||
fy = (float(attributes["height"])/100)/m.BoundBox.YLength
|
||||
|
|
Loading…
Reference in New Issue
Block a user