Override Object Selection Color


#1

Hi,

is there a way of changing the object selection color in the rhino viewport?

http://developer.rhino3d.com/api/RhinoCommon/html/M_Rhino_Display_DisplayPipeline_DrawMeshWires.htm

I found this, but I would need to know what type of object I am dealing with. Is there a general way to do this and even having several selection colors at the same time?

Thanks for any help.

Christian


(Dale Fugier) #2

Well, there is certainly way in C++. But I’m not seeing a way in .NET, at least an easy way.

Why do you need to do this?


#3

We are writing a Rhino plugin that creates data records in top of each rhino object. Each dataset will have a color code to make it easy to recognize the rhino object. On selection we would like to show the different colors in the viewport, but dont want to touch the layer or object color - just the highlight color.

Could we make a subroutine in C++ that could handle this?

Thanks Dale


(Dale Fugier) #4

Sure. A display conduit implemented something like this should do it:

bool CTestConduit::ExecConduit(CRhinoDisplayPipeline& dp, UINT nChannel, bool&)
{
  if (nChannel == CSupportChannels::SC_DRAWOBJECT )
  {
    const CRhinoPointObject* point_obj = CRhinoPointObject::Cast(m_pChannelAttrs->m_pObject);
    if (point_obj && m_pDisplayAttrs->m_IsHighlighted)
      m_pDisplayAttrs->m_ObjectColor = RGB(255, 105, 180); // hot pink...
  }
  return true;
}

– Dale


#5

Thanks Dale.

Alright. We will try that code.

Thanks
Christian