View Issue Details

IDProjectCategoryView StatusLast Update
0000934FreeCADBugpublic2013-03-23 15:17
ReporterpperisinAssigned Toyorik 
PrioritynormalSeveritytrivialReproducibilityalways
Status closedResolutionfixed 
Product Version0.12 
Target VersionFixed in Version0.14 
Summary0000934: Draft tools referenced before assignment
DescriptionI get this bug when switching to draft workbench.

I get a dialog sayng that "Draft tools" were referenced before assignment, and no icons appear after this.
Additional Informationwin7 64bit
TagsNo tags attached.

Activities

Jriegel

2012-12-30 16:36

administrator   ~0002768

Any output on the Report Window?
I can not reproduce that error...

yorik

2012-12-30 18:49

administrator   ~0002770

Yes, we'd need the exact error message, with the right spelling... Better to copy and paste.

pperisin

2012-12-31 11:49

reporter   ~0002772

exact message:

local variable 'DraftTools' referenced before assignment

I have seen this before.

2012-12-31 11:49

 

FreeCAD_2012-12-31_13-47-14.png (Attachment missing)

yorik

2012-12-31 12:19

administrator   ~0002773

Hm probably something in draft initgui script... I'm without computer right now but will look into it asap.

yorik

2012-12-31 14:20

administrator   ~0002774

Ok I managed to have a look, but am unable to reproduce the bug either. Can you give an exact step by step procedure to make the bug happen?

pperisin

2013-01-01 06:52

reporter   ~0002775

download release candidate
start it

create new document
switch to draft workbench

... crash ...

Jriegel

2013-01-01 10:30

administrator   ~0002778

MSI install? 7Zip? Clean machine or your developer machine?
Reproducible on other machines?

pperisin

2013-01-01 13:09

reporter   ~0002779

Last edited: 2013-01-01 13:09

7z release candidate

dev machine

EDIT: will check other machines.

pperisin

2013-01-01 13:10

reporter   ~0002780

plus, I was trying to make my own build, and issue was there too.

yorik

2013-01-01 14:25

administrator   ~0002781

As far as i can see the draft wb has no problems, probably something went wrong in the packaging... Can you check what's inside freecad_install_path/Mod/Draft?

pperisin

2013-01-01 14:40

reporter   ~0002782

when I compile, it still happens - so not packaging problem IMO

pperisin

2013-01-01 14:56

reporter   ~0002783

It appears to work on my office PC.

Crap. Now I need to figure what is wrong on my dev PC.

Sorry for false alarm.

yorik

2013-01-01 14:58

administrator   ~0002784

Check the contents of the draft folder?

Jriegel

2013-01-02 07:49

administrator   ~0002785

No problem Petar,
I have often the problem of polluted Dev machines.
You install and install and at some points you can not get ride
of some stuff.

E.g. Visuall Studio is a nightmare in that. You never get fully ride of
some of the components.
There fore I have Virtuallbox with clean OS installs to test.
But any hint on a problem is important!

ghia

2013-01-05 18:27

reporter   ~0002799

I have this too
Some report view copies for v12 and v13
--------------------------------------------------------------
v0.12.5284


