aktuellsten Stand eingepflegt. Probleme mit dem PYLOAD noch nicht bereinigt
This commit is contained in:
+57
-38
@@ -106,59 +106,78 @@
|
||||
;; DBLCLKEDIT deaktivieren (Block-Editor nicht bei Doppelklick oeffnen)
|
||||
(setvar "DBLCLKEDIT" 0)
|
||||
|
||||
;; PyRx BRX-Plugin laden (benoetigt fuer PYLOAD-Befehl)
|
||||
;; PyRx BRX-Plugin: wird via BricsCAD Startup-Suite geladen (nicht via arxload).
|
||||
;; 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 pyrx-pfad (strcat menu-pfad "/.venv/Lib/site-packages/pyrx"))
|
||||
;; BricsCAD-Version aus ACADVER ermitteln (z.B. "25.0.0.0" -> "25")
|
||||
(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"
|
||||
))
|
||||
(setq brx-datei (strcat pyrx-pfad "/RxLoaderV" ver-major ".0.brx"))
|
||||
(if (findfile brx-datei)
|
||||
(progn
|
||||
(setq brx-result (vl-catch-all-apply 'arxload (list brx-datei)))
|
||||
(ssg-dbg-pyrx pyrx-pfad ver-major brx-datei brx-result)
|
||||
(princ (strcat "\n[SSG_LIB] PyRx BRX geladen (V" ver-major "): " brx-datei))
|
||||
(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)
|
||||
)
|
||||
(progn
|
||||
(princ (strcat "\n[SSG_LIB] FEHLER: PyRx BRX nicht gefunden: " brx-datei))
|
||||
(princ "\n[SSG_LIB] Versuche Fallback-Versionen...")
|
||||
(foreach ver '("26" "25" "24")
|
||||
(if (not (= ver ver-major))
|
||||
)
|
||||
;; 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
|
||||
(setq brx-fallback (strcat pyrx-pfad "/RxLoaderV" ver ".0.brx"))
|
||||
(if (findfile brx-fallback)
|
||||
(progn
|
||||
(arxload brx-fallback)
|
||||
(princ (strcat "\n[SSG_LIB] PyRx BRX Fallback geladen (V" ver "): " brx-fallback))
|
||||
)
|
||||
)
|
||||
(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)
|
||||
;; Python-Module laden (PyRx) - nur wenn PYLOAD verfuegbar
|
||||
(dbgmsg "[PYLOAD] --- Python-Module ---")
|
||||
(if menu-pfad
|
||||
(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."))
|
||||
(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.")
|
||||
)
|
||||
(if menu-pfad
|
||||
(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."))
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
+6
-1
@@ -30,10 +30,14 @@ set BRISCAD="C:\Program Files\Bricsys\BricsCAD V25 de_DE\bricscad.exe"
|
||||
|
||||
|
||||
|
||||
REM Python-Umgebung fuer PyRx (BricsCAD benoetigt PYTHONHOME + python312.dll im PATH)
|
||||
set "PYTHONHOME=C:\Python312"
|
||||
set "PATH=C:\Python312;%PATH%"
|
||||
|
||||
REM Python-Pfad erweitern (nur wenn noch nicht vorhanden)
|
||||
echo %PYTHONPATH% | find /i "%DXFM_LIB%" >nul
|
||||
if errorlevel 1 (
|
||||
set "PYTHONPATH=%DXFM_LIB%;%PYTHONPATH%"
|
||||
set "PYTHONPATH=%DXFM_LIB%;%DXFMAKRO%\.venv\Lib\site-packages;%PYTHONPATH%"
|
||||
)
|
||||
|
||||
REM Ordner erstellen falls sie nicht existieren
|
||||
@@ -53,6 +57,7 @@ REM Umgebungsvariablen anzeigen
|
||||
echo.
|
||||
echo ================================================================
|
||||
echo DXFMAKRO = %DXFMAKRO%
|
||||
echo PYTHONHOME = %PYTHONHOME%
|
||||
echo PYTHONPATH = %PYTHONPATH%
|
||||
echo ================================================================
|
||||
echo.
|
||||
|
||||
Reference in New Issue
Block a user