File: simple_drawings.rst

package info (click to toggle)
ezdxf 0.18.1-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 46,952 kB
  • sloc: python: 158,141; javascript: 166; cpp: 138; makefile: 116; lisp: 20
file content (37 lines) | stat: -rw-r--r-- 1,022 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
.. _tut_simple_drawings:

Tutorial for creating simple DXF drawings
=========================================

:ref:`r12writer` - create simple DXF R12 drawings with a restricted entities
set: LINE, CIRCLE, ARC, TEXT, POINT, SOLID, 3DFACE and POLYLINE.
Advantage of the *r12writer* is the speed and the low memory footprint, all
entities are written direct to the file/stream without building a drawing data
structure in memory.

.. seealso::

    :ref:`r12writer`

Create a new DXF drawing with :func:`ezdxf.new` to use all available DXF
entities:

.. code-block:: Python

    import ezdxf

    # Create a new DXF R2010 drawing, official DXF version name: "AC1024"
    doc = ezdxf.new('R2010')

    # Add new entities to the modelspace:
    msp = doc.modelspace()
    # Add a LINE entity
    msp.add_line((0, 0), (10, 0))
    doc.saveas('line.dxf')

New entities are always added to layouts, a layout can be the model space, a
paper space layout or a block layout.

.. seealso::

    :ref:`thematic_factory_method_index`