Script files to load when Rhino starts

Is it possible to add a rvb with rhinoscript?

Cannot get it to work if it is even possible.
I’m trying with:

-_options _rhinoscript 

Thats as far as I get.

Is it possible what I want?

hi jordy,

if you add your rhino commands to an rvb file it should be possible to run this rvb file on startup. eg. if your rvb file looks like this:

Option Explicit

Call Options
Sub Options()
	cmd = "_-Options _RhinoScript"
	Rhino.Command cmd, False
End Sub

you can then save this file and add the filepath here under Startup:

However, this will only bring you into the commandline version of the options command where the startup scripts are not exposed. The only option available is to reset the RhinoScript engine which starts “resetted” whenever Rhino was started. What are you trying to do ?

greetings,
clement

I know I can add them myself.

I’m trying to make it easier to install my program. I’m trying to make a .bat that will extract my project. Then it will open rhino, loads my plug-in and after that add rvb to rhino startup script.

Only thing I cant figure out is the last part. To load in the rvb :slight_smile:

Very nice Clement.

How come this option is on available for Python (.py) files?

Mine looks like this :wink:

Sub runstartupscript()

rhino.command "my commands that should run"

End Sub

runstartupscript

Still I’m not looking to how to create one. I want to add one to the list WITH rhinoscript :stuck_out_tongue:

P.S. If it is possible for a plugin to do this. Then I can also get it to work :P.

Because I first load my plugin. So I only have to add another command that could do this.

Anyone vb.net experience with this?

hi jordy,

you might add your script then by using

Rhino.AddStartupScript

but wouldn`t it be easier by drag and drop the rhp plugin file to install it ? You might then add a method to your plugin which runs on startup and probably sets up file search paths to your plugin location. Does your plugin contain toobars as well which you´ll need to auto-install ? I´m just guessing here of course :wink:

c.

Rhino.AddStartupScript cant be found. But I’ll search a bit further. Yeah toolbars too I guess but I know how to do that :slight_smile:

Yeah drag and drop is easier yes BUT, some people will use it that dont know how things like that work. So making a bat file that will do all the work is easier :slight_smile:

hi jordy,

it is not a Rhino command but a RhinoScript method found under Application methods. It is not available at this moment with python. What do you use to make your plugin ?

c.

microsoft visual basic 2010 :slight_smile:

i think it has not been requested before :wink: …and should be added.

c.

1 Like

is it possible to add a:

runscript ( 
sub test
Rhino.AddStartupScript
end sub
test
)

to a .bat file?

“C:\Program Files\Rhinoceros 5 (64-bit)\System\Rhino.exe” /nosplash /runscript=""

Between the “” after runscript?

I know I managed to do this a while ago but cant figure it out now.

"C:\Program Files\Rhinoceros 5 (64-bit)\System\Rhino.exe" /nosplash /runscript="-_runscript ( " and then?

You can do the same thing in Python, but not in the same place. You can add the file paths you want in the Python editor under Tools>Options>Files tab. I have requested that this be integrated into the normal Rhino options.

–Mitch

Mitch, could you refresh my memory as to why you want this feature? I’m trying to understand what python developers are trying to achieve with this.
Thanks.

Thanks. Mitch.
Is this what you are referring to:

I can’t make it work. Does Rhino search for any .py files in that folder (in this case “D:\find2\New folder”) and executes them on Rhino start?

Hi Jordy- you can use

Rhino.AddStartupScript()

does that help for what you want to do?

-Pascal

No, I meant in the Python editor itself… But now, rereading the whole thread I’m not sure whether you’re looking for a way to set file paths (what I showed) or a way to run startup scripts. As far as I know the only way to run Python scripts at startup currently is in Options>General to set them as startup commands with

! _-RunPythonScript scriptfilename.py

and have previously set a path to the folder where the script is in the Python editor as above, or have the full pathname in the command.

–Mitch

1 Like

Hi Steve,

Just trying to have all the stuff in the same place so it’s easier to find for the user, it seems odd to be able to set paths to where Rhinoscript can find files in Rhino options, and not be able to do the same thing with Python scripts.

–Mitch

Yes, I thought running Python scripts at Rhino startup.
Thanks Mitch.

I’m pretty confused about this thread. There seem to be about three different topics being discussed.

With respect to python
1 - Why do you want to run a python script when starting Rhino? Does anyone have an example of why they would want to do this? Does “-RunPythonScript myscript.py” work for people? I’m just confused and need help.

2 - I can see the confusion about python not looking in the folders specified by the “Rhino Search Paths”. I can change this for Rhino 6 and see if that makes more sense for users (thanks.)

Thanks,
-Steve