Changing edge color for a single entity

The following derived Mesh class demonstrate how to change edge color for a single entity.

class MyMesh : Mesh
{
    public Color EdgeColor = Color.Empty;

    public MyMesh(Mesh another, Color edgeColor) : base(another)
    {
        EdgeColor = edgeColor;
    }

    protected override void DrawEdges(DrawParams data)
    {
        data.RenderContext.SetColorWireframe(EdgeColor);
        base.DrawEdges(data);
    }
}
Was this article helpful?
3 out of 3 found this helpful
Have more questions? Submit a request

Comments

3 comments
  • Excellent 👍

  • Hi Alberto, 

    that was very useful for changing the edge colors of a single entity. 

    I have a question: 

    How do we change a single Edge's color in the entity?

    I imagined something like following but does not work:

    Brep workEntity = (Brep)viewportLayout1.Entities[5];
    workEntity.Edges[2].Color?

    workEntity.Edges[2].Curve.Color?

     

    Thanks

     

    Ceyhun Sözbir

  • This is not possible, sorry.

Please sign in to leave a comment.