From cc40e6ded1e1e9ed2f019efc9e785ff0943ff785 Mon Sep 17 00:00:00 2001 From: mistangl Date: Mon, 19 May 2025 10:04:25 +0200 Subject: [PATCH] =?UTF-8?q?Pr=C3=BCfung=20f=C3=BCr=20Angabe=20eines=20Pfad?= =?UTF-8?q?es=20ausserhalb=20des=20Work=20Folders=20dazu?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/getpositions.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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()