The following derived Mesh class demonstrates 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);
}
}
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.
@ 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.Â
Â
Regards
Â
Â
thanks a lot for the answers :-D
Please sign in to leave a comment.