Switching recently our production to Rhino 6 I have encountered a major drawback compared to V5 (and earlier versions):
For some reason, compiled scripts would not run either scripts via -_RunScript() or compiled script commands, from Rhino.Command function. Please note there is no problem if the main calling script runs from ScriptEditor.
This is a big problem since a lot of our in-house tools and some of my publicly released plugins rely on this functionality working (including those literally used every 5 minutes that deal with view manipulations, used in-command of other, more complex tools.)
I realize the above may sound a bit confusing, so I have prepared simple examples to test (all should work fine in V5, not at all in V6):
from here, any native Rhino command should run “inside” this command prompt (try: _Box)
pick “TestCompiledScriptCommand” command-line option - it will attempt to pass this string as command name to Rhino.Command inside the “GetStringPassCommandTest” plugin.
In Rhino 5 message box will show (command runs, no problem), in V6 nothing happens.
Try putting the source of “TestCompiledScriptCommand.rvb” on toolbar button inside -_RunScript (… )
run GetStringPassCommandTest command, and try clicking the button while in prompt: in V5 all works OK (message box), in V6 I can only see “RunScript” passed to CommandLine, and nothing happens.
open the “GetStringPassCommandTest.rvb” in RhinoScript Editor, and run it
the button should work OK inside the script prompt (V5 and V6), also, the compiled command “TestCompiledScriptCommand” should also work OK inside the script prompt (V5 and V6).
So - clearly in V6 there is an issue preventing compiled script commands running other scripted commands or _-RunScript()s in their runtime. I guess this is not the compiler problem since in V5 all works OK, but something broke in the way V6 handles this situation.
This is another show-stopper for the V6 production switch over here.
Hope someone can help to fix it! (@Pascal - any volunteers? )
We have not experienced that here. We run a compiled plug-in that has about 280 scripts. Having said that, there does seem to be an issue that surfaced in SR8. For some reason, the Rhinoscript.rhp plug-in fails to load occasionally, on some computers. Anything that I have that launches with runscript fails. The solution is to find the RhinoScript.rhp file in C:\Program Files\Rhino 6\Plug-ins and drag it into your open Rhino viewport. The plug-in reloads and is good for a day or two. Then it happens again a few days later. I’ve seen this on about 10 out of 130 installations.
Not sure if this will help, but I thought it was worth mentioning.
The issue is not running complied plugins, these work fine. It’s a bit more convoluted. What does not work in V6 (and used to before) is if your compiled script tries to pass another compiled script command name or -_Runscript(…) into Rhino.Command() method. It used to work in kind of “nested” way, allowing to run one script during runtime of another. Especially helpful with any view manipulation scripts used inside modeling scripts…
If you get a chance, maybe you can try the above steps in V5 and V6 and see what I mean.
With the issue you describe - do compiled scripts fail, or just -_Runscript()-ed ones? What message/errror do you see when it happens? I don’t see it here on much fewers systems, but one of my plugin users reported issue that so far I was not able to resolve. Basically the plugin (RhinoScript compiled) shows as installed, command autocompletes, but nothing happens once it runs. Wondering if this may be similar issue.
All compiled scripts work except for the ones that use Runscript. The user will get a warning that the Rhinoscript plug-in is not loaded when they first open Rhino, but they close that warning and move on. When they try to run anything that uses Runscript nothing happens. No warning, just nothing. Dragging and dropping the Rhinoscript.rhp file back into Rhino fixes it… for a few days. Like I mentioned, this is new in SR8. We never had that issue until this SR.
I don’t have V5 installed to test. I kept it up until a week ago.
I think this is a completely different issue than what Jarek is experiencing. For some reason Rhinoscript.rhp doesn’t want to load in Rhino for these users. Rhinoscript is one of the files that virus protection applications typically flag since it implements COM. Is there any chance your users have some anti-virus on their machines that may be interfering?
Hi @stevebaer , to add to this recent issue, there is one more that could be related while looking into it.
That one last time worked ok with Monkey compiler and V4, but for a while, since the new compiler was out, it stopped working. Hope this is not confusing regarding the original post because it is a slightly different thing, but can be related. I have been mentioning it over the past few years every now and then with no luck so far.
Currently in V5 and V6 scripts that are executed via _Runscript([script code here]) command or _Runscript([preloaded script name here]) work OK and “inside” regular Rhino commands. So we have developed many tools based on that that help with modeling process. Assigned to key shortcuts as aliases, they create a powerfull one-shot display aids while modeling, like: restoring title view, moving target to object under cursor, disabling/enabling selection highlight in display mode, scaling ortho views display, etc. etc.
So for example if I run the Polyline command, while drawing points I can use the key shortcut to execute these and get visual/view-based aids, within the command. This is great and very useful.
Unfortunately as soon as these scripts become compiled Rhino commands, they don’t work in-commands (basically they get ignored), so assigning them to key shortcuts doesn’t make sense. It poses a problem with distributing them internally or publishing such tools. As I mentioned, somehow it used to work fine with old Monkey, but not since the new compiler came out.