But I want to add the startup command from a Python script (or rvb script). I am implementing this change on many users’ machines and would like to have the startup commands added or removed from a script.
I saw on the forums how to update the PackageManger source setting in python:
settings = Rhino.PlugIns.PlugIn.GetPluginSettings(Rhino.RhinoApp.CurrentRhinoId, False)
s = settings.GetChild("Options").GetChild("PackageManager")
s.SetString("Sources","https://yak.rhino3d.com;" + packageFolder)
But I cannot figure out how to adapt this code to edit the startup commands. Can anyone help?
I couldn’t get Rhino to run a py script from the startupscriptlist but thanks to your links I came up with a bit of a clunky workaround that is doing what I need.
If it helps anyone in the future: I have an .RVB script that calls the command that I want:
Option Explicit
Sub WakeUp()
Dim commandName
commandName = "GoodMorning"
Rhino.Command commandName
End Sub
WakeUp
I am using another RVB script to add the initial script to the startup script list, I would have preferred to do this with python but I could only access AddStartupScript through RVB:
Option Explicit
Sub StartupEnable()
Dim filePath
filePath = "C:\my file\path here\WakeUp.rvb"
Rhino.AddStartupScript(filePath)
End Sub
StartupEnable
I can then finally call the StartupEnable script from python to add the command to the startup script list: