First fully working version, ready for user testing.
This commit is contained in:
parent
ccf2032b8b
commit
765c9d168d
|
@ -110,24 +110,21 @@ class CadQueryExecuteExample:
|
||||||
module_base_path = module_locator.module_path()
|
module_base_path = module_locator.module_path()
|
||||||
exs_dir_path = os.path.join(module_base_path, 'Examples')
|
exs_dir_path = os.path.join(module_base_path, 'Examples')
|
||||||
|
|
||||||
#We need to close any file that's already open in the editor window
|
|
||||||
# CadQueryCloseScript().Activated()
|
|
||||||
|
|
||||||
#Append this script's directory to sys.path
|
#Append this script's directory to sys.path
|
||||||
sys.path.append(os.path.dirname(exs_dir_path))
|
sys.path.append(os.path.dirname(exs_dir_path))
|
||||||
|
|
||||||
#We've created a library that FreeCAD can use as well to open CQ files
|
#We've created a library that FreeCAD can use as well to open CQ files
|
||||||
ImportCQ.open(os.path.join(exs_dir_path, self.exFile))
|
ImportCQ.open(os.path.join(exs_dir_path, self.exFile))
|
||||||
|
|
||||||
docname = os.path.splitext(os.path.basename(self.exFile))[0]
|
# docname = os.path.splitext(os.path.basename(self.exFile))[0]
|
||||||
FreeCAD.newDocument(docname)
|
# FreeCAD.newDocument(docname)
|
||||||
|
|
||||||
#Execute the script
|
#Execute the script
|
||||||
CadQueryExecuteScript().Activated()
|
#CadQueryExecuteScript().Activated()
|
||||||
|
|
||||||
#Get a nice view of our model
|
#Get a nice view of our model
|
||||||
FreeCADGui.activeDocument().activeView().viewAxometric()
|
#FreeCADGui.activeDocument().activeView().viewAxometric()
|
||||||
FreeCADGui.SendMsgToActiveView("ViewFit")
|
#FreeCADGui.SendMsgToActiveView("ViewFit")
|
||||||
|
|
||||||
|
|
||||||
class CadQueryExecuteScript:
|
class CadQueryExecuteScript:
|
||||||
|
@ -243,15 +240,15 @@ class CadQueryOpenScript:
|
||||||
#We've created a library that FreeCAD can use as well to open CQ files
|
#We've created a library that FreeCAD can use as well to open CQ files
|
||||||
ImportCQ.open(filename[0])
|
ImportCQ.open(filename[0])
|
||||||
|
|
||||||
docname = os.path.splitext(os.path.basename(filename[0]))[0]
|
# docname = os.path.splitext(os.path.basename(filename[0]))[0]
|
||||||
FreeCAD.newDocument(docname)
|
# FreeCAD.newDocument(docname)
|
||||||
|
|
||||||
#Execute the script
|
#Execute the script
|
||||||
CadQueryExecuteScript().Activated()
|
# CadQueryExecuteScript().Activated()
|
||||||
|
|
||||||
#Get a nice view of our model
|
#Get a nice view of our model
|
||||||
FreeCADGui.activeDocument().activeView().viewAxometric()
|
# FreeCADGui.activeDocument().activeView().viewAxometric()
|
||||||
FreeCADGui.SendMsgToActiveView("ViewFit")
|
# FreeCADGui.SendMsgToActiveView("ViewFit")
|
||||||
|
|
||||||
|
|
||||||
class CadQuerySaveScript:
|
class CadQuerySaveScript:
|
||||||
|
|
|
@ -37,7 +37,6 @@ def getActiveCodePane():
|
||||||
subList = mdi.subWindowList()
|
subList = mdi.subWindowList()
|
||||||
|
|
||||||
for sub in subList:
|
for sub in subList:
|
||||||
print(sub.windowTitle())
|
|
||||||
if sub.windowTitle() == mdiWin.windowTitle().split(" ")[0] + ".py":
|
if sub.windowTitle() == mdiWin.windowTitle().split(" ")[0] + ".py":
|
||||||
mdiWin = sub
|
mdiWin = sub
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user