Get Left, Back, Bottom views in C++

Hi,

I have an issue similar to Get Left, Back and bottom views using python script in C++: how do I get Left, Back and Bottom pre-defined views, when they are not currently in the document set of views?

Normally I’d do something like

ON_3dmView views[4];

bool foundPerspective = context.m_doc.FindView(L"Perspective", views[0]);
bool foundBottom = context.m_doc.FindView(L"Bottom", views[1]);
bool foundBack = context.m_doc.FindView(L"Back", views[2]);
bool foundLeft = context.m_doc.FindView(L"Left", views[3]);

But these are false when the views are not currently in the document. How to get them regardless of the current document views?

Thanks,
Pablo

Hi @Pablo_Garcia-Amorena,

If you want Rhino’s pre-canned world bottom view info, for example, then you can do something like this:

static ON_3dmView GetBottom3dmView()
{
  CRhinoViewport vp;
  vp.SetToBottomView(L"Bottom");
  return vp.View();
}

There are CRhinoViewport::SetTo<xyz>View methods for the other standard views.

– Dale

Great! Thanks @dale

Pablo