Hi HoWilHoWil wrote: ↑Sat Sep 02, 2017 5:19 pmHi Oliver,oliveroxtoby wrote: ↑Fri Sep 01, 2017 4:06 pm Found the error - my bad! It should be working now with your normal settings, I hope.
Thanks for reporting the issue.
can you please explain in more detail what kind of error you corrected. There is a similar problem with the material dialogue in fem-wb (see https://forum.freecadweb.org/viewtopic. ... 3e#p187725) and I am sure your infos could help here.
Thanks in advance,
HoWil
So the problem was that we were setting the value into the input box as a string in the 'C' locale (I think - the default way that python prints it) whereas the input box needs to interpret it in the user's locale. You *do* want to store quantities in the C locale in the material database in order to have a canonical storage format, but before entering it into the text box it needs to be converted to the user's locale. I had some problems using python's locale.str() function for this, as it doesn't seems to have the same interpretation of language versus input locale as FreeCAD. Thus I used the Quantity.UserString function to achieve the same effect. So for example where you set the density at https://github.com/FreeCAD/FreeCAD/blob ... al.py#L364
I think you could rather do
q = FreeCAD.Units.Quantity("{} {}".format(density_with_new_unit, density_new_unit))
self.form.input_fd_density.setText(q.UserString)
Hope that helps!