Init: Running FreeCADGuiInit.py start script...
Init: Searching modules...
Init: Initializing C:\Program Files (x86)\FreeCAD0.12\Mod\Sketcher... done
Init: Initializing C:\Program Files (x86)\FreeCAD0.12\Mod\MeshPart... done
Init: Initializing C:\Program Files (x86)\FreeCAD0.12\Mod\Complete... done
Init: Initializing C:\Program Files (x86)\FreeCAD0.12\Mod\Web... done
Init: Initializing C:\Program Files (x86)\FreeCAD0.12\Mod\Inspection... done
Init: Initializing C:\Program Files (x86)\FreeCAD0.12\Mod\Image... done
Init: Initializing C:\Program Files (x86)\FreeCAD0.12\Mod\Fem... done
Init: Initializing C:\Program Files (x86)\FreeCAD0.12\Mod\Robot... done
Init: Initializing C:\Program Files (x86)\FreeCAD0.12\Mod\PartDesign... done
Init: Initializing C:\Program Files (x86)\FreeCAD0.12\Mod\Raytracing... done
Init: Initializing C:\Program Files (x86)\FreeCAD0.12\Mod\Start... done
Init: Initializing C:\Program Files (x86)\FreeCAD0.12\Mod\Mesh... done
Init: Initializing C:\Program Files (x86)\FreeCAD0.12\Mod\Draft... done
Init: Initializing C:\Program Files (x86)\FreeCAD0.12\Mod\Test... done
Init: Initializing C:\Program Files (x86)\FreeCAD0.12\Mod\Import... done
Init: Initializing C:\Program Files (x86)\FreeCAD0.12\Mod\Part... done
Init: Initializing C:\Program Files (x86)\FreeCAD0.12\Mod\Arch... done
Init: Initializing C:\Program Files (x86)\FreeCAD0.12\Mod\Drawing... done
Init: Initializing C:\Program Files (x86)\FreeCAD0.12\Mod\Points... done
Init: Loading FreeCAD GUI
Init: Running FreeCADGuiInit.py start script... done
Init: Activating default workbench StartWorkbench
Loading GUI of Web module... done
Loading GUI of Start module... done
Loading Start module... done
Init: Showing main window
Main window restored
Show main window
Toolbars restored
Init: Entering event loop
Init: Processing command line files
Active view is Unnamed : 1[*] (at 09B369C0)
Active document is Unnamed (at 092C7098)
Loading Draft GUI...
local variable 'draftTools' referenced before assignment
Traceback (most recent call last):
  File "C:\Program Files (x86)\FreeCAD0.12\Mod\Draft\InitGui.py", line 197, in Initialize
    self.appendToolbar(str(draftTools.translate("draft","Draft tools")),self.cmdList+self.modList)

'module' object has no attribute 'draftToolBar'
Traceback (most recent call last):
  File "C:\Program Files (x86)\FreeCAD0.12\Mod\Draft\InitGui.py", line 203, in Activated
    FreeCADGui.draftToolBar.Activated()

Active view is Unnamed : 1[*] (at 09B369C0)


--------------------------------------------------------------
OS: Windows 7
Platform: 32-bit
Version: 0.13.1803
Python version: 2.6.2
Qt version: 4.5.2
Coin version: 3.1.0
SoQt version: 1.4.1
OCC version: 6.3.0

Init: Running FreeCADGuiInit.py start script...
Init: Searching modules...
Init: Initializing D:\downloads\freecad\v13\Mod\Machining_Distortion... done
Init: Initializing D:\downloads\freecad\v13\Mod\Sketcher... done
Init: Initializing D:\downloads\freecad\v13\Mod\ReverseEngineering... done
Init: Initializing D:\downloads\freecad\v13\Mod\Image... done
Init: Initializing D:\downloads\freecad\v13\Mod\PartDesign... done
Init: Initializing D:\downloads\freecad\v13\Mod\Ship... done
Init: Initializing D:\downloads\freecad\v13\Mod\Surfaces... done
matplotlib not found, Plot module will be disabled
Init: Initializing D:\downloads\freecad\v13\Mod\Plot... done
Init: Initializing D:\downloads\freecad\v13\Mod\MeshPart... done
Init: Initializing D:\downloads\freecad\v13\Mod\OpenSCAD... done
Init: Initializing D:\downloads\freecad\v13\Mod\Fem... done
Init: Initializing D:\downloads\freecad\v13\Mod\Start... done
Init: Initializing D:\downloads\freecad\v13\Mod\Points... done
Init: Initializing D:\downloads\freecad\v13\Mod\Draft... done
Init: Initializing D:\downloads\freecad\v13\Mod\Test... done
Init: Initializing D:\downloads\freecad\v13\Mod\Import... done
Init: Initializing D:\downloads\freecad\v13\Mod\Assembly... done
Init: Initializing D:\downloads\freecad\v13\Mod\Complete... done
Init: Initializing D:\downloads\freecad\v13\Mod\Web... done
Init: Initializing D:\downloads\freecad\v13\Mod\Raytracing... done
Init: Initializing D:\downloads\freecad\v13\Mod\Mesh... done
Loading Part module... done
pycollada not found, collada support will be disabled.
Init: Initializing D:\downloads\freecad\v13\Mod\Arch... done
Init: Initializing D:\downloads\freecad\v13\Mod\Robot... done
Init: Initializing D:\downloads\freecad\v13\Mod\Part... done
Init: Initializing D:\downloads\freecad\v13\Mod\Idf(InitGui.py not found)... ignore
Init: Initializing D:\downloads\freecad\v13\Mod\Inspection... done
Init: Initializing D:\downloads\freecad\v13\Mod\Drawing... done
Init: Loading FreeCAD GUI
Init: Running FreeCADGuiInit.py start script... done
Init: Activating default workbench StartWorkbench
Loading GUI of Web module... done
Loading GUI of Start module... done
Loading Start module... done
Init: Showing main window
Main window restored
Show main window
Toolbars restored
Init: Entering event loop
Init: Processing command line files
Active view is Unnamed : 1[*] (at 0CDC5CB0)
Active document is Unnamed (at 03F12C60)
local variable 'DraftTools' referenced before assignment
Traceback (most recent call last):
  File "D:\downloads\freecad\v13\Mod\Draft\InitGui.py", line 197, in Initialize
    self.appendToolbar(str(DraftTools.translate("draft","Draft creation tools")),self.cmdList)

