I will distribute Holomark 2 together with a 3D file (mini morris) and some display modes. I’ll tell the users to keep these in the same folder. So when Holomark is installed it can automatically locate the other files it needs.
I work around this now by having the user select the folder where the files are. Then all the rest is automatic. But that is not as smooth as I would like it.
I am trying to convert @dale s code to Pyton and I can only find three paths.
(And I keep on forgetting how to format this to python… sorry)
import Rhino
import System.Reflection.Assembly
#strPluginName="Holomark2.rhp"
dict = Rhino.PlugIns.PlugIn.GetInstalledPlugIns()
for entry in dict:
print entry
plugin = Rhino.PlugIns.PlugIn.Find(entry.Key)
if plugin:
assembly = plugin.Assembly
if assembly:
print (assembly.Location)
Are you trying to find the “Holomark2” plug-in from within your python script, or are you trying to find other plug-ins? I’m asking so I can focus on the exact problem you are trying to solve.
Hmm… seems to work for me. Is Holomark2 the name of your plug-in that your script is running in? Look in the plug-in manager and make sure you have the exact same name.
There are path functions for splitting up strings like this, but in your case this should be fine. For something like this, I find it a little clearer to write something like
I agree, that looks cleaner and easier to update in the future.
I implemented the folder search in Holomark2 now and it works fine on my computer. Hopefully it will work fine on most systems. So thanks again for the help!
Hi guys, I am revisiting this and have an issue with the latest Rhino 5 build where Rhino.PlugIns.PlugIn.Find doesn’t return anything even if I can locate the ID.