Running Extension Menu using Ruby

Hello everyone!

I have a quick question regarding a ruby script. Is there a possibility to create a ruby script that will execute another extension command? Like “render” from V-Ray?

Thank you

You can’t directly trigger a menu entry. However you can guess what method the menu entry calls and try to hijack it, but essentially it would just be a hack and risk breaking if the method name is ever changed.

1 Like

Yes and no !
If you know the exact commands used to run a particular extension/tool within SketchUp then you can repeat those in your own code.
However, since most complex scripts will be securely encrypted it’s unlikely you can discover those in sufficient detail.
If it’s your own extension then obviously you’ll know how it works.
If it’s an external application there are ways of running it from within SketchUp - e.g. using UI.openURL with the full path to the exe file, or using cmd or vbs calls [in temporary files] you ‘run’ to pass arguments to the exe, and of course this differs between PC and MAC OSs…

So whilst it is possible it’s unlikely to be simple…
If you have a particular extension in mind, then perhaps contacting its author, and explaining what you want to do, they might help ?

1 Like

Thank you very much for the quick reply.
I wanted to double check if I wasnt missing anything.

tack så mycket

Exactly, I have also sent to them.
I was just wondering if I was missing anything since I am new on Ruby.