Active tab at Rhinoceros starting

Hello! :blush:
I’m developing plug-in using C++.
The feature I’m trying to implement is: If the current session of Rhinoceros is closed with active (selected) tab “Properies”

then after the start of new Rhinoceros session this tab will be also active (by default as I can see the left tab is always active after Rhinceros loading).

For this I:

  1. I save the ID’s of active tabs (gotten by CRhinoTabbedDockBarDialog::GetOpenTabIds()) in register.
  2. After Rhinoceros start (in CRhinoIsIdle) I show saved tabs (ShowDockbarTab)

The question is:
When can I save active tabs? I want to save them right before closing of Rhinoceros. But in “OnUnloadPlugIn”, “OnCloseDocument”, “OnCloseRhino” dockBar’s are already destroyed and “GetOpenTabIds” returns nothing.

For now I save them in “OnEndSaveDocument”. But it would be great to save active tabs even without document saving.
Thanks for any help you can provide!

Hi @zer41k,

Try overriding CRhinoPlugIn::OnSaveAllSettings and handle your saving there.

– Dale

1 Like

Thanks for reply @dale
Yes, this method is called really the first after the closing of Rhinoceros. But even in “OnSaveAllSettings” the “GetOpenTabIds” method returns nothing…
So I suppose it’s impossible for now to find ideal place for saving


Is the main problem here that you want Rhino to remember the active tab when it starts? If so I logged that as a bug RH-46449. @dale and I looked into CRhinoPlugIn::OnSaveAllSettings and it appears to be getting called later than it should in Rhino 6. I logged the OnSaveAllSettings bug as RH-46448