Example #1
0
def test_import_polyline():
    source = ezdxf.new()
    source.modelspace().add_polyline3d([(0, 0), (3, 0), (3, 3), (0, 3)])
    target = ezdxf.new()
    importer = Importer(source, target)
    importer.import_modelspace()
    tpoly = target.modelspace()[0]
    assert len(tpoly.vertices) == 4
    assert tpoly.seqend is not None
    assert tpoly.seqend.dxf.layer == tpoly.dxf.layer
Example #2
0
def test_import_insert_with_attribs():
    source = ezdxf.new()
    source.blocks.new('Test')
    sinsert = source.modelspace().add_blockref('Test', insert=(0, 0))
    sinsert.add_attrib('A1', 'text1')
    sinsert.add_attrib('A2', 'text2')
    target = ezdxf.new()
    importer = Importer(source, target)
    importer.import_modelspace()
    tinsert = target.modelspace()[0]
    assert len(tinsert.attribs) == 2
    assert tinsert.seqend is not None
    assert tinsert.seqend.dxf.layer == tinsert.dxf.layer
Example #3
0
def test_import_insert_with_attribs():
    source = ezdxf.new()
    source.blocks.new("Test")
    sinsert = source.modelspace().add_blockref("Test", insert=(0, 0))
    sinsert.add_attrib("A1", "text1")
    sinsert.add_attrib("A2", "text2")
    target = ezdxf.new()
    importer = Importer(source, target)
    importer.import_modelspace()
    tinsert = target.modelspace()[0]
    assert len(tinsert.attribs) == 2
    assert tinsert.seqend is not None
    assert tinsert.seqend.dxf.layer == tinsert.dxf.layer