# Tutorial for Simple DXF Entities¶

These are basic graphical entities located in an entity space like the modelspace or a block definition and only support the common graphical attributes.

The entities in the following examples are always placed in the xy-plane of the WCS aka the 2D drawing space. Some of these entities can only be placed outside the xy-plane in 3D space by utilizing the OCS, but this feature is beyond the scope of this tutorial, for more information about that go to: Tutorial for OCS/UCS Usage.

Prelude to all following examples:

import ezdxf
from ezdxf.gfxattribs import GfxAttribs

doc = ezdxf.new()
doc.layers.new("ENTITY", color=1)
msp = doc.modelspace()
attribs = GfxAttribs(layer="ENTITY")

## Point¶

The Point entity marks a 3D point in the WCS:

## Line¶

The Line entity is a 3D line with a start- and an end point in the WCS:

line = msp.add_line((0, 0), (10, 10), dxfattribs=attribs)

## Circle¶

The Circle entity is an OCS entity defined by a center point and a radius:

## Arc¶

The Arc entity is an OCS entity defined by a center point, a radius a start- and an end angle in degrees:

The arc goes always in counter-clockwise orientation around the z-axis more precisely the extrusion vector of OCS, but this is beyond the scope of this tutorial.

The helper class ezdxf.math.ConstructionArc provides constructors to create arcs from different scenarios:

This example creates an arc from point (10, 0) to point (0, 0) passing the point (5, 3):

from ezdxf.math import ConstructionArc

# -x-x-x- snip -x-x-x-

arc = ConstructionArc.from_3p(
start_point=(10, 0), end_point=(0, 0), def_point=(5, 3)
)

## Ellipse¶

The Ellipse entity requires DXF R2000 or newer and is a true WCS entity. The ellipse is defined by a center point, a vector for the major axis, the ratio between major- and minor axis and the start- and end parameter in radians: