Draft Dimension Override - Regression?

Have some feature requests, feedback, cool stuff to share, or want to know where FreeCAD is going? This is the place.
ulrich1a
Posts: 1872
Joined: Sun Jul 07, 2013 12:08 pm

Draft Dimension Override - Regression?

Postby ulrich1a » Mon May 19, 2014 6:40 pm

I tried to make some dimensions in the Draft-Workbench with Overrides.
Those texts did not display in the model. Instead I got:

Code: Select all

Traceback (most recent call last):
  File "/home/ulrich/Sourcen/FreeCAD/Build_20140504/Mod/Draft/Draft.py", line 3312, in onChanged
    self.updateData(vobj.Object,"Start")
  File "/home/ulrich/Sourcen/FreeCAD/Build_20140504/Mod/Draft/Draft.py", line 3223, in updateData
    self.text.string = self.text3d.string = self.string
  File "/home/ulrich/Sourcen/FreeCAD/Build_20140504/bin/pivy/coin.py", line 3716, in __setattr__
    field.setValue(value)
  File "/home/ulrich/Sourcen/FreeCAD/Build_20140504/bin/pivy/coin.py", line 28228, in setValue
    return _coin.SoMFString_setValue(*args)
<type 'exceptions.NotImplementedError'>: Wrong number of arguments for overloaded function 'SoMFString_setValue'.
  Possible C/C++ prototypes are:
    setValue(SoMFString *,SbString const &)
    setValue(SoMFString *,char const *)
    setValue(SoMFString *,SoMFString const *)
Ulrich

OS: Debian GNU/Linux 7.5 (wheezy)
Platform: 32-bit
Version: 0.14.3614 (Git)
Branch: master
Hash: d0b96824ad8c8e2cf10c5142ca5f8b67c692bd30
Python version: 2.7.3
Qt version: 4.8.2
Coin version: 3.1.3
SoQt version: 1.5.0
OCC version: 6.7.0
jmaustpc
Posts: 8870
Joined: Tue Jul 26, 2011 6:28 am
Location: Australia

Re: Draft Dimension Override - Regression?

Postby jmaustpc » Mon May 19, 2014 7:01 pm

Hi Ulrich
Its working here, I have got 6 updates past your version, I have no idea if that makes any difference though.

OS: Ubuntu 14.04 LTS
Platform: 64-bit
Version: 0.14.3620 (Git)
Branch: master
Hash: bff814b73a0dd469e8a58fd1d7c21852b421b1ea
Python version: 2.7.6
Qt version: 4.8.6
Coin version: 4.0.0a
SoQt version: 1.6.0a
OCC version: 6.7.0


I tried manual and linked Draft dimensions, override only as well as override with $dim, I also tried 2d and 3d for both...all sees to work for me as expected.

Jim
draftdimswithoverride.png
draftdimswithoverride.png (124.5 KiB) Viewed 1676 times
jmaustpc
Posts: 8870
Joined: Tue Jul 26, 2011 6:28 am
Location: Australia

Re: Draft Dimension Override - Regression?

Postby jmaustpc » Mon May 19, 2014 7:08 pm

Ulrich I just had a thought ....did you compile it with use external pivy? Yorik has said in the past that you need to use external pivy on some platforms ...including debian I think. I just thought since pivy/coin is in the erro messages that maybe that could be the problem?

Jim
ulrich1a
Posts: 1872
Joined: Sun Jul 07, 2013 12:08 pm

Re: Draft Dimension Override - Regression?

Postby ulrich1a » Mon May 19, 2014 7:32 pm

Thanks for feedback.
I think, it is kind of a regression for coin below 4.0. There where some changes lately regarding units on dimension strings.

OS: Debian GNU/Linux 7.5 (wheezy)
Platform: 32-bit
Version: 0.14.3478 (Git)
Branch: master
Hash: 21a4101e67020628043f8ab38bf1a3beea07f13a
Python version: 2.7.3
Qt version: 4.8.2
Coin version: 3.1.3
SoQt version: 1.5.0
OCC version: 6.7.0

The above version works fine for me and was compiled the same way.

I had a look into gitk --all. The latest commits towards 0.14.3620 where about something different.

