Quantcast
Channel: Scripting - McNeel Forum
Viewing all articles
Browse latest Browse all 5938

Cannot turn off construction grid or axes in Rhino8

$
0
0

In Rhino 7 I was successfully using this C++ code in my DLL to turn off the construction grid and axes (among other things):

// Get list of views in Rhino document.
int32_t num_views = pDoc->GetViewList(view_list, CRhinoView::ViewTypeFilter::Model);
// Removed grid/axes, switch to shaded view, zoom extents and maximize Top viewport.
for (int i = 0; i < num_views; i++) {
	CRhinoView* view = view_list[i]; if (view == nullptr) continue;
	CRhinoViewport& viewport = view->ActiveViewport();
	viewport.SetShowConstructionGrid(false);
	viewport.SetShowConstructionAxes(false);
	viewport.SetShowWorldAxes(false);
	viewport.SetDisplayMode(shaded_attrib->Id());
	// If min/max not available use slower: RhinoDollyExtents(view)
	viewport.DollyExtents(bBox, ON::world_cs);
	// If Top view, maximize it. This will also make it the active view.
	const ON_Viewport vp = viewport.VP(); ON_3dVector dir = vp.CameraDirection();
	// Top view has parallel projection and the camera direction is down.
	if (vp.IsParallelProjection() && dir.x == 0.0 && dir.y == 0.0 && dir.z < 0.0) {
		if (!view->IsMaximized()) view->MaximizeRestoreView();
	}
}

This has stopped working and I end up with them both still displayed:


i notice this issue was raised back in Nov. Has it been fixed and I need to use different code.

Regards,
Terry.

1 post - 1 participant

Read full topic


Viewing all articles
Browse latest Browse all 5938

Trending Articles