File: read_acad_table.py

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 (22 lines) | stat: -rw-r--r-- 559 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
# Copyright (c) 2024, Manfred Moitzi
# License: MIT License
from pathlib import Path
import ezdxf

from ezdxf.entities import DXFTagStorage
from ezdxf.entities.acad_table import read_acad_table_content

CWD = Path(__file__).parent.parent.parent / "examples_dxf"


def main() -> None:
    doc = ezdxf.readfile(CWD / "acad_table_with_blk_ref.dxf")
    msp = doc.modelspace()
    table: DXFTagStorage = msp.query("ACAD_TABLE").first
    values = read_acad_table_content(table)
    print("Table Values:")
    print(values)


if __name__ == "__main__":
    main()