Skip to content

Commit

Permalink
added brep support in zip
Browse files Browse the repository at this point in the history
  • Loading branch information
easyw committed Jul 25, 2018
1 parent 80cf237 commit 02f710c
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 2 deletions.
2 changes: 1 addition & 1 deletion InitGui.py
Expand Up @@ -14,7 +14,7 @@
global myurlKWB
myurlKWB='https://github.com/easyw/kicadStepUpMod'
global mycommitsKWB
mycommitsKWB=124 #v7.7.2
mycommitsKWB=125 #v7.7.2

import FreeCAD, FreeCADGui, Part, os, sys
import re, time
Expand Down
19 changes: 18 additions & 1 deletion ZipStepImport.py
Expand Up @@ -29,7 +29,7 @@

import os,zipfile,FreeCAD,tempfile,sys

___ZipVersion___ = "1.0.2"
___ZipVersion___ = "1.0.3"

try:
import __builtin__ as builtin #py2
Expand Down Expand Up @@ -128,4 +128,21 @@ def read(filename):
except OSError:
FreeCAD.Console.PrintError("error on removing "+tempfilepath+" file")
pass
elif '.brep' in f.lower(): #\
fname=f
tempdir = tempfile.gettempdir() # get the current temporary directory
tempfilepath = os.path.join(tempdir,fname) # + ext)
z.extract(fname, tempdir)
doc=FreeCAD.ActiveDocument
import Part
#Part.open(tempfilepath,doc.Name)
Part.insert(tempfilepath,doc.Name)
#FreeCAD.open(tempfilepath)
#ImportGui.insert(tempfilepath,doc.Name)
FreeCADGui.SendMsgToActiveView("ViewFit")
try:
os.remove(tempfilepath)
except OSError:
FreeCAD.Console.PrintError("error on removing "+tempfilepath+" file")
pass

0 comments on commit 02f710c

Please sign in to comment.