Running Sketchup from Python


#1

Good day,

I am looking for information regarding the possibility to run sketchup from a python application.
Suppose I have a python GUI that lets me choose the coordonates of two points A & B, a length and a thickness.
I would like to click on a pushbutton (for example) in the GUI and see in sketchup the designed beam.

Thanks a lot for any kind of information that would help to go farther in this subject.

Jim


#2

SketchUp does not have a built-in external automation interface or a way to feed external data. In principle, one could develop such an interface using either the SketchUp Ruby API or the C++ SDK, but I don’t know that anyone has done so or done so compatibly with Python. Would it be possible for you to write a Ruby plugin or to use other built-in features such as Dynamic Components to do what you need?


#3

there is sketchup.exe -RubyStartup C:\path\to\script.rb
script.rb could be written by and launched from python but i needs to be in ruby.
from the ruby you can open a socket to reply back if needed…
john


#4

Is it just for your own interests, or to ship something to users? You can use Sikuli, which does UI automation, and can interact with the UI via Jython or JRuby (J == Java) for internal use.