Table of Contents
Ghosting Viewports
C++
Summary: Demonstrates how to set a viewport to ghosted display using the Rhino SDK.
Question
I would like to set the active viewport to ghosted display from a plug-in command. How is this accomplished?
Answer
The following example code demonstrates how to ghost a viewport using the Rhino SDK.
C++
CRhinoCommand::result CCommandTest::RunCommand( const CRhinoCommandContext& context ) { CRhinoView* view = RhinoApp().ActiveView(); if( 0 == view ) return CRhinoCommand::failure; CRhinoViewport& vp = view->ActiveViewport(); const CDisplayPipelineAttributes* pStdAttrs = CRhinoDisplayAttrsMgr::StdGhostedAttrs(); if( pStdAttrs ) { vp.SetDisplayMode( pStdAttrs->Id() ); view->Redraw(); } return CRhinoCommand::success; }