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:
CRhino4Interface m_Interface;
if( !m_Interface.CreateDispatch(L"Rhino4.Interface", 0) )
{
AfxMessageBox(L"Could not create dispatch interface!", MB_OK | MB_ICONEXCLAMATION);
return FALSE;
}
COleVariant var = m_Interface.GetScriptObject();
if( var.vt != VT_DISPATCH )
{
AfxMessageBox(L"Could not create RhinoScript!", MB_OK | MB_ICONEXCLAMATION);
return FALSE;
}
//show rhino
m_Interface.SetVisible( TRUE );
CRhinoScript RhinoScript;
RhinoScript.AttachDispatch( var.pdispVal, TRUE );
VARIANT ret = RhinoScript.Command( COleVariant(_T("_-RhinoPLM")), COleVariant((long)1) );
RhinoScript.ReleaseDispatch();
m_Interface.ReleaseDispatch();
Now in Rhino 5 i have several problems:
is there a way to connect via COM to a running Rhino-session?
Tags:
Permalink Reply by Dale Fugier on March 13, 2013 at 1:52pm Hi Wolfgang,
I believe I am able to repeat this problem. Let me do some more investigating. I'll let you know what I find.
Thanks,
-- Dale
Permalink Reply by Dale Fugier on March 19, 2013 at 9:02am 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)?
-- Dale
Permalink Reply by wolfgang on March 20, 2013 at 12:02am 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.
© 2013 Created by McNeel Admin.
