I am developing my .Net code in F# in VS.
Is there a way that I can draw lines an points from a dll that does not run inside rhino?
I thougth about creating a little helper rhp, that just draws lines and points, load it in Rhino. and then call this one to draw my debug stuff from the scripting REPL in VS.
would that work?
I suppose that you can always open a socket connection on the local machine and listen for messages. The REPL can send messages, the RHP can respond to them by drawing.
Other than that, there is the automation interface. For more info see https://github.com/mcneel/rhinocommon/tree/master/examples/AutomationSample
Basically, you can send any script call to an instance of Rhino from a different process.
I assume sockets is more performant if I draw thousands of lines? Are Sockets the best Way to have two .Net Apps talk to each other ? ( I never used sockets before)
Sockets is the most low-level communication possible, you need to define your own message format and implement a lot of overhead: listening, buffering, etc. Maybe not such a brilliant suggestion after all…
Maybe take a look at WCF (Windows Communication Foundation) and/or Named Pipes (see for example this http://www.codeproject.com/Articles/7176/Inter-Process-Communication-in-NET-Using-Named-Pip)
I have a crude plug-in assembled from bits that I found in various open source projects which basically listens for http requests containing F# code and then compiles and runs it sending back the std out as the http response. The client side is just a command line utility with no integration with VS. The Express versions of VS cannot easily be extended anyway.
Another hack is that I have a plug-in that wraps NUnit and I write F# code as unit tests and have it load that way.
Not ideal solutions and at some point I’d like to take the time to come up with a real solution but until then that has worked for me.
Thanks for your link Menno, I’ll try COM, since the examples should make it easier and the performance seems to be the same as with WCF: