diff --git a/InitGui.py b/InitGui.py index 7386bb4..dd919ad 100644 --- a/InitGui.py +++ b/InitGui.py @@ -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 diff --git a/ZipStepImport.py b/ZipStepImport.py index 2353eab..34a4488 100644 --- a/ZipStepImport.py +++ b/ZipStepImport.py @@ -29,7 +29,7 @@ import os,zipfile,FreeCAD,tempfile,sys -___ZipVersion___ = "1.0.2" +___ZipVersion___ = "1.0.3" try: import __builtin__ as builtin #py2 @@ -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 \ No newline at end of file