Beispiel #1
0
 def load_dxf_attribs(self,
                      processor: SubclassProcessor = None
                      ) -> 'DXFNamespace':
     dxf = super().load_dxf_attribs(processor)
     if processor:
         processor.fast_load_dxfattribs(dxf, acdb_blockrec_group_codes, 2)
     return dxf
Beispiel #2
0
 def load_dxf_attribs(self, processor: SubclassProcessor = None) -> 'DXFNamespace':
     dxf = super().load_dxf_attribs(processor)
     if processor:
         tags = processor.load_dxfattribs_into_namespace(dxf, acdb_blockrec)
         if len(tags) and False:  # deliberately disabled
             processor.log_unprocessed_tags(tags, subclass=acdb_blockrec.name)
     return dxf
Beispiel #3
0
 def load_dxf_attribs(
     self, processor: SubclassProcessor = None
 ) -> "DXFNamespace":
     dxf = super().load_dxf_attribs(processor)
     if processor:
         processor.simple_dxfattribs_loader(dxf, acdb_view_group_codes)  # type: ignore
     return dxf
Beispiel #4
0
 def load_dxf_attribs(
         self, processor: SubclassProcessor = None) -> 'DXFNamespace':
     dxf = super().load_dxf_attribs(processor)
     if processor:
         tags = processor.load_dxfattribs_into_namespace(dxf, acdb_ucs)
         if len(tags) and not processor.r12:
             processor.log_unprocessed_tags(tags, subclass=acdb_ucs.name)
     return dxf
Beispiel #5
0
 def load_dxf_attribs(
     self, processor: SubclassProcessor = None
 ) -> "DXFNamespace":
     dxf = super().load_dxf_attribs(processor)
     if processor:
         processor.simple_dxfattribs_loader(
             dxf, acdb_layer_table_record_group_codes  # type: ignore
         )
     return dxf
Beispiel #6
0
 def load_dxf_attribs(
     self, processor: SubclassProcessor = None
 ) -> "DXFNamespace":
     dxf = super().load_dxf_attribs(processor)
     if processor:
         processor.fast_load_dxfattribs(
             dxf, acdb_vport_group_codes, subclass=2
         )
     return dxf
Beispiel #7
0
 def load_dxf_attribs(self,
                      processor: SubclassProcessor = None) -> 'DXFNamespace':
     dxf = super().load_dxf_attribs(processor)
     if processor:
         tags = processor.load_dxfattribs_into_namespace(dxf, acdb_linetype)
         self.pattern_tags = LinetypePattern(tags)
     return dxf
Beispiel #8
0
 def load_dxf_attribs(
     self, processor: SubclassProcessor = None
 ) -> "DXFNamespace":
     dxf = super().load_dxf_attribs(processor)
     if processor:
         tags = processor.fast_load_dxfattribs(
             dxf, acdb_linetype_group_codes, 2, log=False
         )
         self.pattern_tags = LinetypePattern(tags)
     return dxf
Beispiel #9
0
def test_load_doublettes():
    from ezdxf.lldxf.attributes import DefSubclass, DXFAttr
    from ezdxf.lldxf.tags import Tags, DXFTag
    subclass = DefSubclass('AcDbTest', {
        'test1': DXFAttr(1),
        'test2': DXFAttr(2),
        'test3': DXFAttr(1),  # same group code for different attribute
    })

    class TestEntity(DXFEntity):
        DXFATTRIBS = DXFAttributes(subclass)

    data = Tags([
        DXFTag(1, '1'),
        DXFTag(2, '2'),
        DXFTag(1, '3'),
    ])
    ns = DXFNamespace(entity=TestEntity())
    SubclassProcessor.load_tags_into_namespace(ns, data, subclass)
    assert ns.test1 == '1'
    assert ns.test2 == '2'
    assert ns.test3 == '3'
Beispiel #10
0
def processor():
    return SubclassProcessor(ExtendedTags.from_text(TEST_1))
def test_detect_implementation_version_returns_default():
    processor = SubclassProcessor(ExtendedTags.from_text(TEST_1),
                                  dxfversion="AC1015")
    assert (processor.detect_implementation_version(subclass_index=1,
                                                    group_code=90,
                                                    default=2) == 2)
def load_tags_fast(cls, subclass, data):
    ns = DXFNamespace(entity=cls())
    mapping = group_code_mapping(subclass)
    proc = SubclassProcessor(ExtendedTags(tags=data))
    unprocessed_tags = proc.fast_load_dxfattribs(ns, mapping, 0)
    return ns, unprocessed_tags