diff --git a/lib/getpositions.py b/lib/getpositions.py index b58af3a..1c5c50d 100644 --- a/lib/getpositions.py +++ b/lib/getpositions.py @@ -124,7 +124,7 @@ def get_subdistributor_positions(msp): # Alle Texte auf Layer "xy" for text in msp.query('MTEXT[layer=="Busverteiler-Kennzeichnung"]'): print(f"Text auf Layer 'Busverteiler-Kennzeichnung': {text.dxf.text}") - match = re.search(r"UC\w+", text.dxf.text) + match = re.search(r"=A\d\++\w+-\w\+", text.dxf.text) if match: nameUC = match.group(0) ret[nameUC] = (round(text.dxf.insert[0],1), round(text.dxf.insert[1],1)) #nur x und y Koordinate in Json schreiben @@ -208,6 +208,9 @@ if __name__ == '__main__': raise FileExistsError else: dxf_path = filename + if not os.path.exists(dxf_path): + print(f'no such file {dxf_path}') + raise FileExistsError doc = get_dxf_file(dxf_path) # type: ignore msp = doc.modelspace()