Bug running script rhino 7 and 8

Hi every one
we have found a bug with rhino script
Our script run correctly if we run it with a script editor but he didn’t run correctly with a toolbar buton
the problème is the name “emphasis” layer in file
do you know how to solve this probleme?

regards

image

PrintWidthFromLayer.rvb (926 Bytes)
bug rhino script.3dm (820.5 KB)

1 Like

Hi @SMC2,

What does this mean? How are you running the script from a toolbar button?

Here are a couple of articles that might be worth your time.

Loading Scripts

Running Scripts

Scripting Options

Efficient Script Loading

Script Demand Loading

– Dale

Hello,
thanks for the articles, unfortunetely, our problem is not solved.
we run all our scripts button toolbar with the commande -_Loadscript (“path\file.rvb”)

So you are saying that the accented characters like ê in layer names are causing the script to fail to run in V8 from a button or alias whereas it worked in V7? But the same script does run correctly in V8 if run from EditScript window?

Do you get any error messages when it fails?

Hi,
Yes the accented characters made problem.I try to say the script run corecctly in rhino 7/8 if the script is run in script editor but if we run that script with button toolbar (-_Load script “path\file.rvb”) the script runn but him made nothing result and the Rhino 7/8 return no error message :slightly_frowning_face:

for information, this script change the printwidth view
image

befor run script with editor


result run script with editor

if we run the script with the toolbar button ther ar no result and no error

regards

Can you confirm that if the layer name does not contain an accented character that the script then works from a button?

Yes I confirme that,
but I delete also accent in the script definition

image

OK, this I guess is a problem with how VBscripts are interpreted - I can’t answer that… @dale can you check this?

thanks

Hi @SMC2,

Open your script file in Notepad and save it with UTF-8 with BOM encoding.

image

More info:

The RhinoScript editor (RhinoScriptEditor.rhp) is saving script files as UTF-8, but with no byte order mark. RhinoScript (RhinoScript.rhp) requires that UTF-8 encoded text files have a byte order mark. If not, then are treated like ASCII encoded files. Thus the problem.

I’m surprised this hasn’t been reported already. Perhaps something has changed. I’ve logged the bug.

https://mcneel.myjetbrains.com/youtrack/issue/RH-80447

Note, this will not be fixed in V7.

Thanks for reporting.

– Dale

Hi Dale,
Many thanks,
Now our script runs correctly

regards