How do I get the list of NamedViews of a doc (C++)?

Suppose I have saved 3 different namedViews “aa”, “bb”, “cc” in a Rhino project.
How can I get a list of these namedViews?

Hi @fatecasino,

Try this:

CRhinoCommand::result CCommandTest::RunCommand(const CRhinoCommandContext& context)
  const int namedview_count = context.m_doc.Properties().NamedViewCount();
  for (int i = 0; i < namedview_count; i++)
    const ON_3dmView* pView = context.m_doc.Properties().NamedView(i);
    if (pView)
      RhinoApp().Print(L"%ls\n", static_cast<const wchar_t*>(pView->m_name));
  return CRhinoCommand::success;

– Dale

1 Like