Start der neuen Methodik zur automatischen Extraktion von Bezeichnern zu Teilenummern. Neue COnfig, schalter in drawdxf, neues Skript zum updaten

This commit is contained in:
2025-06-18 16:22:42 +02:00
parent dc1b5387a8
commit 8e653aca20
4 changed files with 214 additions and 5 deletions
+10 -4
View File
@@ -10,6 +10,7 @@ from openpyxl import Workbook
import math
from collections import defaultdict
import configparser
from updateconfignames import get_sivas_teilestamm, read_bezeichner_from_csv
@dataclass
@@ -555,10 +556,10 @@ if __name__ == '__main__':
parser.add_argument('-n', '--new', action='store', help='create a new dxf file only with cables in it. Name is basename and a timestamp')
parser.add_argument('-x', '--excel', action='store', help='create a xlsx file with cables data', metavar='allCables.xls')
parser.add_argument('-o', '--origin', action='store', help='name of original .dxf file used by -d and -a', metavar='original.dxf')
parser.add_argument('-l', '--local', action='store_true', help='using only local data for naming of article numbers. If not set: fetching names from SIVAS.')
args = parser.parse_args()
config_dir = os.environ.get("PROJECT_CFG")
work_dir = os.fspath(os.environ.get('PROJECT_WORK'))
@@ -583,9 +584,14 @@ if __name__ == '__main__':
cable_cfg.read_file(f)
# Betriebsmittelkennzeichnungs-Config laden
config_BMK = configparser.ConfigParser(allow_no_value=True, delimiters=("="))
config_BMK.optionxform = lambda option: option # preserve case for letters
config_BMK.read(os.path.join(config_dir, "BMK.cfg"))
config_BMK = configparser.ConfigParser(allow_no_value=True, delimiters=("="))
config_BMK.optionxform = lambda option: option # preserve case for letters
config_BMK.read(os.path.join(config_dir, "BMK.cfg"))
names_cfg = configparser.ConfigParser()
names_cfg.optionxform = str #Keys case-sensitive
with open(os.path.join(config_dir, "bezeichner.cfg"), encoding="utf-8") as f:
names_cfg.read_file(f)
dxf_file = args.dxf