Fixed an error when a script is closed with no open 3D views.
This commit is contained in:
parent
b7f9c7a143
commit
5536bd1d69
|
@ -70,7 +70,12 @@ class CadQueryCloseScript:
|
||||||
#Close the matching 3D view if it's open
|
#Close the matching 3D view if it's open
|
||||||
if cqCodePane.file.path is not None:
|
if cqCodePane.file.path is not None:
|
||||||
docname = os.path.splitext(os.path.basename(cqCodePane.file.path))[0]
|
docname = os.path.splitext(os.path.basename(cqCodePane.file.path))[0]
|
||||||
|
|
||||||
|
try:
|
||||||
FreeCAD.closeDocument(docname)
|
FreeCAD.closeDocument(docname)
|
||||||
|
except:
|
||||||
|
#Assume that the document has already been closed
|
||||||
|
pass
|
||||||
|
|
||||||
#Clear our script and whatever was rendered by it out
|
#Clear our script and whatever was rendered by it out
|
||||||
cqCodePane.file.close()
|
cqCodePane.file.close()
|
||||||
|
|
Loading…
Reference in New Issue
Block a user