How to use the ezdxf.lldxf.tagwriter.TagCollector function in ezdxf

To help you get started, we’ve selected a few ezdxf examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github mozman / ezdxf / tests / test_02_dxf_graphics / test_233_helix.py View on Github external
def test_write_dxf():
    entity = Helix.from_text(HELIX)
    result = TagCollector.dxftags(entity)
    expected = basic_tags_from_text(HELIX)
    assert result == expected
github mozman / ezdxf / tests / test_01_dxf_entities / test_113_dxfclass.py View on Github external
def test_write_dxf_r12(entity):
    collector = TagCollector(dxfversion=DXF12)
    entity.export_dxf(collector)
    assert len(collector.tags) == 0
github mozman / ezdxf / tests / test_02_dxf_graphics / test_204_shape.py View on Github external
def test_write_dxf(txt, ver):
    expected = basic_tags_from_text(txt)
    shape = TEST_CLASS.from_text(txt)
    collector = TagCollector(dxfversion=ver, optional=True)
    shape.export_dxf(collector)
    assert collector.tags == expected

    collector2 = TagCollector(dxfversion=ver, optional=False)
    shape.export_dxf(collector2)
    assert collector.has_all_tags(collector2)
github mozman / ezdxf / tests / test_02_dxf_graphics / test_235_leader.py View on Github external
def test_write_dxf():
    entity = Leader.from_text(LEADER)
    result = TagCollector.dxftags(entity)
    expected = basic_tags_from_text(LEADER)
    assert result == expected
github mozman / ezdxf / tests / test_02_dxf_graphics / test_238_tolerance.py View on Github external
def test_write_dxf():
    entity = Tolerance.from_text(TOLERANCE)
    result = TagCollector.dxftags(entity)
    expected = basic_tags_from_text(TOLERANCE)
    assert result == expected
github mozman / ezdxf / tests / test_02_dxf_graphics / test_222_xline.py View on Github external
def test_write_dxf():
    entity = XLine.from_text(XLINE)
    result = TagCollector.dxftags(entity)
    expected = basic_tags_from_text(XLINE)
    assert result == expected
github mozman / ezdxf / tests / test_01_dxf_entities / test_110_dxfentity.py View on Github external
def test_write_r12_dxf(entity):
    tagwriter = TagCollector(dxfversion=DXF12)
    entity.export_dxf(tagwriter)
    tag = tagwriter.tags
    assert len(tag) == 2
    assert tag[0] == (0, 'DXFENTITY')
    assert tag[1] == (5, 'FFFF')
github mozman / ezdxf / tests / test_02_dxf_graphics / test_229_hatch_2.py View on Github external
def test_no_fit_points_export(spline_edge_hatch):
    path = spline_edge_hatch.paths[0]
    spline = path.add_spline(control_points=[(1, 1), (2, 2), (3, 3), (4, 4)], degree=3, rational=1, periodic=1)
    spline.knot_values = [1, 2, 3, 4, 5, 6]
    assert [(1, 1), (2, 2), (3, 3), (4, 4)] == spline.control_points
    assert len(spline.fit_points) == 0
    writer = TagCollector(dxfversion=DXF2007)
    spline.export_dxf(writer)
    # do not write length tag 97 if no fit points exists for DXF2007 and prior
    assert any(tag.code == 97 for tag in writer.tags) is False

    writer = TagCollector(dxfversion=DXF2010)
    spline.export_dxf(writer)
    # do write length tag 97 if no fit points exists for DXF2010+
    assert (97, 0) in writer.tags
github mozman / ezdxf / tests / test_02_dxf_graphics / test_223_ray.py View on Github external
def test_write_dxf():
    entity = Ray.from_text(RAY)
    result = TagCollector.dxftags(entity)
    expected = basic_tags_from_text(RAY)
    assert result == expected
github mozman / ezdxf / tests / test_02_dxf_graphics / test_202_circle.py View on Github external
def test_write_dxf(txt, ver):
    expected = basic_tags_from_text(txt)
    circle = TEST_CLASS.from_text(txt)
    collector = TagCollector(dxfversion=ver, optional=True)
    circle.export_dxf(collector)
    assert collector.tags == expected

    collector2 = TagCollector(dxfversion=ver, optional=False)
    circle.export_dxf(collector2)
    assert collector.has_all_tags(collector2)