Control camera view programmatically

I would like control the camera position and view inside Sketchup from a separate program outside Sketchup. Is that possible?

Yes, but not easily, I think. You’d need to implement an extension to do the camera control within SketchUp via the Ruby or live C API and then code a way for your other app to talk to it in real time, e.g. by inter process communication, and without blocking it.

My base understanding is that Ruby scripts work within Sketchup, designed to add to the features of Sketchup for the user, the best example being an Extension. What I have in mind is creating a 3D model using Sketchup, and while watching the model in Sketchup my outside program is changing the camera position and direction, and then making a 2D export for what is seen in the view. The RPC aspect is fine for me, perfect actually.
But if Ruby only works within Sketchup, then it doesn’t help, unless the RPC and perhaps API (??) from outside can act as the program is running inside Sketchup.