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 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99
|
Block
=====
.. module:: ezdxf.entities
:noindex:
BLOCK (`DXF Reference`_) entity is embedded into the :class:`~ezdxf.layouts.BlockLayout` object.
The BLOCK entity is accessible by the :attr:`BlockLayout.block` attribute.
======================== ==========================================
Subclass of :class:`ezdxf.entities.DXFEntity`
DXF type ``'BLOCK'``
Factory function :meth:`Drawing.blocks.new` (returns a :class:`~ezdxf.layouts.BlockLayout`)
======================== ==========================================
.. seealso::
:ref:`tut_blocks` and DXF Internals: :ref:`Block Management Structures`
.. class:: Block
.. attribute:: dxf.handle
BLOCK handle as plain hex string. (feature for experts)
.. attribute:: dxf.owner
Handle to owner as plain hex string. (feature for experts)
.. attribute:: dxf.layer
Layer name as string; default value is ``'0'``
.. attribute:: dxf.name
BLOCK name as string. (case insensitive)
.. attribute:: dxf.base_point
BLOCK base point as ``(x, y, z)`` tuple, default value is ``(0, 0, 0)``
Insertion location referenced by the :class:`~ezdxf.entities.Insert` entity to place the block reference
and also the center of rotation and scaling.
.. attribute:: dxf.flags
BLOCK flags (bit-coded)
==== ===========
1 Anonymous block generated by hatching, associative dimensioning, other internal operations, or an application
2 Block has non-constant attribute definitions (this bit is not set if the block has any attribute
definitions that are constant, or has no attribute definitions at all)
4 Block is an external reference (xref)
8 Block is an xref overlay
16 Block is externally dependent
32 This is a resolved external reference, or dependent of an external reference (ignored on input)
64 This definition is a referenced external reference (ignored on input)
==== ===========
.. attribute:: dxf.xref_path
File system path as string, if this block defines an external reference (XREF).
.. autoattribute:: is_layout_block
.. autoattribute:: is_anonymous
.. autoattribute:: is_xref
.. autoattribute:: is_xref_overlay
EndBlk
======
ENDBLK entity is embedded into the :class:`~ezdxf.layouts.BlockLayout` object.
The ENDBLK entity is accessible by the :attr:`BlockLayout.endblk` attribute.
======================== ==========================================
Subclass of :class:`ezdxf.entities.DXFEntity`
DXF type ``'ENDBLK'``
======================== ==========================================
.. class:: EndBlk
.. attribute:: dxf.handle
BLOCK handle as plain hex string. (feature for experts)
.. attribute:: dxf.owner
Handle to owner as plain hex string. (feature for experts)
.. attribute:: dxf.layer
Layer name as string; should always be the same as :attr:`Block.dxf.layer`
.. _DXF Reference: http://help.autodesk.com/view/OARX/2018/ENU/?guid=GUID-66D32572-005A-4E23-8B8B-8726E8C14302
|