Get Rhino.Doc from Running Object Table

Hello smart guys :slight_smile:

I have been trying (x100) to get a Rhino.Doc object from ROT… but so far no luck at all.

I thought this should work…
System.Runtime.InteropServices.Marshal.GetActiveObject(“Rhino5.Application”);

but it return error of
error: Operation unavailable (Exception from HRESULT: 0x800401E3 (MK_E_UNAVAILABLE))

in the exact same way, I can access to Excel or Word!! but cannot for Rhino.

Anyone know how to do this? or any advice?

Thank you so much!
JH

This is not possible. You can only interact with Rhino over COM using the COM interface. Reference Rhino.tlb in your C# project, it is found in C:\Program Files\Rhinoceros 5.0 (64-bit)\System\Rhino5.tlb

See this page for more code https://github.com/dalefugier/TestDotNetAutomation

Thank you very much! phew… sounds like harder than I thought. I guess I would go with different ways.