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:

  1. with Rhino5.Interface it's not possible to keep rhino open. i tried also SetReleaseWithoutClosing, no chance! Sometimes it's even worse: i get a rhino session with black views.
  2. with Rhino5.Application i get every time a new session.

is there a way to connect via COM to a running Rhino-session?

Views: 131

Replies to This Discussion

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

Hi Dale,

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)?

 -- Dale

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.

RSS

Translate

© 2014   Created by McNeel Admin.

Badges  |  Report an Issue  |  Terms of Service