Ulrich
jmaustpc
Posts: 8870
Joined: Tue Jul 26, 2011 6:28 am
Location: Australia

Re: Draft Dimension Override - Regression?

Postby jmaustpc » Tue May 20, 2014 6:02 am

Hi guys
ulrich1a wrote:I think, it is kind of a regression for coin below 4.0.
I had the same thought, so I tried my Kubuntu 12.04 machine, with its older libs...and I get the bug as well.

when typing in the override the following appears in the report view

Traceback (most recent call last):
File "/home/user/Downloads/cad/build_freecad_master_oce_master/Mod/Draft/Draft.py", line 3312, in onChanged
self.updateData(vobj.Object,"Start")
File "/home/user/Downloads/cad/build_freecad_master_oce_master/Mod/Draft/Draft.py", line 3223, in updateData
self.text.string = self.text3d.string = self.string
File "/usr/lib/pymodules/python2.7/pivy/coin.py", line 3748, in __setattr__
field.setValue(value)
File "/usr/lib/pymodules/python2.7/pivy/coin.py", line 28182, in setValue
return _coin.SoMFString_setValue(self, *args)
<type 'exceptions.NotImplementedError'>: Wrong number or type of arguments for overloaded function 'SoMFString_setValue'.
Possible C/C++ prototypes are:
SoMFString::setValue(SbString const &)
SoMFString::setValue(char const *)
SoMFString::setValue(SoMFString const *)



OS: Ubuntu 12.04.4 LTS
Platform: 64-bit
Version: 0.14.3624 (Git)
Branch: master
Hash: 581d88485dfab42292cdec63a6e0d34a216d772c
Python version: 2.7.3
Qt version: 4.8.2
Coin version: 3.1.3
SoQt version: 1.5.0
OCC version: 6.7.1



I also get the following output when I first create a linked Draft dimension

Pick first point:
Traceback (most recent call last):
File "/home/user/Downloads/cad/build_freecad_master_oce_master/Mod/Draft/Draft.py", line 3223, in updateData
self.text.string = self.text3d.string = self.string
File "/usr/lib/pymodules/python2.7/pivy/coin.py", line 3748, in __setattr__
field.setValue(value)
File "/usr/lib/pymodules/python2.7/pivy/coin.py", line 28182, in setValue
return _coin.SoMFString_setValue(self, *args)
<type 'exceptions.NotImplementedError'>: Wrong number or type of arguments for overloaded function 'SoMFString_setValue'.
Possible C/C++ prototypes are:
SoMFString::setValue(SbString const &)
SoMFString::setValue(char const *)
SoMFString::setValue(SoMFString const *)

Traceback (most recent call last):
File "/home/user/Downloads/cad/build_freecad_master_oce_master/Mod/Draft/Draft.py", line 3223, in updateData
self.text.string = self.text3d.string = self.string
File "/usr/lib/pymodules/python2.7/pivy/coin.py", line 3748, in __setattr__
field.setValue(value)
File "/usr/lib/pymodules/python2.7/pivy/coin.py", line 28182, in setValue
return _coin.SoMFString_setValue(self, *args)
<type 'exceptions.NotImplementedError'>: Wrong number or type of arguments for overloaded function 'SoMFString_setValue'.
Possible C/C++ prototypes are:
SoMFString::setValue(SbString const &)
SoMFString::setValue(char const *)
SoMFString::setValue(SoMFString const *)

Traceback (most recent call last):
File "/home/user/Downloads/cad/build_freecad_master_oce_master/Mod/Draft/Draft.py", line 3223, in updateData
self.text.string = self.text3d.string = self.string
File "/usr/lib/pymodules/python2.7/pivy/coin.py", line 3748, in __setattr__
field.setValue(value)
File "/usr/lib/pymodules/python2.7/pivy/coin.py", line 28182, in setValue
return _coin.SoMFString_setValue(self, *args)
<type 'exceptions.NotImplementedError'>: Wrong number or type of arguments for overloaded function 'SoMFString_setValue'.
Possible C/C++ prototypes are:
SoMFString::setValue(SbString const &)
SoMFString::setValue(char const *)
SoMFString::setValue(SoMFString const *)

