CRhinoSdkUiFile.h and CRhinoUiFile class clarifications

Dear all,

 

i'm currently trying to update my old v4 toolbar stuff to the recent V5 by using as found somewhere on the internet the CRhinoSdkUiFile.h static methods. 

The basic code looks similar to this one below:

m_ToolbarFileName = ON_wString(L"<path to the .rui file>");

if (CRhinoUiFile::FileIsOpen(m_ToolbarFileName, true))
  m_ToolbarFileUUID = CRhinoUiFile::FileID(m_ToolbarFileName, true);
else
  m_ToolbarFileUUID = CRhinoUiFile::FileOpen(m_ToolbarFileName);

m_GroupUUID = CRhinoUiFile::GroupID(m_ToolbarFileUUID, 0);
if (!CRhinoUiFile::GroupIsVisible(m_ToolbarFileUUID, m_GroupUUID))
{
  bool res = CRhinoUiFile::GroupShow(m_ToolbarFileUUID, m_GroupUUID, true);
  if (res)
    DEBUGMSG(L"GroupShow returned true");
  else
    DEBUGMSG(L"GroupShow returned false");
}
else
  DEBUGMSG(L"Toolbar group already visible");

Two questions: 

  1. FileIsOpen() method always returns false although after Rhino completes loading it reports that the pointed .rui file is already loaded (nowhere else in my code i invoke FileOpen() )
  2. GroupShow() when run at the Rhino startup, if the toolbar is not visible, always return false as it doesn't succeed in showing the toolbar

Is there any hints or simple example explaining the CRhinoUiFile class?

Thanks for supporting, R.

Views: 53

Replies to This Discussion

RSS

Translate

© 2014   Created by McNeel Admin.

Badges  |  Report an Issue  |  Terms of Service