Running the Python command 'Draft_Line' failed:
Traceback (most recent call last):
File "C:\Users\more10.HOLISTICODE\Downloads\FreeCAD_0.17.7447_x64_dev_win\Mod\Draft\DraftTools.py", line 440, in Activated
Creator.Activated(self,name)
File "C:\Users\more10.HOLISTICODE\Downloads\FreeCAD_0.17.7447_x64_dev_win\Mod\Draft\DraftTools.py", line 423, in Activated
DraftTool.Activated(self)
File "C:\Users\more10.HOLISTICODE\Downloads\FreeCAD_0.17.7447_x64_dev_win\Mod\Draft\DraftTools.py", line 223, in Activated
FreeCAD.activeDraftCommand.finish()
File "C:\Users\more10.HOLISTICODE\Downloads\FreeCAD_0.17.7447_x64_dev_win\Mod\Draft\DraftTools.py", line 457, in finish
old = self.obj.Name
Cannot access attribute 'Name' of deleted object
Steps To Reproduce
Open draft line tool in an unsaved document.
Close the document.
Open another document.
Open the Draft.line tool
OS: Windows 7
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.17.7447 (Git)
Build type: Release
Branch: master
Hash: 898bd8bb4cbe2c9b26aa6c1f7362e48752a3e4de
Python version: 2.7.8
Qt version: 4.8.7
Coin version: 4.0.0a
OCC version: 6.8.0.oce-0.17
@yorik writes:
Indeed the Draft task panel is not closed when closing a document. The same happens with other task panels (for ex. Part Fillet). One that works correctly is the sketcher, not sure what is done differently there...
I think maybe we could always close the task panel when closing a document.
Last edited by Kunda1 on Thu Jun 29, 2017 4:18 pm, edited 1 time in total.
yorik wrote: ↑Thu Jun 15, 2017 1:45 pm
Actually having a task panel open should prevent from closing the document. I might have forgotten something there, will have a look...
I just fixed the issue now. Curiously adding a isAllowedAlterDocument() that retuns False in the task dialog should do the same as in the sketcher (prohibit to close the document while the dialog is open) but it doesn't work. Couldn't find out yet why.
In any case, I added stronger tests in Draft's functions, so they can be closed after the document has been changed or closed without causing errors.