File: r12strict.rst

package info (click to toggle)
ezdxf 1.4.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 104,528 kB
  • sloc: python: 182,341; makefile: 116; lisp: 20; ansic: 4
file content (63 lines) | stat: -rw-r--r-- 1,600 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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
.. _r12strict:

.. module:: ezdxf.r12strict

r12strict
=========

.. versionadded:: 1.1

Due to ACAD release 14 the resource names, such as layer-, linetype, text style-,
dimstyle- and block names, were limited to 31 characters in length and all names were
uppercase.

Names can include the letters A to Z, the numerals 0 to 9, and the special characters,
dollar sign ``"$"``, underscore ``"_"``, hyphen ``"-"`` and the asterix ``"*"`` as
first character for special names like anonymous blocks.
Most applications do not care about that and work fine with longer names and any
characters used in names for some exceptions, but of course Autodesk applications are
very picky about that.

The function :func:`make_acad_compatible` makes DXF R12 drawings to 100% compatible to
Autodesk products and does everything at once, but the different processing steps can
be called manually.

.. important::

    This module can only process DXF R12 file and will throw a :class:`DXFVersionError`
    otherwise. For exporting any DXF document as DXF R12 use the
    :mod:`ezdxf.addons.r12export` add-on.

Usage
-----

.. code-block:: Python

    import ezdxf
    from ezdxf import r12strict

    doc = ezdxf.readfile("r12sloppy.dxf")
    r12strict.make_acad_compatible(doc)
    doc.saveas("r12strict.dxf")

Functions
---------

.. autosummary::
    :nosignatures:

    make_acad_compatible
    translate_names
    clean

.. autofunction:: make_acad_compatible

.. autofunction:: translate_names

.. autofunction:: clean

.. autoclass:: R12NameTranslator

    .. automethod:: reset

    .. automethod:: translate