Yeah, I saw that, but in my example not. I think importing the string module is not a good idea, not necessary and it is also deprecated as far as I know…
Hi Nathan,
with comma as a separator it works in V6 - but then V5 returns None. The tool I’m working on should work on both versions. Looks like the localizing problems are back in V6
Hmm, I tried here on a French/Swiss OS, and it seemed to work with Rhino in either French or English. However, I noticed the machine was still set to decimal point as separator - I guess that’s standard for CH…
I changed it to comma, rebooted the machine, but that didn’t seem to make any difference either though.
Edit: @jess - what if you run rs.LocaleID(1033) at the top of your script? Does that change anything?
rs.LocaleID() just returns the currently used interface language. You cannot set that. Also it would not change the python behavior.
Looks like __host.Coerce3dPointFromEnumerables(point) is causing the problem.
However, if I use float() for each element of my strings it works.
I don’t want to get into that localization nightmare again… However, everyone converting strings to points or vectors should be aware of the current behavior of V6.
Oh, yeah, sorry, I got that wrong, just remembering from my vb days, it was SetLocale(xxxx) which was able to set the locale during script execution - but it was not a Rhinoscript function, it was a native vbscript method.
This sample works. Can you just check that it works also for you?
import rhinoscriptsyntax as rs
import System as s
ic = s.Globalization.CultureInfo.InvariantCulture
cc = s.Threading.Thread.CurrentThread.CurrentCulture
s.Threading.Thread.CurrentThread.CurrentCulture = ic
line = "-1.00000000 0.00000000 0.00000000"
list_line = line.split()
pt = rs.coerce3dpoint(list_line)
print pt
print type(pt)
s.Threading.Thread.CurrentThread.CurrentCulture = cc