Rhino Script Compiler for Rhino5, second Beta

I was holding off on replying because I thought I was going to be able to look at this today. Wasn’t successful at that; will have to try tomorrow.

1 Like

I am not able to get rs.ViewDisplayMode() to work in the plugin.

It works perfect in the script, both to return the current display mode, and to set a new one.

So I replaced it with rs.Command("_SetDisplayMode “,dispMode,” _Enter") and that works.

Until I get to a rs.RotateView() and then the plugin version stops again.

Hope that helps you out in the bug tracking!!!

Hi @stevebaer
I am sorry for nagging on this, but I would really like to know when I can complete the project.


Sorry, still high on my list.

Ok, I’ll work on the new webpage in the mean time, but please hurry, I want to move on to the next project :wink:

Can the compiler deal with Pickle files? I’ve got a set of pickle files that my scripts reference and would like the information in the pickle files to go with them.

No, the compiler does not embed pickle files into your rhp. That being said, you should be able to include any type of file in your RHI which is just a renamed zip file.

So then my workflow for making a plugin made of multiple python scripts should be as follows?

  1. Compile the python scripts into a *.rhp
  2. Zip the new *.rhp with the pickle files, help file, ect.
  3. rename the .zip file as a *.rhi


That looks correct

Hi Steve, any news on my issues?

On vacation last couple of days. Hoping to look at this on airplane ride home tonight

Nah, leave it for next week and enjoy the last part of the vacation!
You deserve it :smile:

Hi all,

-Rhino 5 SN4 & .NET 4.5 installed
-Tried with several different “rvb” files, but keep getting the error.
Do you have any suggestions?

Thank you,

By SN4 do you mean you have service release 4? If that is the case, please update your Rhino to the latest service release to see if that fixes the problem.

Thanks Steve,
Updating Rhino to the latest service release, solved it. But I’m a bit sad since, a user who has a previous release won’t be able to install the plug-in.

Hi Steve,
anything I can do to help solving the conversion issue?
I need this for a job now, not only for Holomark2.

I’ll jump through burning loops if that helps :smile:

I’m currently working on a round of optimizing V6 to load as fast as possible. This should take another day or two. Once that is done, this issue is next on my list to investigate.

Ok, fabulous, and I am happy to play with V6 in the meantime… :smile:

1 Like

I think I figured out what was going wrong with your script. I can try to fix this in the core in the future, but for now here is a simple change you can make to get your script running.

At the beginning of your script, add another import

import scriptcontext

Right after you call the command that creates a new file, set the scriptcontext doc to the new active doc

rs.Command("_-New _None",False)
scriptcontext.doc = Rhino.RhinoDoc.ActiveDoc

I need to adjust the core to account for when the document changes in a script. The scriptcontext.doc variable was pointing at the old closed document and was therefore not giving valid results when things like views were being looked up.

Ok, that makes sense in an odd way :smile:

Thanks for figuring this out Steve!