Added a safety feature to remove bad characters from the file name before trying to create or update the 3D document view.
This commit is contained in:
parent
ef223c260c
commit
c319b4f7f0
|
@ -166,7 +166,12 @@ class CadQueryExecuteScript:
|
||||||
|
|
||||||
docname = os.path.splitext(os.path.basename(cqCodePane.file.path))[0]
|
docname = os.path.splitext(os.path.basename(cqCodePane.file.path))[0]
|
||||||
|
|
||||||
#If the matching 3D view has been closed, we need to open a new one
|
# Make sure we replace any troublesome characters
|
||||||
|
for ch in ['&', '#', '.', '-', '$', '%', ',', ' ']:
|
||||||
|
if ch in docname:
|
||||||
|
docname = docname.replace(ch, "")
|
||||||
|
|
||||||
|
# If the matching 3D view has been closed, we need to open a new one
|
||||||
try:
|
try:
|
||||||
FreeCAD.getDocument(docname)
|
FreeCAD.getDocument(docname)
|
||||||
except:
|
except:
|
||||||
|
|
Loading…
Reference in New Issue
Block a user