Skip to content

Commit 76809d7

Browse files
committed
refactor usage for beginners
1 parent 240254a commit 76809d7

File tree

1 file changed

+62
-54
lines changed

1 file changed

+62
-54
lines changed

docs/source/usage_for_beginners.rst

Lines changed: 62 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -41,45 +41,6 @@ module.
4141
management go to the :ref:`dwgmanagement` section. For loading DXF documents
4242
with structural errors look at the :mod:`ezdxf.recover` module.
4343

44-
Saving DXF Files
45-
----------------
46-
47-
Save the DXF document with a new name::
48-
49-
doc.saveas("new_name.dxf")
50-
51-
or with the same name as loaded::
52-
53-
doc.save()
54-
55-
.. seealso::
56-
57-
Documentation for :func:`ezdxf.document.Drawing.save` and
58-
:func:`ezdxf.document.Drawing.saveas`, for more information about file
59-
management go to the :ref:`dwgmanagement` section.
60-
61-
Create a New DXF File
62-
---------------------
63-
64-
Create new document for the latest supported DXF version::
65-
66-
doc = ezdxf.new()
67-
68-
Create a new DXF document for a specific DXF version, e.g. for DXF R12::
69-
70-
doc = ezdxf.new("R12")
71-
72-
73-
The :func:`ezdxf.new` function can create some standard resources, such as
74-
linetypes and text styles, by setting the argument `setup` to ``True``::
75-
76-
doc = ezdxf.new(setup=True)
77-
78-
.. seealso::
79-
80-
Documentation for :func:`ezdxf.new`, for more information about file
81-
management go to the :ref:`dwgmanagement` section.
82-
8344
Layouts and Blocks
8445
------------------
8546

@@ -117,18 +78,6 @@ All these layouts have factory functions to create graphical DXF entities for
11778
their entity space, for more information about creating entities see section:
11879
`Create new DXF Entities`_
11980

120-
Create New Blocks
121-
-----------------
122-
123-
The block definitions of a DXF document are managed by the
124-
:class:`~ezdxf.sections.blocks.BlocksSection` object::
125-
126-
my_block = doc.blocks.new("MyBlock")
127-
128-
.. seealso::
129-
130-
:ref:`tut_blocks`
131-
13281
Query DXF Entities
13382
------------------
13483

@@ -194,6 +143,28 @@ or use the :meth:`get` method and provide a default value::
194143
- Helper class :class:`ezdxf.gfxattribs.GfxAttribs` for building DXF attribute
195144
dictionaries.
196145

146+
Create a New DXF File
147+
---------------------
148+
149+
Create new document for the latest supported DXF version::
150+
151+
doc = ezdxf.new()
152+
153+
Create a new DXF document for a specific DXF version, e.g. for DXF R12::
154+
155+
doc = ezdxf.new("R12")
156+
157+
158+
The :func:`ezdxf.new` function can create some standard resources, such as
159+
linetypes and text styles, by setting the argument `setup` to ``True``::
160+
161+
doc = ezdxf.new(setup=True)
162+
163+
.. seealso::
164+
165+
- :ref:`tut_simple_drawings`
166+
- Documentation for :func:`ezdxf.new`, for more information about file
167+
management go to the :ref:`dwgmanagement` section.
197168

198169
Create New DXF Entities
199170
-----------------------
@@ -211,9 +182,6 @@ The usage is simple::
211182
msp = doc.modelspace()
212183
msp.add_line((0, 0), (1, 0), dxfattribs={"layer": "MyLayer"})
213184

214-
.. seealso::
215-
216-
:ref:`thematic_factory_method_index`
217185

218186
A few important/required DXF attributes are explicit method arguments,
219187
most additional DXF attributes are gives as a regular Python
@@ -227,6 +195,46 @@ The supported DXF attributes can be found in the documentation of the
227195
use the provided factory methods to create new graphical entities, this is
228196
the intended way to use `ezdxf`.
229197

198+
.. seealso::
199+
200+
- :ref:`thematic_factory_method_index`
201+
- :ref:`tut_simple_drawings`
202+
- :ref:`tut_dxf_primitives`
203+
- :ref:`tut_lwpolyline`
204+
- :ref:`tut_text`
205+
- :ref:`tut_mtext`
206+
- :ref:`tut_hatch`
207+
208+
Saving DXF Files
209+
----------------
210+
211+
Save the DXF document with a new name::
212+
213+
doc.saveas("new_name.dxf")
214+
215+
or with the same name as loaded::
216+
217+
doc.save()
218+
219+
.. seealso::
220+
221+
Documentation for :func:`ezdxf.document.Drawing.save` and
222+
:func:`ezdxf.document.Drawing.saveas`, for more information about file
223+
management go to the :ref:`dwgmanagement` section.
224+
225+
Create New Blocks
226+
-----------------
227+
228+
The block definitions of a DXF document are managed by the
229+
:class:`~ezdxf.sections.blocks.BlocksSection` object::
230+
231+
my_block = doc.blocks.new("MyBlock")
232+
233+
.. seealso::
234+
235+
:ref:`tut_blocks`
236+
237+
230238
Create Block References
231239
-----------------------
232240

0 commit comments

Comments
 (0)