Table Classes¶
Generic Table Class¶
-
class
ezdxf.sections.table.
Table
¶ Generic collection of table entries. Table entry names are case insensitive:
'Test' == 'TEST'
.-
static
key
(entity: Union[str, DXFEntity]) → str¶ Unified table entry key.
-
has_entry
(name: Union[str, DXFEntity]) → bool¶ Returns
True
if an table entry name exist.
-
__contains__
(name: Union[str, DXFEntity]) → bool¶ Returns
True
if an table entry name exist.
-
__len__
() → int¶ Count of table entries.
-
__iter__
() → Iterable[DXFEntity]¶ Iterable of all table entries.
-
new
(name: str, dxfattribs: dict = None) → DXFEntity¶ Create a new table entry name.
- Parameters
name – name of table entry, case insensitive
dxfattribs – additional DXF attributes for table entry
-
get
(name: str) → DXFEntity¶ Get table entry name (case insensitive). Raises
DXFValueError
if table entry does not exist.
-
remove
(name: str) → None¶ Removes table entry name. Raises
DXFValueError
if table-entry does not exist.
-
duplicate_entry
(name: str, new_name: str) → DXFEntity¶ Returns a new table entry new_name as copy of name, replaces entry new_name if already exist.
- Raises
DXFValueError – name does not exist
-
static
Style Table¶
-
class
ezdxf.sections.table.
StyleTable
¶ Subclass of
Table
.Collection of
Textstyle
objects.-
get_shx
(shxname: str) → Textstyle¶ Get existing shx entry, or create a new entry.
- Parameters
shxname – shape file name like ‘ltypeshp.lin’
-
find_shx
(shxname: str) → Optional[Textstyle]¶ Find .shx shape file table entry, by a case insensitive search.
A .shx shape file table entry has no name, so you have to search by the font attribute.
- Parameters
shxname – .shx shape file name
-
Viewport Table¶
-
class
ezdxf.sections.table.
ViewportTable
¶ The viewport table stores the modelspace viewport configurations. A viewport configuration is a tiled view of multiple viewports or just one viewport. In contrast to other tables the viewport table can have multiple entries with the same name, because all viewport entries of a multi-viewport configuration are having the same name - the viewport configuration name.
The name of the actual displayed viewport configuration is
'*ACTIVE'
.Duplication of table entries is not supported:
duplicate_entry()
raisesNotImplementedError