MostafaElAyoubi / Data-shapes

code for revit, dynamo
49 stars 12 forks source link

UI.TextBox causing unhandled exception #49

Closed andydandy74 closed 4 years ago

andydandy74 commented 4 years ago

Hi @MostafaElAyoubi The UI.TextBox node causes an unhandled exception in the MultiInputForm node in some locales (at least German locale) when IsNumberEntry is set to true and the text contains a decimal point that is actually not a point (German locale uses a comma).

The debugger says (correctly) "invalied literal for float()". I solved this for myself directly in the TextBox node, but it could surely be solved in the Form node as well. Anyway, here's what I changed in the TextBox node:

I replaced

self.defaultvalue = defaultvalue

with

if _isnum: self.defaultvalue = defaultvalue.replace(',','.')
else: self.defaultvalue = defaultvalue
MostafaElAyoubi commented 4 years ago

Hi @andydandy74 Thanks for reporting this and proposing a solution. Will make sure to get this fixed for the next release!

MostafaElAyoubi commented 4 years ago

Fixed in version 2021.2.2 of the package