コード例 #1
0
ファイル: browser.py プロジェクト: Rahulghuge94/ezdxf
 def show_entity_found_message(self, entity: Tags, index: int):
     dxftype = entity.dxftype()
     if dxftype == "SECTION":
         tail = " @ {0} Section".format(
             entity.get_first_value(2))  # type: ignore
     else:
         try:
             handle = entity.get_handle()
             tail = f" @ {dxftype}(#{handle})"
         except ValueError:
             tail = ""
     line = self.doc.get_line_number(entity, index)
     self.show_message(f"Found in Line: {line}{tail}")
コード例 #2
0
ファイル: dxfpp.py プロジェクト: Rahulghuge94/ezdxf
 def entity2html(
     self, tags: Tags, create_ref_links=False, show_ref_status=False
 ):
     """DXF entity as <div> container."""
     tags = Tags(tags)
     name = tags.dxftype()
     if create_ref_links:  # use entity name as link to the DXF reference
         name = build_ref_link_button(name)
     refs = ""
     if show_ref_status:
         try:
             handle = tags.get_handle()
         except DXFValueError:
             pass
         else:
             if handle not in self.pointers:
                 refs = '<div class="ref-no">[unreferenced]</div>'
             else:
                 refs = self.pointers2html(self.pointers[handle])
     return ENTITY_TPL.format(
         name=name, tags=self.tags2html(tags), references=refs
     )