How to run a ruby file from a plugin


#1

Hello,

SketchUp is still pretty new to me so I’m sorry if this question has a very simple answer, but I am wondering if it is possible to call another ruby script from within my plugin and run it. Basically I want to be able to run my plugin which will then run a different ruby code that is saved in a folder inside of the “plugins” folder.

The reason that I’m wondering this is because I have a plugin that creates a webpage that will generate a ruby script that defines instance variables and I want to run this ruby code before running through the rest of the code in the plugin.

Any help on this would be great.


#2

You can require the other file using a require statement. Then call the methods defined in it. However I’d recommend wrapping both these files into the same folder and regard it as one single plugin.


#3

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.