Exemplo n.º 1
0
 def export_base_class(self, tagwriter: 'TagWriter') -> None:
     """ Export base class DXF attributes and structures. (internal API) """
     # 1. tag: (0, DXFTYPE)
     tagwriter.write_tag2(STRUCTURE_MARKER, self.DXFTYPE)
     if tagwriter.dxfversion >= DXF2000:
         tagwriter.write_tag2(handle_code(self.dxf.dxftype), self.dxf.handle)
         if self.appdata:
             self.appdata.export_dxf(tagwriter)
         if self.extension_dict:
             self.extension_dict.export_dxf(tagwriter)
         if self.reactors:
             self.reactors.export_dxf(tagwriter)
         tagwriter.write_tag2(OWNER_CODE, self.dxf.owner)
     else:  # DXF R12
         if tagwriter.write_handles:
             tagwriter.write_tag2(handle_code(self.dxf.dxftype), self.dxf.handle)
Exemplo n.º 2
0
 def __init__(self, processor: 'SubclassProcessor' = None, entity: 'DXFEntity' = None):
     if processor:
         base_class_ = processor.base_class
         code = handle_code(base_class_[0].value)
         # CLASS entity has no handle and TABLE also has no handle if loaded from DXF R12 file
         handle = base_class_.get_first_value(code, None)
         # owner is None if loaded from DXF R12 file
         owner = base_class_.get_first_value(330, None)
         self.rewire(entity, handle, owner)
     else:
         self.reset_handles()
         self.rewire(entity)