Traceback (most recent call last):
File "/home/user/Downloads/cad/build_freecad_master_oce_master/Mod/Draft/Draft.py", line 3223, in updateData
self.text.string = self.text3d.string = self.string
File "/usr/lib/pymodules/python2.7/pivy/coin.py", line 3748, in __setattr__
field.setValue(value)
File "/usr/lib/pymodules/python2.7/pivy/coin.py", line 28182, in setValue
return _coin.SoMFString_setValue(self, *args)
<type 'exceptions.NotImplementedError'>: Wrong number or type of arguments for overloaded function 'SoMFString_setValue'.
Possible C/C++ prototypes are:
SoMFString::setValue(SbString const &)
SoMFString::setValue(char const *)
SoMFString::setValue(SoMFString const *)

Traceback (most recent call last):
File "/home/user/Downloads/cad/build_freecad_master_oce_master/Mod/Draft/Draft.py", line 3223, in updateData
self.text.string = self.text3d.string = self.string
File "/usr/lib/pymodules/python2.7/pivy/coin.py", line 3748, in __setattr__
field.setValue(value)
File "/usr/lib/pymodules/python2.7/pivy/coin.py", line 28182, in setValue
return _coin.SoMFString_setValue(self, *args)
<type 'exceptions.NotImplementedError'>: Wrong number or type of arguments for overloaded function 'SoMFString_setValue'.
Possible C/C++ prototypes are:
SoMFString::setValue(SbString const &)
SoMFString::setValue(char const *)
SoMFString::setValue(SoMFString const *)

Traceback (most recent call last):
File "/home/user/Downloads/cad/build_freecad_master_oce_master/Mod/Draft/Draft.py", line 3223, in updateData
self.text.string = self.text3d.string = self.string
File "/usr/lib/pymodules/python2.7/pivy/coin.py", line 3748, in __setattr__
field.setValue(value)
File "/usr/lib/pymodules/python2.7/pivy/coin.py", line 28182, in setValue
return _coin.SoMFString_setValue(self, *args)
<type 'exceptions.NotImplementedError'>: Wrong number or type of arguments for overloaded function 'SoMFString_setValue'.
Possible C/C++ prototypes are:
SoMFString::setValue(SbString const &)
SoMFString::setValue(char const *)
SoMFString::setValue(SoMFString const *)

Traceback (most recent call last):
File "/home/user/Downloads/cad/build_freecad_master_oce_master/Mod/Draft/Draft.py", line 3223, in updateData
self.text.string = self.text3d.string = self.string
File "/usr/lib/pymodules/python2.7/pivy/coin.py", line 3748, in __setattr__
field.setValue(value)
File "/usr/lib/pymodules/python2.7/pivy/coin.py", line 28182, in setValue
return _coin.SoMFString_setValue(self, *args)
<type 'exceptions.NotImplementedError'>: Wrong number or type of arguments for overloaded function 'SoMFString_setValue'.
Possible C/C++ prototypes are:
SoMFString::setValue(SbString const &)
SoMFString::setValue(char const *)
SoMFString::setValue(SoMFString const *)

Traceback (most recent call last):
File "/home/user/Downloads/cad/build_freecad_master_oce_master/Mod/Draft/Draft.py", line 3223, in updateData
self.text.string = self.text3d.string = self.string
File "/usr/lib/pymodules/python2.7/pivy/coin.py", line 3748, in __setattr__
field.setValue(value)
File "/usr/lib/pymodules/python2.7/pivy/coin.py", line 28182, in setValue
return _coin.SoMFString_setValue(self, *args)
<type 'exceptions.NotImplementedError'>: Wrong number or type of arguments for overloaded function 'SoMFString_setValue'.
Possible C/C++ prototypes are:
SoMFString::setValue(SbString const &)
SoMFString::setValue(char const *)
SoMFString::setValue(SoMFString const *)

