8bd07396532470f3638d97f3880aab8d2d8ab68f
Each TRO marker gains a UID attribute: a unique, permanent four-digit number in the same space as the TeileId of the CSV export and the ID attribute of SSG_LIB (dxfmakros/Lisp/ssg_id.lsp). The visible ID (TRO03) is untouched - it stays the speaking name that TRO_EDIT and TRO_INSERT work with. The UID is a separate tag on purpose: IDSCHECK treats ID as numeric and would overwrite TRO03 with a number while correcting duplicates. Numbers are allocated above the highest already in use, taken from two sources - the ID attributes of the drawing and the TeileId of every CSV object. The second source is the one that matters here: a mechanical drawing not built with SSG_LIB carries no ID attributes at all (in the Mubea plan only 10 of 669 blocks have any attributes), so without it the run would start at 0001 and take numbers the CSV already uses for components. With it the markers start at 0062, above TeileId 0061. With --flow each edge now also gets a CONNECTION_ARROW block at the midpoint of the arrow, rotated along it, holding FROM_UID/TO_UID plus FROM_TRO/TO_TRO as readable text and KIND. That makes the relationship extractable from a DXF export and stable when a marker is moved or renamed. The shaft and head stay separate geometry: a block with fixed geometry cannot span two arbitrary points, and scaling it in X would distort the arrowhead. Block name prefix CONNECTION_ so the SSG_BLOCKEDIT dispatcher in dxfmakros picks it up via "CONNECTION_*". Verified on the real drawing: 10 markers with UIDs 0062-0071, 29 connections with UIDs 0072-0100, every FROM_UID/TO_UID matching its marker, all 39 UIDs unique. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
sps_skel
Das Programm erhält ein mechanische Layout von der Projektierung oder Angebotswesen zusammen mit dem elektronischen Layout mit der Liste aller Sensoren, Stopper, etc. Daraus erstellt es dann ein Skelett für die SPS Programmierung, welches direkt ins TIA Portal importiert werden kann.
Projektstruktur
sps_skel/
bin/ Skripte zur Umgebungsverwaltung
setenv.bat/.sh Umgebungsvariablen setzen
install_py.bat/.sh venv erstellen + pip install
activate_venv.bat/.sh venv aktivieren
get_cmd.bat/.sh Shell mit Umgebung oeffnen
cfg/ Konfigurationsdateien (INI/JSON)
data/ Eingabedaten (nicht im Git)
doc/ Dokumentation
examples/ Beispieldateien
lib/ Python-Quellcode / Bibliothek
log/ Log-Dateien (nicht im Git)
results/ Ergebnisse / Ausgaben (nicht im Git)
tests/ Unit Tests
.gitignore
LICENSE
README.md
requirements.txt
Umgebungsvariablen
| Variable | Beschreibung |
|---|---|
SPS_SKEL |
Wurzelverzeichnis |
SKEL_BIN |
Skriptverzeichnis |
SKEL_LIB |
Python-Quellcode |
SKEL_CFG |
Konfigurationsdateien |
SKEL_DATA |
Eingabedaten |
SKEL_LOG |
Log-Dateien |
SKEL_RESULTS |
Ergebnisse |
SKEL_EXAMPLES |
Beispieldateien |
PYTHONPATH |
Erweitert um SKEL_LIB |
Installation
Voraussetzungen
- Python 3.10 oder hoeher
Setup (Windows)
bin\install_py.bat
Setup (Linux / macOS)
bash bin/install_py.sh
Nutzung
Umgebung setzen
bin\setenv.bat # Windows
source bin/setenv.sh # Linux / macOS
Shell mit gesetzten Variablen oeffnen
bin\get_cmd.bat # Windows
source bin/get_cmd.sh # Linux / macOS
venv aktivieren
bin\activate_venv.bat # Windows
source bin/activate_venv.sh # Linux / macOS
Lizenz
MIT License - siehe LICENSE
Autor
Michael Stangl (GitHub: mistamichael)
Languages
Python
92%
Shell
4%
Batchfile
3.9%
Common Lisp
0.1%