External API access?

 From:  Michael Gibson
2810.2 In reply to 2810.1 
Hi Ella,

> I'm curious how difficult it would be to expose the JavaScript
> API to external callers, in real time?

This would be possible using the COM interprocess communication mechanism, but it can be a somewhat finicky thing to set up - it would probably involve some messing around with the installer to set up some additional stuff in the system registry and having a strategy for dealing with multiple versions being installed and stuff like that. It's not a very good time right now near the end of the beta cycle to mess with the installer very much though.


> I could see, for instance, having the calling program
> actually launch the Moi instance and attach stdin/stdout
> text streams and interact with serialized commands/data,
> or doing the same thing over a named pipe or a local socket.

Being able to mess with serialized data is pretty different than interacting with the script API though. It can tend to be easier to break compatibility when things are more directly interacting with binary data.

I think that making objects available as a blob of data that is actually an OpenNURBS 3DM file (same as if you saved it to disk) will probably be a pretty safe way to go with this though, since then it is serialized to a more stable format.

I do want to add that at some point, but that will be more work than just exposing an API, that will be about making a new binary data API instead of the script one basically. I'm not sure when that will start, hopefully in v3 sometime but even that is not really certain at this point.

- Michael