Check rhino instances with rhinoscript

Hi,
I am using Rhino script from my code VB.net no Rhinocommon but script.
When I am opening at first my application the rhinoscriptt open an instance of Rhino. Most of the time the behavior of my application doesnt work as expected.
So my question is how start the application-> open Rhino if no rhino instance, or check how many instance are available and take one of them?

the code when creating the object I have Implemented is

m_RhinoApp = CreateObject("Rhino.Interface.6") 

Dim nCount As Short
        ' Make attempts to get RhinoScript.
        ' Sleep between each attempt.
        nCount = 0
        Do While (nCount < 100)
            On Error Resume Next
            m_Rhino = m_RhinoApp.GetScriptObject()
            If Err.Number <> 0 Or IsDBNull(m_Rhino) Then
                Err.Clear()
                Waitms(500)
                nCount = nCount + 1
            Else
                Exit Do
            End If
        Loop
        m_RhinoApp.visible = True
        m_Rhino.DisplayOleAlerts(TriState.False)
        m_Rhino.UnitAbsoluteTolerance(0.00001)

But from here I don’t see how many Instances are opened and I can’t take control of one of them.

Hi Markus,

If you want to create a new instance of Rhino, create a Rhino.Application object.

If you want to try to hook onto an instance of Rhino that is already running, create a Rhino.Interface object. Note, if more than one instance of Rhino is already running, there isn’t way to specify what instance to hook onto.

https://developer.rhino3d.com/api/rhinoscript/introduction/external_access.htm

– Dale

Yes it helped a bit, perharps a better approch would be to look if there is a Communication still available between the Rhino object into my code and Rhino software. But I don’t find a function or a way to make it. Do you have any idea?

Hi @markus.erhardt,

Sorry, I don’t know what this means. Can you try to clarify? What problem are you trying to solve?

Thanks,

– Dale