How Can I lock my rvb script file, I want to open the script without seeing the content.
Option Explicit
Call Main()
Sub Main()
Rhino.Print("Test")
End Sub
If you would like to run a .rvb script without opening the script editor, there are several ways to do this.
Here are some options. All options assume you have saved your script to a local .rvb file.
Option 1:
- Open the .rvb file by double-clicking, this will launch Rhino and run the containing script.
Option 2:
- With Rhino open, run the 'LoadScript' Command.
- Click the 'Add...' button and navigate to your .rvb file in the file browser and click 'open' once the file is selected. This will add the script to the 'Select a script file to load:' box.

- Select the newly added script, and click 'Load'. This will run your script in the current rhino document.
Option 3:
- Remove the
Call Main()
line from the script
- Make your Sub Method public
public Sub Main()
- Save the script as a Main.rvb (I believe the file name and sub method name should match)
- Tell Rhino to load your script at startup by using the 'options' command and then navigating to 'RhinoScript>Startup>Script files' and adding the file path to the .rvb file.

- Add an Alias to run the script as an easy command. This can be done with Options>Aliases>New. The 'Alias' is the command name you would like to have run the script and the 'Command macro' would be
_-runscript Main
.
- Type your Alias in the command line to run your script anytime without needing to re-load, view, or change the script.

Locking
If you mean 'locking' in a more traditional sense of locking a file. I am not familiar with any Rhino options, but in Windows you can right-click the file, open 'Properties', and in the 'General' tab there is a 'Attributes: Read-Only' option, which would lock the file and prevent modification but will not prevent the scrip from being able to run in rhino.