Active view is Unnamed : 1[*] (at 0CDC5CB0)
Active view is Unnamed : 1[*] (at 0CDC5CB0)

yorik

2013-01-05 19:55

administrator   ~0002801

Hm i should modify a bit the initscript to bail out if some module dcouldn't be imported, but i don't understand why some piece of the draft module didn't import in the first place...

Could you show me the contents of the draft module folder?

ghia

2013-01-05 21:43

reporter   ~0002802

Directory of C:\Program Files (x86)\FreeCAD0.12\Mod\Draft

12/02/2012 16:22 <DIR> .
12/02/2012 16:22 <DIR> ..
12/12/2011 21:03 83.308 Draft.py
12/12/2011 21:03 47.945 draftGui.py
12/02/2012 16:22 <DIR> draftlibs
12/12/2011 21:03 189.483 draftTools.py
12/12/2011 21:03 2.039.177 Draft_rc.py
12/12/2011 21:03 6.119 importAirfoilDAT.py
12/12/2011 21:03 45.991 importDXF.py
12/12/2011 21:03 10.402 importOCA.py
12/12/2011 21:03 32.200 importSVG.py
12/12/2011 21:03 363 Init.py
12/12/2011 21:03 9.318 InitGui.py
12/12/2011 21:03 915 macros.py
12/12/2011 21:03 10.236 WorkingPlane.py
              12 File(s) 2.475.457 bytes

I fiddled with some preference settings (among them, macro and log file) and now it seems to work.
I assume that the module could fail if it tries to open temporary or logfiles under Windows in the C:\Program Files (x86)\ directory tree, which is forbidden as it is in some way write protected.

