Prüfung für Angabe eines Pfades ausserhalb des Work Folders dazu

This commit is contained in:
2025-05-19 10:04:25 +02:00
parent e567c7f552
commit cc40e6ded1
+4 -1
View File
@@ -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()