Traceback (most recent call last):
File "/home/user/Downloads/cad/build_freecad_master_oce_master/Mod/Draft/Draft.py", line 3223, in updateData
self.text.string = self.text3d.string = self.string
File "/usr/lib/pymodules/python2.7/pivy/coin.py", line 3748, in __setattr__
field.setValue(value)
File "/usr/lib/pymodules/python2.7/pivy/coin.py", line 28182, in setValue
return _coin.SoMFString_setValue(self, *args)
<type 'exceptions.NotImplementedError'>: Wrong number or type of arguments for overloaded function 'SoMFString_setValue'.
Possible C/C++ prototypes are:
SoMFString::setValue(SbString const &)
SoMFString::setValue(char const *)
SoMFString::setValue(SoMFString const *)

Traceback (most recent call last):
File "/home/user/Downloads/cad/build_freecad_master_oce_master/Mod/Draft/Draft.py", line 3223, in updateData
self.text.string = self.text3d.string = self.string
File "/usr/lib/pymodules/python2.7/pivy/coin.py", line 3748, in __setattr__
field.setValue(value)
File "/usr/lib/pymodules/python2.7/pivy/coin.py", line 28182, in setValue
return _coin.SoMFString_setValue(self, *args)
<type 'exceptions.NotImplementedError'>: Wrong number or type of arguments for overloaded function 'SoMFString_setValue'.
Possible C/C++ prototypes are:
SoMFString::setValue(SbString const &)
SoMFString::setValue(char const *)
SoMFString::setValue(SoMFString const *)


I didn't get an error with a manual Draft dimension, but then when I added a third one, FreeCAD crashed.

Now FreeCAD won't crash again.
User avatar
yorik
Site Admin
Posts: 10725
Joined: Tue Feb 17, 2009 9:16 pm
Location: São Paulo, Brazil
Contact:

Re: Draft Dimension Override - Regression?

Postby yorik » Tue May 20, 2014 4:32 pm

Hm could one of you guys do me a favor? Try adding in Draft.py, at line 3223, just above the "self.text.string = self.text3d.string = self.string" line, this:

Code: Select all

print self.string
and see what gets printed? Thanks!
jmaustpc
Posts: 8870
Joined: Tue Jul 26, 2011 6:28 am
Location: Australia

Re: Draft Dimension Override - Regression?

Postby jmaustpc » Tue May 20, 2014 5:55 pm

Hi Yorik

this is the output for creating a linked Draft Dimension (not getting any error message on creation) this is for the top front edge (x-axis=0 to 10, Yaxis=0, z-axis=10) of a default Part box.

Pick first point:
1.0000 mm
1.0000 mm
1.0000 mm
1.0000 mm
1.0000 mm
1.0000 mm
1.0000 mm
1.0000 mm
1.0000 mm
1.0000 mm
13.4536 mm
10.0000 mm
10.0000 mm
10.0000 mm
10.0000 mm
10.0000 mm

this below is the error output that I get when entering "hello" in the override field of the above linked Draft Dimension.

h
Traceback (most recent call last):
File "/home/user/Downloads/cad/build_freecad_master_oce_master/Mod/Draft/Draft.py", line 3313, in onChanged
self.updateData(vobj.Object,"Start")
File "/home/user/Downloads/cad/build_freecad_master_oce_master/Mod/Draft/Draft.py", line 3224, in updateData
self.text.string = self.text3d.string = self.string
File "/usr/lib/pymodules/python2.7/pivy/coin.py", line 3748, in __setattr__
field.setValue(value)
File "/usr/lib/pymodules/python2.7/pivy/coin.py", line 28182, in setValue
return _coin.SoMFString_setValue(self, *args)
<type 'exceptions.NotImplementedError'>: Wrong number or type of arguments for overloaded function 'SoMFString_setValue'.
Possible C/C++ prototypes are:
SoMFString::setValue(SbString const &)
SoMFString::setValue(char const *)
SoMFString::setValue(SoMFString const *)


he
Traceback (most recent call last):
File "/home/user/Downloads/cad/build_freecad_master_oce_master/Mod/Draft/Draft.py", line 3313, in onChanged
self.updateData(vobj.Object,"Start")
File "/home/user/Downloads/cad/build_freecad_master_oce_master/Mod/Draft/Draft.py", line 3224, in updateData
self.text.string = self.text3d.string = self.string
File "/usr/lib/pymodules/python2.7/pivy/coin.py", line 3748, in __setattr__
field.setValue(value)
File "/usr/lib/pymodules/python2.7/pivy/coin.py", line 28182, in setValue
return _coin.SoMFString_setValue(self, *args)
<type 'exceptions.NotImplementedError'>: Wrong number or type of arguments for overloaded function 'SoMFString_setValue'.
Possible C/C++ prototypes are:
SoMFString::setValue(SbString const &)
SoMFString::setValue(char const *)
SoMFString::setValue(SoMFString const *)


