Plugin set an individual object to wireframe

Is it possible for a plugin to set a rhino object to be wireframe while other objects remain shaded?

I’m using C++ SDK

I don’t know C++ but can you access SetObjectDisplayMode Rhino command.

SetObjectDisplayMode is what users use for this feature in Rhino.

In C++ you would get a CRhinoObject and a CRhinoViewport. For the CRhinoObject you would add aan ON_DisplayMaterialRef to the object’s attributes with a given viewport Id and the id given by

CRhinoObject* pObject = ... CRhinoObject you got from somewhere...
CRhinoView* pView = RhinoApp().AcitveView();
if( pView )
  ON_DisplayMaterialRef dmr;
  dmr.m_viewport_id = pView->Viewport().ViewportId();
  dmr.m_display_material_id = CRhinoDisplayAttrsMgr::WireFrameModeId();
  CRhinoObjectAttributes oa = pObject->Attributes();

Thanks Steve! Also Michael.

Edit: unfortunately I can’t modify the object since CRhinoGetObject returns a const reference. I’m guessing I have to create a new one or something?

What I’m really after is the ability to convert an input mesh/polyline to a display mode of something like this:

Just use ModifyObjectAttributes on the CRhinoDoc then.

Thanks! This forum has been infinitely more helpful than most dev forums I’ve posted to.