Startup Skript so modifiziert, dass Lisp files als Fallback geladen werden

This commit is contained in:
2026-06-03 10:06:09 +02:00
parent b8842957fc
commit 40b430ee73
8 changed files with 2627 additions and 94 deletions
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
-1
View File
@@ -117,7 +117,6 @@
) )
) )
(setq fullpath (strcat dir filename)) (setq fullpath (strcat dir filename))
(prompt (strcat "\n[DBG] Oeffne: " fullpath))
;; Datei mit "w" erstellen/leeren, Header schreiben, sofort schliessen ;; Datei mit "w" erstellen/leeren, Header schreiben, sofort schliessen
(setq fh (open fullpath "w")) (setq fh (open fullpath "w"))
(if fh (if fh
-4
View File
@@ -20,10 +20,6 @@
(strcat (getvar "DWGPREFIX")) (strcat (getvar "DWGPREFIX"))
) )
) )
(load (strcat base-path "ssg_dbg.lsp") "ssg_dbg.lsp nicht gefunden")
(if (not *dbg-path*)
(dbgopen "debugfile.dbg" "DXFM_LOG") ; Fallback: direkt geladen ohne on_start.lsp
)
(load (strcat base-path "ssg_core.lsp") "ssg_core.lsp nicht gefunden") (load (strcat base-path "ssg_core.lsp") "ssg_core.lsp nicht gefunden")
(load (strcat base-path "ssg_dialog.lsp") "ssg_dialog.lsp nicht gefunden") (load (strcat base-path "ssg_dialog.lsp") "ssg_dialog.lsp nicht gefunden")
(load (strcat base-path "ssg_layer.lsp") "ssg_layer.lsp nicht gefunden") (load (strcat base-path "ssg_layer.lsp") "ssg_layer.lsp nicht gefunden")
+121 -89
View File
@@ -45,13 +45,117 @@
(dbgflush) (dbgflush)
) )
;; ------------------------------------------------------------
;; SSG-LIB-LOAD-PYRX - PyRx BRX laden und Python-Module via PYLOAD starten
;; Aufruf: (ssg-lib-load-pyrx menu-pfad)
;; Deaktiviert wegen PyRx/BricsCAD V25.3 Inkompatibilitaet (cad-pyrx 2.2.58.5504)
;; Reaktivieren sobald kompatible Version verfuegbar ist.
;; ------------------------------------------------------------
(defun ssg-lib-load-pyrx (menu-pfad / acadver-str ver-punkt ver-major pyrx-pfad brx-datei brx-result)
;; BricsCAD-Version ermitteln
(setq acadver-str (getvar "ACADVER"))
(setq ver-punkt (vl-string-search "." acadver-str))
(setq ver-major (if ver-punkt (substr acadver-str 1 ver-punkt) "25"))
;; Pyrx-Pfad: .venv (primaer), dann System/User Python
(setq pyrx-pfad
(cond
((findfile (strcat menu-pfad "/.venv/Lib/site-packages/pyrx/RxLoaderV" ver-major ".0.brx"))
(strcat menu-pfad "/.venv/Lib/site-packages/pyrx"))
((and (getenv "PYTHONHOME")
(findfile (strcat (getenv "PYTHONHOME") "/Lib/site-packages/pyrx/RxLoaderV" ver-major ".0.brx")))
(strcat (getenv "PYTHONHOME") "/Lib/site-packages/pyrx"))
((and (getenv "APPDATA")
(findfile (strcat (getenv "APPDATA") "/Python/Python312/site-packages/pyrx/RxLoaderV" ver-major ".0.brx")))
(strcat (getenv "APPDATA") "/Python/Python312/site-packages/pyrx"))
(t nil)
)
)
;; BRX laden wenn PyRx noch nicht via Startup-Suite aktiv
(if (not (member (strcat "rxloaderv" ver-major ".0.brx") (arx)))
(if pyrx-pfad
(progn
(setq brx-datei (strcat pyrx-pfad "/RxLoaderV" ver-major ".0.brx"))
(setq brx-result (vl-catch-all-apply 'arxload (list brx-datei)))
(ssg-dbg-pyrx pyrx-pfad ver-major brx-datei brx-result)
(if (vl-catch-all-error-p brx-result)
(progn
(princ (strcat "\n[SSG_LIB] FEHLER: RxLoaderV" ver-major ".0.brx nicht geladen: "
(vl-catch-all-error-message brx-result)))
(princ "\n[SSG_LIB] HINWEIS: PyRx einmalig via APPLOAD -> Startup Suite einrichten.")
)
(princ (strcat "\n[SSG_LIB] PyRx RxLoader geladen (V" ver-major "): " brx-datei))
)
)
(princ (strcat "\n[SSG_LIB] WARNUNG: RxLoaderV" ver-major ".0.brx nicht gefunden."
"\n PYTHONHOME=" (if (getenv "PYTHONHOME") (getenv "PYTHONHOME") "nicht gesetzt")))
)
(progn
(dbgmsg "[PyRx] PyRx bereits via Startup-Suite aktiv")
(princ (strcat "\n[SSG_LIB] PyRx (V" ver-major ") via Startup-Suite aktiv."))
)
)
;; Python-Module laden - nur wenn PYLOAD verfuegbar
(dbgmsg "[PYLOAD] --- Python-Module ---")
(if (not (member "PYLOAD" (atoms-family 0)))
(progn
(dbgmsg "[PYLOAD] PYLOAD nicht verfuegbar - ueberspringe alle Module")
(princ "\n[SSG_LIB] WARNUNG: PYLOAD nicht verfuegbar (PyRx nicht geladen).")
(princ "\n[SSG_LIB] Python-Befehle (KreiselInsert etc.) nicht aktiv.")
)
(foreach pymod '("eckrad" "kreisel" "dblclick" "omniflo" "omniflo_boegen" "omniflo_weichen")
(if (findfile (strcat menu-pfad "/lib/elemente/" pymod ".py"))
(progn
(dbgmsg (strcat "PYLOAD start: " pymod ".py"))
(command "PYLOAD" (strcat menu-pfad "/lib/elemente/" pymod ".py"))
(dbgmsg (strcat "PYLOAD done: " pymod ".py"))
(princ (strcat "\n[SSG_LIB] Python-Modul " pymod ".py geladen."))
)
(progn
(dbgmsg (strcat "PYLOAD skip: " pymod ".py -- nicht gefunden"))
(princ (strcat "\n[SSG_LIB] HINWEIS: " pymod ".py nicht gefunden."))
)
)
)
)
(dbgflush)
)
;; ------------------------------------------------------------
;; SSG-LIB-REGISTER-CHECK - Verfuegbarkeit aller Befehle ins Debug-Log schreiben
;; ------------------------------------------------------------
(defun ssg-lib-register-check ()
(dbgmsg "[CHECK] --- AutoLISP Funktionen (atoms-family) ---")
(dbgmsg (strcat "ssg-start: " (ssg-dbg-fn "SSG-START")))
(dbgmsg (strcat "ssg-end: " (ssg-dbg-fn "SSG-END")))
(dbgmsg (strcat "ssg-make-layer: " (ssg-dbg-fn "SSG-MAKE-LAYER")))
(dbgmsg (strcat "ssg-errhan: " (ssg-dbg-fn "SSG-ERRHAN")))
(dbgmsg (strcat "ensure-block-loaded: " (ssg-dbg-fn "ENSURE-BLOCK-LOADED")))
(dbgmsg "[CHECK] --- SSG_LIB_Commands (c:...) ---")
(dbgmsg (strcat "c:ILS_BTMT_Beladung: " (ssg-dbg-fn "C:ILS_BTMT_BELADUNG")))
(dbgmsg (strcat "c:ILS_K90LA: " (ssg-dbg-fn "C:ILS_K90LA")))
(dbgmsg (strcat "c:ILS_TEF_Strecke: " (ssg-dbg-fn "C:ILS_TEF_STRECKE")))
(dbgmsg "[CHECK] --- PyRx Befehle (BRX-Ebene, nicht via atoms-family pruefbar) ---")
(dbgmsg (strcat "KreiselInsert: " (ssg-dbg-fn "C:KREISELINSERT")))
(dbgmsg (strcat "KreiselEdit: " (ssg-dbg-fn "C:KREISELEDIT")))
(dbgmsg (strcat "EckradEdit: " (ssg-dbg-fn "C:ECKRADEDIT")))
(dbgmsg (strcat "SSG_BLOCKEDIT: " (ssg-dbg-fn "C:SSG_BLOCKEDIT")))
(dbgmsg (strcat "OMNI_AP60: " (ssg-dbg-fn "C:OMNI_AP60")))
(dbgmsg (strcat "OMNI_APB_630_90: " (ssg-dbg-fn "C:OMNI_APB_630_90")))
(dbgmsg (strcat "OMNI_W90_Einfach: " (ssg-dbg-fn "C:OMNI_W90_EINFACH")))
(dbgflush)
)
(defun ssg-lib-startup ( / lisp-pfad menu-pfad curr-srch menu-datei (defun ssg-lib-startup ( / lisp-pfad menu-pfad curr-srch menu-datei
pyrx-pfad acadver-str ver-punkt ver-major brx-datei brx-fallback brx-result) acadver-str ver-punkt ver-major lsp-fb-pfad)
;; Pfade aus Umgebungsvariablen lesen ;; Pfade aus Umgebungsvariablen lesen
(setq lisp-pfad (getenv "DXFM_LISP")) (setq lisp-pfad (getenv "DXFM_LISP"))
(setq menu-pfad (getenv "DXFMAKRO")) (setq menu-pfad (getenv "DXFMAKRO"))
;; Pfadtrenner vereinheitlichen: Backslash -> Forward-Slash
(if lisp-pfad (setq lisp-pfad (vl-string-translate "\\" "/" lisp-pfad)))
(if menu-pfad (setq menu-pfad (vl-string-translate "\\" "/" menu-pfad)))
(if (null lisp-pfad) (if (null lisp-pfad)
(progn (progn
(princ "\n[SSG_LIB] FEHLER: DXFM_LISP nicht gesetzt!") (princ "\n[SSG_LIB] FEHLER: DXFM_LISP nicht gesetzt!")
@@ -106,104 +210,32 @@
;; DBLCLKEDIT deaktivieren (Block-Editor nicht bei Doppelklick oeffnen) ;; DBLCLKEDIT deaktivieren (Block-Editor nicht bei Doppelklick oeffnen)
(setvar "DBLCLKEDIT" 0) (setvar "DBLCLKEDIT" 0)
;; PyRx BRX-Plugin: wird via BricsCAD Startup-Suite geladen (nicht via arxload). ;; (ssg-lib-load-pyrx menu-pfad) ;; deaktiviert - PyRx/BricsCAD V25.3 Inkompatibilitaet
;; Grund: PyRxV25.0.brx muss vor dem LISP-Startup aktiv sein.
;; Einmalige Einrichtung: APPLOAD -> PyRxV25.0.brx -> "Startup Suite" hinzufuegen.
;;
;; Pyrx-Pfad: aus PYTHONHOME (system Python), nicht aus .venv
(if menu-pfad
(progn
(setq acadver-str (getvar "ACADVER"))
(setq ver-punkt (vl-string-search "." acadver-str))
(setq ver-major (if ver-punkt (substr acadver-str 1 ver-punkt) "25"))
;; Pyrx-Pfad: .venv (primaer, dort installiert), dann System/User Python
(setq pyrx-pfad
(cond
((findfile (strcat menu-pfad "/.venv/Lib/site-packages/pyrx/RxLoaderV" ver-major ".0.brx"))
(strcat menu-pfad "/.venv/Lib/site-packages/pyrx"))
((and (getenv "PYTHONHOME")
(findfile (strcat (getenv "PYTHONHOME") "/Lib/site-packages/pyrx/RxLoaderV" ver-major ".0.brx")))
(strcat (getenv "PYTHONHOME") "/Lib/site-packages/pyrx"))
((and (getenv "APPDATA")
(findfile (strcat (getenv "APPDATA") "/Python/Python312/site-packages/pyrx/RxLoaderV" ver-major ".0.brx")))
(strcat (getenv "APPDATA") "/Python/Python312/site-packages/pyrx"))
(t nil)
)
)
;; Wenn PyRx noch nicht aktiv (nicht via Startup Suite geladen): arxload versuchen
(if (not (member (strcat "rxloaderv" ver-major ".0.brx") (arx)))
(if pyrx-pfad
(progn
(setq brx-datei (strcat pyrx-pfad "/RxLoaderV" ver-major ".0.brx"))
(setq brx-result (vl-catch-all-apply 'arxload (list brx-datei)))
(ssg-dbg-pyrx pyrx-pfad ver-major brx-datei brx-result)
(if (vl-catch-all-error-p brx-result)
(progn
(princ (strcat "\n[SSG_LIB] FEHLER: RxLoaderV" ver-major ".0.brx nicht geladen: "
(vl-catch-all-error-message brx-result)))
(princ "\n[SSG_LIB] HINWEIS: PyRx einmalig via APPLOAD -> Startup Suite einrichten.")
)
(princ (strcat "\n[SSG_LIB] PyRx RxLoader geladen (V" ver-major "): " brx-datei))
)
)
(princ (strcat "\n[SSG_LIB] WARNUNG: PyRxV" ver-major ".0.brx nicht gefunden."
"\n PYTHONHOME=" (if (getenv "PYTHONHOME") (getenv "PYTHONHOME") "nicht gesetzt")))
)
(progn
(dbgmsg "[PyRx] PyRx bereits via Startup-Suite aktiv")
(princ (strcat "\n[SSG_LIB] PyRx (V" ver-major ") via Startup-Suite aktiv."))
)
)
)
)
;; Python-Module laden (PyRx) - nur wenn PYLOAD verfuegbar ;; Fallback: LSP-Routinen laden wenn PyRx nicht aktiv
(dbgmsg "[PYLOAD] --- Python-Module ---") (setq acadver-str (getvar "ACADVER"))
(if (not (member "PYLOAD" (atoms-family 0))) (setq ver-punkt (vl-string-search "." acadver-str))
(setq ver-major (if ver-punkt (substr acadver-str 1 ver-punkt) "25"))
(if (not (member (strcat "rxloaderv" ver-major ".0.brx") (arx)))
(progn (progn
(dbgmsg "[PYLOAD] PYLOAD nicht verfuegbar - ueberspringe alle Module") (dbgmsg "[FALLBACK] PyRx nicht aktiv - lade LSP-Fallbacks")
(princ "\n[SSG_LIB] WARNUNG: PYLOAD nicht verfuegbar (PyRx nicht geladen).") (foreach lsp-fb (list "KreiselInsert" "OmniModulInsert")
(princ "\n[SSG_LIB] Python-Befehle (KreiselInsert etc.) nicht aktiv.") (setq lsp-fb-pfad (strcat lisp-pfad "/" lsp-fb ".lsp"))
) (if (findfile lsp-fb-pfad)
(if menu-pfad
(foreach pymod '("eckrad" "kreisel" "dblclick" "omniflo" "omniflo_boegen" "omniflo_weichen")
(if (findfile (strcat menu-pfad "/lib/elemente/" pymod ".py"))
(progn (progn
(dbgmsg (strcat "PYLOAD start: " pymod ".py")) (ssg-lib-safe-load lsp-fb-pfad)
(command "PYLOAD" (strcat menu-pfad "/lib/elemente/" pymod ".py")) (dbgmsg (strcat "[FALLBACK] geladen: " lsp-fb ".lsp"))
(dbgmsg (strcat "PYLOAD done: " pymod ".py")) (princ (strcat "\n[SSG_LIB] Fallback geladen: " lsp-fb ".lsp"))
(princ (strcat "\n[SSG_LIB] Python-Modul " pymod ".py geladen."))
)
(progn
(dbgmsg (strcat "PYLOAD skip: " pymod ".py -- nicht gefunden"))
(princ (strcat "\n[SSG_LIB] HINWEIS: " pymod ".py nicht gefunden."))
) )
(dbgmsg (strcat "[FALLBACK] nicht gefunden: " lsp-fb ".lsp"))
) )
) )
) )
(dbgmsg "[FALLBACK] PyRx aktiv - kein LSP-Fallback noetig")
) )
(dbgflush) (dbgflush)
;; Verfuegbarkeits-Check aller erwarteten Funktionen (ssg-lib-register-check)
(dbgmsg "[CHECK] --- AutoLISP Funktionen (atoms-family) ---")
(dbgmsg (strcat "ssg-start: " (ssg-dbg-fn "SSG-START")))
(dbgmsg (strcat "ssg-end: " (ssg-dbg-fn "SSG-END")))
(dbgmsg (strcat "ssg-make-layer: " (ssg-dbg-fn "SSG-MAKE-LAYER")))
(dbgmsg (strcat "ssg-errhan: " (ssg-dbg-fn "SSG-ERRHAN")))
(dbgmsg (strcat "ensure-block-loaded: " (ssg-dbg-fn "ENSURE-BLOCK-LOADED")))
(dbgmsg "[CHECK] --- SSG_LIB_Commands (c:...) ---")
(dbgmsg (strcat "c:ILS_BTMT_Beladung: " (ssg-dbg-fn "C:ILS_BTMT_BELADUNG")))
(dbgmsg (strcat "c:ILS_K90LA: " (ssg-dbg-fn "C:ILS_K90LA")))
(dbgmsg (strcat "c:ILS_TEF_Strecke: " (ssg-dbg-fn "C:ILS_TEF_STRECKE")))
(dbgmsg "[CHECK] --- PyRx Befehle (BRX-Ebene, nicht via atoms-family pruefbar) ---")
(dbgmsg (strcat "KreiselInsert: " (ssg-dbg-fn "C:KREISELINSERT")))
(dbgmsg (strcat "KreiselEdit: " (ssg-dbg-fn "C:KREISELEDIT")))
(dbgmsg (strcat "EckradEdit: " (ssg-dbg-fn "C:ECKRADEDIT")))
(dbgmsg (strcat "SSG_BLOCKEDIT: " (ssg-dbg-fn "C:SSG_BLOCKEDIT")))
(dbgmsg (strcat "OMNI_AP60: " (ssg-dbg-fn "C:OMNI_AP60")))
(dbgmsg (strcat "OMNI_APB_630_90: " (ssg-dbg-fn "C:OMNI_APB_630_90")))
(dbgmsg (strcat "OMNI_W90_Einfach: " (ssg-dbg-fn "C:OMNI_W90_EINFACH")))
(dbgflush)
(princ "\n[SSG_LIB] Startup abgeschlossen.") (princ "\n[SSG_LIB] Startup abgeschlossen.")
) )
+53
View File
@@ -0,0 +1,53 @@
// ============================================================
// kreisel_edit.dcl - Kreisel Parameter bearbeiten
// Erlaubt das Aendern von Abstand, Hoehe, Ausrichtung,
// Drehrichtung, Typ und Name eines bestehenden Kreisels.
// ============================================================
kreisel_edit : dialog {
label = "Kreisel bearbeiten";
: column {
: edit_box {
key = "name";
label = "Kreiselname:";
edit_width = 30;
}
: row {
: edit_box {
key = "abstand";
label = "Abstand (mm):";
edit_width = 10;
}
: edit_box {
key = "hoehe";
label = "Hoehe (mm):";
edit_width = 10;
}
}
: popup_list {
key = "ausrichtung";
label = "Ausrichtung:";
width = 30;
}
: row {
: popup_list {
key = "drehrichtung";
label = "Motordrehrichtung:";
width = 16;
}
: popup_list {
key = "kreiselart";
label = "Typ:";
width = 16;
}
}
}
ok_cancel;
}
+54
View File
@@ -0,0 +1,54 @@
// ============================================================
// omniflo_boegen.dcl - Bogen-Auswahl Dialog fuer Omniflo
// Zeigt gefilterte Boegen nach Winkel mit Details an.
// ============================================================
omniflo_boegen : dialog {
label = "Omniflo Bogen Auswahl";
: row {
: popup_list {
key = "bogenart";
label = "Bogenart:";
width = 42;
}
: edit_box {
key = "val_sivasnr";
label = "SivasNr:";
width = 22;
is_enabled = false;
}
}
: row {
: edit_box {
key = "val_winkel";
label = "Winkel:";
width = 16;
is_enabled = false;
}
: edit_box {
key = "val_radius";
label = "Radius:";
width = 16;
is_enabled = false;
}
}
: row {
: edit_box {
key = "val_breite";
label = "Breite:";
width = 16;
is_enabled = false;
}
: edit_box {
key = "val_laenge";
label = "Laenge:";
width = 16;
is_enabled = false;
}
}
ok_cancel;
}
+65
View File
@@ -0,0 +1,65 @@
// ============================================================
// omniflo_weichen.dcl - Weichen-Auswahl Dialog fuer Omniflo
// Zeigt gefilterte Weichen mit Details und Filteroptionen an.
// ============================================================
omniflo_weichen : dialog {
label = "Omniflo Weichen Auswahl";
: row {
: popup_list {
key = "profiltyp";
label = "Profiltyp-Auswahl:";
width = 50;
}
}
: row {
: boxed_radio_column {
key = "schaltung";
label = "Schaltungstyp";
: radio_button { key = "sch_alle"; label = "Alle"; value = "1"; }
: radio_button { key = "sch_m"; label = "Mechanisch (M)"; }
: radio_button { key = "sch_p"; label = "Pneumatisch (P)"; }
}
: boxed_radio_column {
key = "richtung";
label = "Richtung";
: radio_button { key = "ri_alle"; label = "Alle"; value = "1"; }
: radio_button { key = "ri_links"; label = "Links"; }
: radio_button { key = "ri_rechts"; label = "Rechts"; }
}
}
: row {
: edit_box {
key = "val_sivasnr";
label = "SivasNr:";
width = 22;
is_enabled = false;
}
: edit_box {
key = "val_winkel";
label = "Winkel:";
width = 12;
is_enabled = false;
}
}
: row {
: edit_box {
key = "val_breite";
label = "Breite:";
width = 12;
is_enabled = false;
}
: edit_box {
key = "val_laenge";
label = "Laenge:";
width = 12;
is_enabled = false;
}
}
ok_cancel;
}