hel
Traceback (most recent call last):
File "/home/user/Downloads/cad/build_freecad_master_oce_master/Mod/Draft/Draft.py", line 3313, in onChanged
self.updateData(vobj.Object,"Start")
File "/home/user/Downloads/cad/build_freecad_master_oce_master/Mod/Draft/Draft.py", line 3224, in updateData
self.text.string = self.text3d.string = self.string
File "/usr/lib/pymodules/python2.7/pivy/coin.py", line 3748, in __setattr__
field.setValue(value)
File "/usr/lib/pymodules/python2.7/pivy/coin.py", line 28182, in setValue
return _coin.SoMFString_setValue(self, *args)
<type 'exceptions.NotImplementedError'>: Wrong number or type of arguments for overloaded function 'SoMFString_setValue'.
Possible C/C++ prototypes are:
SoMFString::setValue(SbString const &)
SoMFString::setValue(char const *)
SoMFString::setValue(SoMFString const *)


hell
Traceback (most recent call last):
File "/home/user/Downloads/cad/build_freecad_master_oce_master/Mod/Draft/Draft.py", line 3313, in onChanged
self.updateData(vobj.Object,"Start")
File "/home/user/Downloads/cad/build_freecad_master_oce_master/Mod/Draft/Draft.py", line 3224, in updateData
self.text.string = self.text3d.string = self.string
File "/usr/lib/pymodules/python2.7/pivy/coin.py", line 3748, in __setattr__
field.setValue(value)
File "/usr/lib/pymodules/python2.7/pivy/coin.py", line 28182, in setValue
return _coin.SoMFString_setValue(self, *args)
<type 'exceptions.NotImplementedError'>: Wrong number or type of arguments for overloaded function 'SoMFString_setValue'.
Possible C/C++ prototypes are:
SoMFString::setValue(SbString const &)
SoMFString::setValue(char const *)
SoMFString::setValue(SoMFString const *)


hello
Traceback (most recent call last):
File "/home/user/Downloads/cad/build_freecad_master_oce_master/Mod/Draft/Draft.py", line 3313, in onChanged
self.updateData(vobj.Object,"Start")
File "/home/user/Downloads/cad/build_freecad_master_oce_master/Mod/Draft/Draft.py", line 3224, in updateData
self.text.string = self.text3d.string = self.string
File "/usr/lib/pymodules/python2.7/pivy/coin.py", line 3748, in __setattr__
field.setValue(value)
File "/usr/lib/pymodules/python2.7/pivy/coin.py", line 28182, in setValue
return _coin.SoMFString_setValue(self, *args)
<type 'exceptions.NotImplementedError'>: Wrong number or type of arguments for overloaded function 'SoMFString_setValue'.
Possible C/C++ prototypes are:
SoMFString::setValue(SbString const &)
SoMFString::setValue(char const *)
SoMFString::setValue(SoMFString const *)
jmaustpc
Posts: 8870
Joined: Tue Jul 26, 2011 6:28 am
Location: Australia

Re: Draft Dimension Override - Regression?

Postby jmaustpc » Tue May 20, 2014 6:02 pm

doing the same as above except this time using snap to create a manual Draft Dimension on the same edge. On creation I get no error message, just the following

Pick first point:
1.0000 mm
1.0000 mm
1.0000 mm
1.0000 mm
1.0000 mm
1.0000 mm
1.0000 mm
1.0000 mm
1.0000 mm
1.0000 mm
10.0000 mm
10.0000 mm
10.0000 mm
10.0000 mm
10.0000 mm
10.0000 mm


and on entering "hi" in the override I get the following

