generative modeling for Rhino
Let me start by saying.. good C++.. but zero C# knowledge.
I want to built a GH plugin to link an analysis library that I have with GH.
I have 2 options currently available (thinking with a C++ head).
1) add my code to the VStudio project and link/compile it with the C# code, which I think its not possible/easy?!
2) use boost::asio (couldn't find a good answer online, if its possible to build boost for C#) or something C#/Net based that can talk to boost::asio. I currently have a boost::asio remote connectivity with my software working.
Any ideas for the above? or new ideas? examples online?
there's basically two solutions I know of that work. We've used both for Rhino .NET SDKs but we no longer like solution #1
So from what I get the easiest thing is to make a small client dll with the boost:asio client and some simple functions from GH to read/write and use PInvoke..
Link to PInvoke docs/tuts?
I'm a little confused about your comment on boost:asio. Are you trying to have grasshopper communicate with a stand-alone analysis application? If so, there are networking classes in C# that you can use to perform this (I'm sure a quick google search will result in a ton of examples.)
If the analysis application is your own code, then you may want to consider modifying it to be compiled as a dll instead of an exe. Once that is done, then you can follow step 2 as outlined by David above (we actually do share the C++ wrapper library also in the github repository).
sorry for the confusion :)
Yes, I have 2 options, you are right. 1) compile my software as a dll (lib) or 2) write a boost:asio "wrapped" dll that c# can play with as a network client. the second option came in mind because I already have the asio "server" on my software, so I dont have to manage many builds. (another thing is that my software is multi-platform so the analysis server can be on another machine or outside VM :) )
All is/will be open source so I'll try to keep my code base in one place maybe.
Thanks both for the link. Ill check it.