I am just starting to use the script editor in Version 8 (8.3.24009.15002, 2024-01-09) on a Mac computer.
My script is written in python and I want to get an rhp that I can share with others, That works well until I start to insert an icon or image in my script. When I share the rhp and the image, I can’t figure out what path I have to call, so that it works.
My code down here for the image call works if I start the code from the script editor but not from the exported rhp in Rhino or on other machine.
Hi @lxgbrl
The issue happens because you are using relative paths to your images. Once your script is packaged into an .rhp file, the original working directory and relative paths might not be interpreted correctly by Rhino.
You could consider using an absolute Installation path or pack the RHP file with the resources (images etc) required.
Hope this helps,
Farouk
Hi @lxgbrl, take a look at this thread. Note that rhi installer is not there anymore so you’ll have to work with yak instead.
btw. the fun with files relative to a compliled script’s plugin folder begins when you’ve installed your plugin multiple times because yak did not remove the previous version or when
Rhino.PlugIns.PlugIn.PathFromName(string name)
returns the path to a plugin with the same name but not the Rhino version you’re actually running. In these cases, the path returned may not be the correct one.
The issue has been there for many years unfortunately.
@clement that is exactly what I needed to know. Thanks. I will try with yak.
@farouk.serragedine Okay, so I found an sln file in the src folder after compiling with script editor. I guess I could use this with visual studio, add my image and go on from there?