def _get_arrow_block_name(self, name: str) -> str: handle = self.get_dxf_attrib(name, None) if handle in (None, '0'): # unset handle or handle '0' is default closed filled arrow return ARROWS.closed_filled else: block_name = get_block_name_by_handle(handle, self.drawing) return ARROWS.arrow_name(block_name) # if arrow return standard arrow name else just the block name
def get_arrow_block_name(self, name: str) -> str: handle = self.get_dxf_attrib(name, None) if handle in (None, '0'): # unset handle or handle '0' is default closed filled arrow return ARROWS.closed_filled else: block_name = get_block_name_by_handle(handle, self.doc) # Returns standard arrow name or the user defined block name: return ARROWS.arrow_name(block_name)
def get_arrow_block_name(self, name: str) -> str: assert self.doc is not None, "valid DXF document required" handle = self.get_dxf_attrib(name, None) if handle in (None, "0"): # unset handle or handle '0' is default closed filled arrow return ARROWS.closed_filled else: block_name = get_block_name_by_handle(handle, self.doc) # Returns standard arrow name or the user defined block name: return ARROWS.arrow_name(block_name)
def test_arrow_name(): assert ARROWS.arrow_name("_CLOSEDFILLED") == "" assert ARROWS.arrow_name("") == "" assert ARROWS.arrow_name("_DOTSMALL") == "DOTSMALL" assert ARROWS.arrow_name("_boxBlank") == "BOXBLANK" assert ARROWS.arrow_name("EZ_ARROW") == "EZ_ARROW" assert ARROWS.arrow_name("abcdef") == "abcdef"
def test_arrow_name(): assert ARROWS.arrow_name('_CLOSEDFILLED') == '' assert ARROWS.arrow_name('') == '' assert ARROWS.arrow_name('_DOTSMALL') == 'DOTSMALL' assert ARROWS.arrow_name('_boxBlank') == 'BOXBLANK' assert ARROWS.arrow_name('EZ_ARROW') == 'EZ_ARROW' assert ARROWS.arrow_name('abcdef') == 'abcdef'
def is_special_block(name: str) -> bool: name = name.upper() # Anonymous dimension, groups and table blocks do not have explicit references by INSERT entity if name.startswith('*D') or name.startswith('*A') or name.startswith('*T'): return True # Arrow blocks maybe used in LEADER override without INSERT reference. if ARROWS.is_ezdxf_arrow(name): return True if name.startswith('_'): if ARROWS.is_acad_arrow(ARROWS.arrow_name(name)): return True return False
def is_special_block(name: str) -> bool: name = name.upper() # Anonymous dimension, groups and table blocks do not have explicit # references by an INSERT entity: if is_anonymous_block(name): return True # Arrow blocks maybe used in DIMENSION or LEADER override without an # INSERT reference: if ARROWS.is_ezdxf_arrow(name): return True if name.startswith('_'): if ARROWS.is_acad_arrow(ARROWS.arrow_name(name)): return True return False