Difference between DrawControlPolygonLine and DrawPolyline?


I’m using these when drawing a custom grips object, like @dale’s rectangle grips.

I found that DrawControlPolygonLine does not alway draw a polyline when it has too many lines, while Display.DrawPolyline always draws it without any problem. What’s the best use for each one?

Many thanks,

Hi Pablo,

GripsDrawEventArgs.DrawControlPolygonLine is a helper function used when drawing grips. The line is drawn with a preset style (e.g. pattern, thickness, etc.) and draws in the foreground. Also, GripsDrawEventArgs.DrawControlPolygonLine does not draw polylines - it draws line segments. If you have a polyline, you need to loop through its vertices and draw them one by one.

Display.DrawPolyline is a general purpose polyline drawing method you might use in a dynamic drawing situation (e.g. GetPoint) or in a conduit.

GripsDrawEventArgs.DrawControlPolygonLine eventually calls the same underlying function as Display.DrawPolyline.

Does this help?

– Dale

Got it, thank you!