Prüfung für Angabe eines Pfades ausserhalb des Work Folders dazu
This commit is contained in:
+4
-1
@@ -124,7 +124,7 @@ def get_subdistributor_positions(msp):
|
|||||||
# Alle Texte auf Layer "xy"
|
# Alle Texte auf Layer "xy"
|
||||||
for text in msp.query('MTEXT[layer=="Busverteiler-Kennzeichnung"]'):
|
for text in msp.query('MTEXT[layer=="Busverteiler-Kennzeichnung"]'):
|
||||||
print(f"Text auf Layer 'Busverteiler-Kennzeichnung': {text.dxf.text}")
|
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:
|
if match:
|
||||||
nameUC = match.group(0)
|
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
|
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
|
raise FileExistsError
|
||||||
else:
|
else:
|
||||||
dxf_path = filename
|
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
|
doc = get_dxf_file(dxf_path) # type: ignore
|
||||||
msp = doc.modelspace()
|
msp = doc.modelspace()
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user