Data connection between SketchUp and external program

Hello,

I am new to SketchUp as a Developer and I have a question about transferring data (e.g geometry data) between SketchUp and another external program.

What is a good way to transfer data between Sketchup and another program running on the same pc at runtime?

Best regards

Are we talking about one-time transfer? Or continuous stream of geometry update?

we talk about continuous updates

That’s a lot trickier. Haven’t tried this myself, but it’s something I need for a later project.

I’m not sure if pipes are fast enough. I’ve been toying with the idea of shared memory. Perhaps using the Poco library.

I am considering to use TCP at the moment. But I don’t know if that will work properly.

Given you want to continuously update I’d expect you’d have to drop down to C/C++ via a Ruby C/C++ Extension. Particularly if you need to have threads running to keep the communication open.

Is the external program that of your own making ? … or is it an OLE aware application, such as one of the MS Office applications ?

It’s my own program.

OK, well you can if it will only be a Windows application, use OLE.

For the SketchUp Ruby to OLE side, see:

… and the Ruby Standard library:

Or if you are programming C/C++, you can use an equiv of VB’s SendKeys, but target at a specific program:

See: SendKeys in C++ - CodeProject