RS V6 regression: compiled scripts fail to run other scripts from Rhino.Command

Hi,

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):


Please install this compiled RhinoScript test plugin:
GetStringPassCommandTest.rhp (8.5 KB)

It has 2 very simple script commands:

  1. GetStringPassCommandTest : this one actually tests the above problem and would try to run other scripts/commands in its runtime
  2. TestCompiledScriptCommand : sample message box - an abstract script/command that doesn’t work (as all others non-Rhino commands)

Here are the actual scripts used to compile the above plugin:
GetStringPassCommandTest.rvb (813 Bytes)
TestCompiledScriptCommand.rvb (300 Bytes)

Things to try:

  1. Install the test plugin (in V5 and V6)
  2. run GetStringPassCommandTest
  3. from here, any native Rhino command should run “inside” this command prompt (try: _Box)
  4. 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.

Also:

  1. Try putting the source of “TestCompiledScriptCommand.rvb” on toolbar button inside -_RunScript (… )
  2. 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.

Finally:

  1. open the “GetStringPassCommandTest.rvb” in RhinoScript Editor, and run it
  2. 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? :wink: )

Thank you,

–jarek

@dale can you help?

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.

Dan

Hi Dan,

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.

–jarek

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.

Dan

Here is the error. I notice when this comes up the ListBox methods fail.

image

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?

Yep, that sounds like a different issue.

I had our IT manager exclude the entire plug-ins folder in our AV software. I’ll see if that helps.

Thanks,

Dan

Bump :sunglasses:

Please don’t be overwhelmed by the initial post. The problem is quite simple and it was my attemtp to take time and explain well and make it easy to test/understand/find the issue…

thanks,

–jarek

I appreciate the effort. Just haven’t had the time yet to dig into this. I’ll let you know what I discover.

1 Like

Hi Steve,

I’m still having the RhinoScript plug-in randomly failing to load. Allowing it through the virus scanner didn’t help.

Thanks,

Dan

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.

It has been logged here: https://mcneel.myjetbrains.com/youtrack/issue/RH-31820
With some potential solution idea from Dale:

I figured I would mention this here since they may be related and looked into together.

thank you,

–jarek

Hello. Pinging with the original problem.
(looks like Dan’s attempt to hijack this topic was already successfully resolved by repairing the install).

The main one is still here…

I understand; I still haven’t had the time to dig in deep and figure out what is happening. Sorry for not reporting back.

Thanks Steve. I will check back in a little bit if there is no update.

Bump. Hello. Hi Steve. Checking again on the OP issue. Is there even a YT item for it ? This is the last major drawback coming from V5 to V6 we have…

Hi Jarek, I understand this is a big deal for you and am planning on working on this issue.

1 Like

Hi to all
I have the same issue. I waiting for a solution
Thank you
Luciano

Hi Luciano,

It has been fixed recently and should show up in one of the next SR or SR Candidates.

–jarek