i want to get the element’s render mode in each view port, how can i get it?
i know the ON_3dmObjectAttributes class has “m_mode” member, but it always the same value.
how can i get it?
Hi @Jiang1,
Does this help?
/// <summary>
/// Returns the id of the display mode used by a Rhino object.
/// Object display modes are view based. Thus, it is possible to have an
/// object display different in different views.
/// </summary>
/// <param name="pObject">The Rhino object.</param>
/// <param name="pView">The Rhino viewport.</param>
/// <returns>The id of the display mode is successful.</returns>
ON_UUID RhinoGetObjectDisplayMode(const CRhinoObject* pObject, const CRhinoView* pView)
{
ON_UUID rc = ON_nil_uuid;
if (pObject && pView)
{
ON_UUID dmr_id;
if (pObject->Attributes().FindDisplayMaterialId(pView->ActiveViewportID(), &dmr_id))
{
rc = dmr_id;
}
}
return rc;
}
– Dale