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 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245
|
.. _layer_table_internals:
LAYER Table
===========
TODO
.. seealso::
- DXF Reference: `TABLES Section`_
- DXF Reference: `LAYER`_ Table
- :class:`~ezdxf.entities.Layer` class
Table Structure DXF R2000+
--------------------------
.. code-block:: none
0 <<< start of table
TABLE
2 <<< name of table "LAYER"
LAYER
5 <<< handle of the TABLE
2
330 <<< owner tag is always "0"
0
100 <<< subclass marker
AcDbSymbolTable
70 <<< count of layers defined in this table, AutoCAD ignores this value
5
0 <<< 1. LAYER table entry
LAYER
... <<< LAYER entity tags
0 <<< 2. LAYER table entry
LAYER
... <<< LAYER entity tags
0 <<< end of TABLE
ENDTAB
Layer Entity Tags DXF R2000+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
There are some quirks:
- the frozen/thawed state is stored in flags (group code 70)
- the locked/unlocked state is stored in flags (group code 70)
- the off state is stored as negative color value (group code 6)
- the layer description is stored in the XDATA section
- the transparency value is stored in the XDATA section
.. code-block:: none
0 <<< LAYER table entry
LAYER
5 <<< handle of LAYER
10
330 <<< owner handle, handle of LAYER table
2
100 <<< subclass marker
AcDbSymbolTableRecord
100 <<< subclass marker
AcDbLayerTableRecord
2 <<< layer name
0 <<< layer "0"
70 <<< flags
0
62 <<< color
7 <<< a negative value switches the layer off
420 <<< optional true color value
0
6 <<< linetype
Continuous
290 <<< optional plot flag
1
370 <<< lineweight
-3
390 <<< handle to plot style
F
347 <<< material handle
47
348 <<< unknown1
0
1001 <<< XDATA section, APPID
AcAecLayerStandard
1000 <<< unknown first value, here an empty string
1000 <<< layer description
This layer has a description
1001 <<< APPID
AcCmTransparency
1071 <<< layer transparency value
0
Layer Viewport Overrides
~~~~~~~~~~~~~~~~~~~~~~~~
Some layer attributes can be overridden individually for any VIEWPORT
entity. This overrides are stored as extension dictionary entries of
the LAYER entity pointing to XRECORD entities in the objects section:
.. code-block:: none
0
LAYER
5
9F
102 <<< APP data, extension dictionary
{ACAD_XDICTIONARY
360 <<< handle to the xdict in the objects section
B3
102
}
330
2
100
AcDbSymbolTableRecord
100
AcDbLayerTableRecord
2
LayerA
...
The extension DICTIONARY entity:
.. code-block:: none
0 <<< entity type
DICTIONARY
5 <<< handle
B3
330 <<< owner handle
9F <<< the layer owns this dictionary
100 <<< subclass marker
AcDbDictionary
280 <<< hard owned flag
1
281 <<< cloning type
1 <<< keep existing
3 <<< transparency override
ADSK_XREC_LAYER_ALPHA_OVR
360 <<< handle to XRECORD
E5
3 <<< color override
ADSK_XREC_LAYER_COLOR_OVR
360 <<< handle to XRECORD
B4
3 <<< linetype override
ADSK_XREC_LAYER_LINETYPE_OVR
360 <<< handle to XRECORD
DD
3 <<< lineweight override
ADSK_XREC_LAYER_LINEWT_OVR
360 <<< handle to XRECORD
E2
Transparency override XRECORD:
.. code-block:: none
0 <<< entity type
XRECORD
5 <<< handle
E5
102 <<< reactors app data
{ACAD_REACTORS
330
B3 <<< extension dictionary
102
}
330 <<< owner tag
B3 <<< extension dictionary
100 <<< subclass marker
AcDbXrecord
280 <<< cloning flag
1 <<< keep existing
102 <<< for each overridden VIEWPORT one entry
{ADSK_LYR_ALPHA_OVERRIDE
335 <<< handle to VIEWPORT
AC
440 <<< transparency override
33554661
102
}
Color override XRECORD:
.. code-block:: none
0
XRECORD
... <<< like transparency XRECORD
102 <<< for each overridden VIEWPORT one entry
{ADSK_LYR_COLOR_OVERRIDE
335 <<< handle to VIEWPORT
AF
420 <<< color override
-1023409925 <<< raw color value
102
}
Linetype override XRECORD:
.. code-block:: none
0
XRECORD
... <<< like transparency XRECORD
102 <<< for each overridden VIEWPORT one entry
{ADSK_LYR_LINETYPE_OVERRIDE
335 <<< handle to VIEWPORT
AC
343 <<< linetype override
DC <<< handle to LINETYPE table entry
102
}
Lineweight override XRECORD:
.. code-block:: none
0
XRECORD
... <<< like transparency XRECORD
102 <<< for each overridden VIEWPORT one entry
{ADSK_LYR_LINEWT_OVERRIDE
335 <<< handle to VIEWPORT
AC
91 <<< lineweight override
13 <<< lineweight value
102
}
Name References
---------------
LAYER table entries are referenced by name:
- all graphical DXF entities
- VIEWPORT entity, frozen layers
- LAYER_FILTER
- LAYER_INDEX
.. _LAYER: https://help.autodesk.com/view/OARX/2018/ENU/?guid=GUID-D94802B0-8BE8-4AC9-8054-17197688AFDB
.. _TABLES Section: http://help.autodesk.com/view/OARX/2018/ENU/?guid=GUID-A9FD9590-C97B-4E41-9F26-BD82C34A4F9F
|