In rhino 4 i made an exe which could start a new rhino session or connect to an existing and execute a command and leave the session open for the user. It was like this:
if( !m_Interface.CreateDispatch(L"Rhino4.Interface", 0) )
AfxMessageBox(L"Could not create dispatch interface!", MB_OK | MB_ICONEXCLAMATION);
COleVariant var = m_Interface.GetScriptObject();
if( var.vt != VT_DISPATCH )
AfxMessageBox(L"Could not create RhinoScript!", MB_OK | MB_ICONEXCLAMATION);
m_Interface.SetVisible( TRUE );
RhinoScript.AttachDispatch( var.pdispVal, TRUE );
VARIANT ret = RhinoScript.Command( COleVariant(_T("_-RhinoPLM")), COleVariant((long)1) );
Now in Rhino 5 i have several problems:
is there a way to connect via COM to a running Rhino-session?
I believe I am able to repeat this problem. Let me do some more investigating. I'll let you know what I find.
any news regarding this problem?
Sorry no, I have not had time to dig into it yet. Hopefully I can look further into the situation this week.
Any are you automating Rhino? What are you doing (just curious)?
we have an application which manages the CAD files in a database. from this application we want to open the CAD file, so we connect via COM to rhino and open the file. in rhino4 we could open it in the current session which was very practically. in rhino5 we get every time a new session which is annoying.