File: test_407_entity_section.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 (20 lines) | stat: -rw-r--r-- 828 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
# Copyright (c) 2011-2019, Manfred Moitzi
# License: MIT License
#
# The entities section is a virtual construct while working on a document.
# In reality it is a section in the DXF file containing the entities of the modelspace and the active paperspace, other
# layouts are stored in the associated BLOCK in the blocks section. I assume this is just a legacy detail, which could
# easily removed by storing all layouts including the modelspace in the block sections.
#
# In later ezdxf versions the EntitiesSection object has only the task to load and store the entities of the DXF section
# ENTITIES.
#
import ezdxf


def test_iterate_entities_section():
    doc = ezdxf.new()
    m = doc.modelspace()
    m.add_line((0, 0), (1, 1))
    entity = list(doc.entities)[-1]
    assert doc == entity.doc  # check drawing attribute