It could also be that the selftests did repair something, as I have run these also several times and subsequent runs did not give the same errors (Didn't note them) with pop-ups. (Altough counters at the end stayed always at 0)

Jriegel

2013-01-05 23:12

administrator   ~0002803

Your Program directory is FreeCAD0.12 ?
Is that right? A mix up would explain that error....

ghia

2013-01-06 08:48

reporter   ~0002804

It was the default directory that the installer FreeCAD_0.12.5284_x86_setup.msi proposed.
The V13 I unfolded simply the 7zip file FreeCAD_0.13.1803_x86_RC_bin.7z into it, for trying to check out the new features and to see of my other reported (fillet) problems were also present in that newer unstable version (most did).
But the draft problem was already present before I downloaded V13, but as I did not needed that workbench, I did not care at first with that error, knowng FreeCad is still a work in progress. I used only part and part design to make a curtain support. (http://www.fablab-leuven.be/?q=node/164)

ghia

2013-01-06 09:12

reporter   ~0002805

I believe the draft problem was not present with the fresh installation, but got into it after making some additinal preferences. It could also be after using some functions inside FreeCad.
For the moment all benches seems to be activated:
Just Inspection complains in the report view a bit:
Loading GUI of Inspection module... done
Cannot find icon: mesh_pipette

And in Arch bench, he wants a pina colada :-)
Loading MeshPart module... done
pycollada not found, no collada support
Loading Arch module... done
Arch workbench activated

ghia

2013-01-06 10:18

reporter   ~0002806

Other consideration is of course, since I could crash the program several times, is that some files were left, where after restart the initialisation of the workbench stumbles on their unexpected presence or state.

yorik

2013-01-06 14:32

administrator   ~0002807

Most probably those errors are all related to installing/reinstalling with different methods (installer, zipfile, etc) and different versions (the install procedure might have changed), leaving leftover files, or removing wrong ones... But it is hard to know exactly from the info you provided. As far as I saw the Draft module currently in git master is okay, I'd just like to see if the win installer is okay too, so let's leave this open to see if more reports appear...

The error you had with 012 is indeed a bug, but it has been solved since then.

ghia

2013-01-06 15:09

reporter   ~0002808

I have only the 2 versions installed by the methods described above and did not install other versions or with other methods, nor uninstall or reinstall versions.

For now, it is working. So, i tend to believe that leftovers from crashes were the most probable cause. The error occured in both versions and did go also in both.

"The error you had with 012 is indeed a bug, but it has been solved since then. "
But after 0.13.1803? Because that still crashes.

yorik

2013-01-06 15:22

administrator   ~0002809

These are 2 different problems... the typo error in 012 is fixed in 013, but the "unimportable" module is another problem. Anyway, the file structure of the Draft module changed drastically between those 2 versions... If you unzipped 013 in the 012 folder, as stated above, i think your freecad installation must be pretty messy, and probably all remaining errors come from that...

ghia

2013-01-06 15:50

reporter   ~0002810

I did not state or do such things.

The v12 is regulary installed by the msi file in C:\Program Files (x86)\FreeCAD0.12
The V13 was a 7zip unpacked in D:\downloads\freecad\v13\ and run from there by double click on \bin\FreeCAD.exe

yorik

2013-02-15 14:20

administrator   ~0002910

I believe this issue doesn't appear anymore in v0.13... If nobody manifest himself anymore, I'll close this issue

yorik

2013-03-23 15:17

administrator   ~0003000

Closed because no more feedback. Reopen if needed...

Issue History

Date Modified Username Field Change
2012-12-30 15:06 pperisin New Issue
2012-12-30 16:36 Jriegel Note Added: 0002768
2012-12-30 18:49 yorik Note Added: 0002770
2012-12-31 11:49 pperisin Note Added: 0002772
2012-12-31 11:49 pperisin File Added: FreeCAD_2012-12-31_13-47-14.png
2012-12-31 12:19 yorik Note Added: 0002773
2012-12-31 12:19 yorik Status new => assigned
2012-12-31 12:19 yorik Assigned To => yorik
2012-12-31 14:20 yorik Note Added: 0002774
2013-01-01 06:52 pperisin Note Added: 0002775
2013-01-01 10:30 Jriegel Note Added: 0002778
2013-01-01 13:09 pperisin Note Added: 0002779
2013-01-01 13:09 pperisin Note Edited: 0002779
2013-01-01 13:10 pperisin Note Added: 0002780
2013-01-01 14:25 yorik Note Added: 0002781
2013-01-01 14:40 pperisin Note Added: 0002782
2013-01-01 14:56 pperisin Note Added: 0002783
2013-01-01 14:58 yorik Note Added: 0002784
2013-01-02 07:49 Jriegel Note Added: 0002785
2013-01-05 18:27 ghia Note Added: 0002799
2013-01-05 19:55 yorik Note Added: 0002801
2013-01-05 21:43 ghia Note Added: 0002802
2013-01-05 23:12 Jriegel Note Added: 0002803
2013-01-06 08:48 ghia Note Added: 0002804
2013-01-06 09:12 ghia Note Added: 0002805
2013-01-06 10:18 ghia Note Added: 0002806
2013-01-06 14:32 yorik Note Added: 0002807
2013-01-06 15:09 ghia Note Added: 0002808
2013-01-06 15:22 yorik Note Added: 0002809
2013-01-06 15:50 ghia Note Added: 0002810
2013-02-15 14:20 yorik Note Added: 0002910
2013-02-15 14:20 yorik Status assigned => feedback
2013-03-23 15:17 yorik Note Added: 0003000
2013-03-23 15:17 yorik Status feedback => closed
2013-03-23 15:17 yorik Resolution open => fixed
2013-03-23 15:17 yorik Fixed in Version => 0.14