h
Traceback (most recent call last):
File "/home/user/Downloads/cad/build_freecad_master_oce_master/Mod/Draft/Draft.py", line 3313, in onChanged
self.updateData(vobj.Object,"Start")
File "/home/user/Downloads/cad/build_freecad_master_oce_master/Mod/Draft/Draft.py", line 3224, in updateData
self.text.string = self.text3d.string = self.string
File "/usr/lib/pymodules/python2.7/pivy/coin.py", line 3748, in __setattr__
field.setValue(value)
File "/usr/lib/pymodules/python2.7/pivy/coin.py", line 28182, in setValue
return _coin.SoMFString_setValue(self, *args)
<type 'exceptions.NotImplementedError'>: Wrong number or type of arguments for overloaded function 'SoMFString_setValue'.
Possible C/C++ prototypes are:
SoMFString::setValue(SbString const &)
SoMFString::setValue(char const *)
SoMFString::setValue(SoMFString const *)

hi
Traceback (most recent call last):
File "/home/user/Downloads/cad/build_freecad_master_oce_master/Mod/Draft/Draft.py", line 3313, in onChanged
self.updateData(vobj.Object,"Start")
File "/home/user/Downloads/cad/build_freecad_master_oce_master/Mod/Draft/Draft.py", line 3224, in updateData
self.text.string = self.text3d.string = self.string
File "/usr/lib/pymodules/python2.7/pivy/coin.py", line 3748, in __setattr__
field.setValue(value)
File "/usr/lib/pymodules/python2.7/pivy/coin.py", line 28182, in setValue
return _coin.SoMFString_setValue(self, *args)
<type 'exceptions.NotImplementedError'>: Wrong number or type of arguments for overloaded function 'SoMFString_setValue'.
Possible C/C++ prototypes are:
SoMFString::setValue(SbString const &)
SoMFString::setValue(char const *)
SoMFString::setValue(SoMFString const *)



The testing in this post and the last one above are with FreeCAD compile from master just now, with the one modification you asked me to add to Draft.py line3223.

Jim

OS: Ubuntu 12.04.4 LTS
Platform: 64-bit
Version: 0.14.3626 (Git)
Branch: master
Hash: c6d9c3789aa34bd4fddda776652ec3aae4ebe7f4
Python version: 2.7.3
Qt version: 4.8.2
Coin version: 3.1.3
SoQt version: 1.5.0
OCC version: 6.7.1
User avatar
yorik
Site Admin
Posts: 10725
Joined: Tue Feb 17, 2009 9:16 pm
Location: São Paulo, Brazil
Contact:

Re: Draft Dimension Override - Regression?

Postby yorik » Tue May 20, 2014 7:44 pm

hm that's really weird... Can you please try this too?
change line 3223 (or 3224 if the previous modification is still there) from:

Code: Select all

self.text.string = self.text3d.string = self.string
to

Code: Select all

self.text.string = self.text3d.string = str(self.string)
Let's see if it likes it better that way...
ulrich1a
Posts: 1872
Joined: Sun Jul 07, 2013 12:08 pm

Re: Draft Dimension Override - Regression?

Postby ulrich1a » Tue May 20, 2014 8:29 pm

Code: Select all

self.text.string = self.text3d.string = str(self.string)
fixes the problem, when writing "hello" into Override.
But I get then the following at putting "ü" into Override

Code: Select all

traceback (most recent call last):
  File "/home/ulrich/Sourcen/FreeCAD/Build_20140504/Mod/Draft/Draft.py", line 3313, in onChanged
    self.updateData(vobj.Object,"Start")
  File "/home/ulrich/Sourcen/FreeCAD/Build_20140504/Mod/Draft/Draft.py", line 3224, in updateData
    self.text.string = self.text3d.string = str(self.string)
<type 'exceptions.UnicodeEncodeError'>: 'ascii' codec can't encode characters in position 0-1: ordinal not in range(128)


Ulrich

OS: Debian GNU/Linux 7.5 (wheezy)
Platform: 32-bit
Version: 0.14.3614 (Git)
Branch: master
Hash: d0b96824ad8c8e2cf10c5142ca5f8b67c692bd30
Python version: 2.7.3
Qt version: 4.8.2
Coin version: 3.1.3
SoQt version: 1.5.0
OCC version: 6.7.0