Wiley
December 20, 2021, 9:17am
1
Hey guys I am trying to set up a batch file that would automatically install the plugins for new users.
"C:\Program Files\Rhino 7\System\Rhino.exe" /runscript="-RunPythonScript "C:\myscript\mycript.py"
Inside the python script
import rhinoscriptsyntax as rs
objPlugIn = rs.PlugIns(types=0, status=0)
if not ("PluginABC" in objPlugIn):
"install PluginABC from Path"
However I don’t find any Install Plugin from Path Methods in the Rhino Common API.
Really appreciate if you can help me on this.
dale
(Dale Fugier)
December 20, 2021, 5:31pm
2
Hi @Wiley ,
Does this help?
import Rhino
dict = Rhino.PlugIns.PlugIn.GetInstalledPlugIns()
for item in dict:
path = Rhino.PlugIns.PlugIn.PathFromId(item.Key)
print('Id = {0}'.format(item.Key))
print(' Name = {0}'.format(item.Value))
print(' Path = {0}'.format(path))
– Dale
Wiley
December 20, 2021, 7:05pm
3
Hi Dale.
Thanks for the reply.
What if the Plugins are Not isntalled?
PathFromId() method only works if the plugin is preinstalled, as far as I understand.
I edited the question a bit because I might be being confusing putting the print inside the if statement.
dale
(Dale Fugier)
December 21, 2021, 1:46am
4
What does this mean?
Rhino can only report on plug-in that are registered or “installed.”
Or am I confused?
– Dale
Wiley,
Apparently the installation of a plug-in requires more information than Rhino has access to. Are you actually trying to install plug-ins for the first time or are you wanting to load them into Rhino and enable them for use during a session?
In File->Properties->Plugins on my system I see:
This shows the status of my installed plug-ins. Some are loaded, some are not. All of them are enabled. I believe when a plugin is used then it will automatically be loaded.
Which steps of the installed, loaded, enabled are you trying to script?
Regards,
Terry.
menno
(Menno Deij - van Rijswijk)
December 21, 2021, 9:17am
6
You may be successful with the Rhino.PlugIns.PlugIn.Load(string path, out Guid id)
static method.
https://developer.rhino3d.com/api/RhinoCommon/html/M_Rhino_PlugIns_PlugIn_LoadPlugIn_2.htm
1 Like