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)
Was this article helpful?
3 out of 3 found this helpful
Have more questions? Submit a request


  • 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];





    Ceyhun Sözbir

  • This is not possible, sorry.

  • @ Ceyhun S√∂zbir

    I have the same Problem.


    You can do it on your own. I do it as follw:


    in the Model1SelectedChange when i Click a SelectedEdge, i take a look what kind of Curve i have in this Edge ( Line, Arc, Circle, ................. or a complex ICurve )

    Then for Example: Line ==> Read the property and make your own Line. Set your Line.ColorMethod, Line.Color, Line.LineWeightMethod and Line.LineWeight.

    Then add it to the TempEntityCollection.


    In older Versions add it directly to the Modell.

    To sepparate them you can use CustomData for this Entities or you can write some String in Line.EntityData to sepparate them. 

    I use a casted (DirectCast) temporery List of Entity. 





  • Very Good!
    TempEntityCollection  is very good idea in version 12 
  • thanks a lot for the answers :-D

Please sign in to leave a comment.