File: blkrefs.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 (54 lines) | stat: -rw-r--r-- 1,681 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

.. module:: ezdxf.blkrefs

Block Reference Management
==========================

The package `ezdxf` is not designed as a CAD library and does not automatically
monitor all internal changes. This enables faster entity processing at the cost
of an unknown state of the DXF document.

In order to carry out precise BLOCK reference management, i.e. to handle
dependencies or to delete unused BLOCK definition, the block reference status
(counter) must be acquired explicitly by the package user.
All block reference management structures must be explicitly recreated each time
the document content is changed. This is not very efficient, but it is safe.

.. warning::

    The DXF reference does not document all uses of blocks. The INSERT entity is
    just one explicit use case, but there are also many indirect block references
    and the customizability of DXF allows you to store block names and handles in
    many places.

    There are some rules for storing names and handles and this module checks all of
    these known rules, but there is no guarantee that everyone follows these rules.

    Therefore, it is still possible to destroy a DXF document by deleting an
    absolutely necessary block definition.

Always remember that `ezdxf` is not intended or suitable as a basis for a CAD
application!


.. autoclass:: BlockDefinitionIndex

    .. autoproperty:: block_records

    .. automethod:: rebuild

    .. automethod:: has_handle

    .. automethod:: by_handle

    .. automethod:: has_name

    .. automethod:: by_name

.. autoclass:: BlockReferenceCounter

    .. automethod:: by_handle

    .. automethod:: by_name

.. autofunction:: find_unreferenced_blocks