Click or drag to resize

DXFReaderNETControlDrawEntities Method

Draws a collection of entities to the control using a specified pen.

Namespace:  DXFReaderNET
Assembly:  DXFReaderNET (in DXFReaderNET.dll) Version: 20.12.2
Syntax
public void DrawEntities(
	Pen Pen,
	List<EntityObject> Entities,
	bool Store = false
)

Parameters

Pen
Type: System.DrawingPen
The pen to use for drawing all entities (defines color, width, and style).
Entities
Type: System.Collections.GenericListEntityObject
The collection of entities to draw.
Store (Optional)
Type: SystemBoolean
If true, stores the drawn elements in internal lists for later redrawing or manipulation. If false, draws transiently (useful for temporary visualizations like rubber band operations).
Remarks
This method provides a way to draw multiple entities with consistent styling in a single call without modifying the drawing database. It's commonly used for: - Previewing entity collections before adding to the drawing - Temporary visualization during interactive operations - Highlighting or emphasizing specific entity groups - Custom rendering with pen styles that differ from entity properties When Store=true, the drawn elements can be cleared later using ClearDrawnElements(). When Store=false, elements are cleared on the next control refresh/repaint. Note: This method uses the pen's properties regardless of the entities' own color/linetype settings.
Examples
// Draw a collection of lines in red with 2-pixel width
using (Pen redPen = new Pen(Color.Red, 2))
{
    List<EntityObject> entities = dxfControl.GetEntities(startPoint, endPoint);
    dxfControl.DrawEntities(redPen, entities, false); // Temporary preview
}

// Draw and store entities for persistent display
using (Pen bluePen = new Pen(Color.Blue, 1))
{
    dxfControl.DrawEntities(bluePen, selectedEntities, true);
}
See Also