Python "RegistryKey" not working, How to get Rhino registry keys?


#1

Hello,

In the offline Rhino IronPython help file there is ‘RegistryKey’ command with example but this command is not recognized in the editor

Online documentation does not contain it so assume it is obsolete?

Is there an efficiently way in python to retrieve Rhino registry keys like with the similar command in rhinoscript?

Also, is there a way to get more plugin Info data in python like in rhinoscript?

BR
Aleksandar


(Dale Fugier) #2

I don’t see an “easy” way of getting Rhino’s Registry key. Why do you need this?


#3

Hello,

I had an idea to store some settings about my plugin commands in these keys, because there is already plugin key there. It seemed convenient, but I’ve abandoned that idea already

I made my own sub folder inside %appdata% folder to store all the info, This came up to be even better because I can store whatever I want there

I was hoping to get “path flexibility” between different PCs with using Rhino plugins path in registry
I just hope %appdata% path will be flexible enough when somebody else uses my plugin ( different windows version )

I made this initialization script in rhinoscript and included it in my plugin as “library” type so it is run before any of my commands,
Since the plugin compiler does not accept python scripts as “library” type , rhinoscript was good choice for the path initialization

Here is a vbs snippet I found, if anybody needs it:

Dim objWShell
Set objWShell = CreateObject("WScript.Shell")

Dim fso	
Set fso = CreateObject("Scripting.FileSystemObject")

Dim appData
appData = objWShell.expandEnvironmentStrings("%APPDATA%")

If Not fso.FolderExists(appData + "\Plugin folder") Then
	fso.CreateFolder appData + "\Plugin folder"
End If

Dim PluginPath
PluginPath = appData + "\Plugin folder"

Set objWShell = Nothing

BR
Aleksandar