Merge branch 'master' of https://gitea.schoenenberger.de/m.stangl/dxfmakros
This commit is contained in:
Binary file not shown.
Binary file not shown.
+27
-29
@@ -4,27 +4,25 @@
|
|||||||
;; ============================================
|
;; ============================================
|
||||||
|
|
||||||
;; ============================================================
|
;; ============================================================
|
||||||
;; TEIL 1: GLOBALE EINSTELLUNGEN (Einfach, aber sicher)
|
;; TEIL 1: GLOBALE EINSTELLUNGEN
|
||||||
;; ============================================================
|
;; ============================================================
|
||||||
|
|
||||||
(if (getenv "DXFM_BLOCKS")
|
(setq block-pfad (getenv "DXFM_BLOCKS"))
|
||||||
(setq modul-pfad (strcat (getenv "DXFM_BLOCKS") "/"))
|
|
||||||
|
(if (or (null block-pfad) (= block-pfad ""))
|
||||||
(progn
|
(progn
|
||||||
(alert "DXFM_BLOCKS nicht gesetzt!\nBitte zuerst bin\\setenv.bat ausfuehren.")
|
(setq block-pfad "C:/Users/y.wang/Documents/dxfmakros/Blocks/") ;; Fallback oder manuell
|
||||||
(exit)
|
(alert (strcat "Umgebungsvariable DXFM_BLOCKS nicht gefunden.\nNutze Standardpfad: " block-pfad))
|
||||||
)
|
)
|
||||||
|
(setq block-pfad (strcat (vl-string-right-trim "/" (vl-string-translate "\\" "/" block-pfad)) "/"))
|
||||||
)
|
)
|
||||||
|
|
||||||
;; block-pfad neu setzen
|
(setq *block-path* block-pfad)
|
||||||
(setq *block-path* (getenv "DXFM_BLOCKS"))
|
(princ (strcat "\n✅ Block-Pfad aktiv: " block-pfad))
|
||||||
(princ (strcat "\nBlock-Pfad: " *block-path*))
|
|
||||||
|
|
||||||
;; Basispunkt: Linker Kreis, linkester Tangentenpunkt (links Mitte)
|
|
||||||
;; ============================================
|
|
||||||
|
|
||||||
;; Standardwerte initialisieren
|
;; Standardwerte initialisieren
|
||||||
(setq #Kreisel_Abstand 2300.0)
|
(if (null #Kreisel_Abstand) (setq #Kreisel_Abstand 2300.0))
|
||||||
(setq #Kreisel_Typ "PIN")
|
(if (null #Kreisel_Typ) (setq #Kreisel_Typ "PIN"))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -140,43 +138,43 @@
|
|||||||
;; Verbindungspunkte pruefen
|
;; Verbindungspunkte pruefen
|
||||||
(cond
|
(cond
|
||||||
;; T_O (Mittelpunkt obere Tangente)
|
;; T_O (Mittelpunkt obere Tangente)
|
||||||
((and (< (abs (- pickX (+ x 400.0 (/ abstand 2.0)))) tolerance)
|
((and (<= (abs (- pickX (+ x 400.0 (/ abstand 2.0)))) tolerance)
|
||||||
(< (abs (- pickY (+ y 400.0))) tolerance))
|
(<= (abs (- pickY (+ y 400.0))) tolerance))
|
||||||
(setq type "T_O"))
|
(setq type "T_O"))
|
||||||
|
|
||||||
;; T_U (Mittelpunkt untere Tangente)
|
;; T_U (Mittelpunkt untere Tangente)
|
||||||
((and (< (abs (- pickX (+ x 400.0 (/ abstand 2.0)))) tolerance)
|
((and (<= (abs (- pickX (+ x 400.0 (/ abstand 2.0)))) tolerance)
|
||||||
(< (abs (- pickY (- y 400.0))) tolerance))
|
(<= (abs (- pickY (- y 400.0))) tolerance))
|
||||||
(setq type "T_U"))
|
(setq type "T_U"))
|
||||||
|
|
||||||
;; M_O (Linker Kreis, oberer Rand)
|
;; M_O (Linker Kreis, oberer Rand)
|
||||||
((and (< (abs (- pickX (+ x 400.0))) tolerance)
|
((and (<= (abs (- pickX (+ x 400.0))) tolerance)
|
||||||
(< (abs (- pickY (+ y 400.0))) tolerance))
|
(<= (abs (- pickY (+ y 400.0))) tolerance))
|
||||||
(setq type "M_O"))
|
(setq type "M_O"))
|
||||||
|
|
||||||
;; M_U (Linker Kreis, unterer Rand)
|
;; M_U (Linker Kreis, unterer Rand)
|
||||||
((and (< (abs (- pickX (+ x 400.0))) tolerance)
|
((and (<= (abs (- pickX (+ x 400.0))) tolerance)
|
||||||
(< (abs (- pickY (- y 400.0))) tolerance))
|
(<= (abs (- pickY (- y 400.0))) tolerance))
|
||||||
(setq type "M_U"))
|
(setq type "M_U"))
|
||||||
|
|
||||||
;; M_L (Linker Kreis, linker Rand)
|
;; M_L (Linker Kreis, linker Rand)
|
||||||
((and (< (abs (- pickX x)) tolerance)
|
((and (<= (abs (- pickX x)) tolerance)
|
||||||
(< (abs (- pickY y)) tolerance))
|
(<= (abs (- pickY y)) tolerance))
|
||||||
(setq type "M_L"))
|
(setq type "M_L"))
|
||||||
|
|
||||||
;; S_O (Rechter Kreis, oberer Rand)
|
;; S_O (Rechter Kreis, oberer Rand)
|
||||||
((and (< (abs (- pickX (+ x 400.0 abstand))) tolerance)
|
((and (<= (abs (- pickX (+ x 400.0 abstand))) tolerance)
|
||||||
(< (abs (- pickY (+ y 400.0))) tolerance))
|
(<= (abs (- pickY (+ y 400.0))) tolerance))
|
||||||
(setq type "S_O"))
|
(setq type "S_O"))
|
||||||
|
|
||||||
;; S_U (Rechter Kreis, unterer Rand)
|
;; S_U (Rechter Kreis, unterer Rand)
|
||||||
((and (< (abs (- pickX (+ x 400.0 abstand))) tolerance)
|
((and (<= (abs (- pickX (+ x 400.0 abstand))) tolerance)
|
||||||
(< (abs (- pickY (- y 400.0))) tolerance))
|
(<= (abs (- pickY (- y 400.0))) tolerance))
|
||||||
(setq type "S_U"))
|
(setq type "S_U"))
|
||||||
|
|
||||||
;; S_R (Rechter Kreis, rechter Rand)
|
;; S_R (Rechter Kreis, rechter Rand)
|
||||||
((and (< (abs (- pickX (+ x 800.0 abstand))) tolerance)
|
((and (<= (abs (- pickX (+ x 800.0 abstand))) tolerance)
|
||||||
(< (abs (- pickY y)) tolerance))
|
(<= (abs (- pickY y)) tolerance))
|
||||||
(setq type "S_R"))
|
(setq type "S_R"))
|
||||||
|
|
||||||
(t (setq type "UNKNOWN"))
|
(t (setq type "UNKNOWN"))
|
||||||
|
|||||||
+39
-13
@@ -7,24 +7,50 @@
|
|||||||
(vl-load-com)
|
(vl-load-com)
|
||||||
|
|
||||||
;; ============================================================
|
;; ============================================================
|
||||||
;; TEIL 1: GLOBALE EINSTELLUNGEN
|
;; BLOCK PATH INITIALIZATION
|
||||||
;; ============================================================
|
;; ============================================================
|
||||||
(if (getenv "DXFM_BLOCKS")
|
|
||||||
(setq modul-pfad (strcat (getenv "DXFM_BLOCKS") "/"))
|
;; ============================================
|
||||||
(progn
|
;; Automatische Umgebungsvariablen Konfiguration
|
||||||
(alert "Umgebungsvariable DXFM_BLOCKS nicht gesetzt!\nBitte zuerst bin\\setenv.bat ausfuehren.")
|
;; ============================================
|
||||||
(exit)
|
|
||||||
|
;; Basis-Pfad (an Ihre Struktur anpassen)
|
||||||
|
(setq *dxfm-base* "C:\\Users\\y.wang\\Documents\\dxfmakros\\")
|
||||||
|
|
||||||
|
;; Funktion zum sicheren Setzen von Umgebungsvariablen
|
||||||
|
(defun ensure-env-var (varName defaultPath)
|
||||||
|
(if (null (getenv varName))
|
||||||
|
(progn
|
||||||
|
(setenv varName defaultPath)
|
||||||
|
(princ (strcat "\n✅ " varName " gesetzt: " defaultPath))
|
||||||
|
)
|
||||||
|
(princ (strcat "\n📌 " varName " bereits gesetzt: " (getenv varName)))
|
||||||
|
)
|
||||||
|
(getenv varName)
|
||||||
|
)
|
||||||
|
|
||||||
|
;; Umgebungsvariablen sicherstellen
|
||||||
|
(ensure-env-var "DXFM_BLOCKS" (strcat *dxfm-base* "Blocks\\"))
|
||||||
|
(ensure-env-var "DXFM_DATA" (strcat *dxfm-base* "Data\\"))
|
||||||
|
|
||||||
|
;; Block-Pfad initialisieren (für draw-module)
|
||||||
|
(setq *block-pfad* (getenv "DXFM_BLOCKS"))
|
||||||
|
|
||||||
|
;; Koordinaten-Bibliothek initialisieren (mit Fallback)
|
||||||
|
(setq koordinaten-lib
|
||||||
|
(if (getenv "DXFM_DATA")
|
||||||
|
(strcat (getenv "DXFM_DATA") "block_libraries\\ils_vario_koordinaten.dwg")
|
||||||
|
(strcat *dxfm-base* "Data\\block_libraries\\ils_vario_koordinaten.dwg")
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
;; Pfad zur Koordinaten-Bibliothek (neue Bogen-Bloecke mit KS_EIN/KS_AUS)
|
;; Prüfen ob Koordinaten-Bibliothek existiert
|
||||||
(if (getenv "DXFM_DATA")
|
(if (findfile koordinaten-lib)
|
||||||
(setq koordinaten-lib (strcat (getenv "DXFM_DATA") "/block_libraries/ils_vario_koordinaten.dwg"))
|
(princ (strcat "\n✅ Koordinaten-Bibliothek: " koordinaten-lib))
|
||||||
(progn
|
(princ (strcat "\n⚠️ Koordinaten-Bibliothek nicht gefunden: " koordinaten-lib))
|
||||||
(alert "Umgebungsvariable DXFM_DATA nicht gesetzt!\nBitte zuerst bin\\setenv.bat ausfuehren.")
|
|
||||||
(exit)
|
|
||||||
)
|
|
||||||
)
|
)
|
||||||
|
|
||||||
|
(princ "\n=== Umgebungsvariablen initialisiert ===\n")
|
||||||
(setq doc (vla-get-ActiveDocument (vlax-get-acad-object)))
|
(setq doc (vla-get-ActiveDocument (vlax-get-acad-object)))
|
||||||
(setq modelspace (vla-get-ModelSpace doc))
|
(setq modelspace (vla-get-ModelSpace doc))
|
||||||
|
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ Generiert komplette Vario-Foerderanlagen mit Vertikalboegen, Motor-/Spannstation
|
|||||||
|
|
||||||
Unterstuetzte Bogenwinkel: 3, 9, 12, 15, 24, 36, 48 Grad
|
Unterstuetzte Bogenwinkel: 3, 9, 12, 15, 24, 36, 48 Grad
|
||||||
|
|
||||||
### ILSModulInsert.lsp - Kreisel Modul-Einfuegesystem (v4.0)
|
### KreiselInsert.lsp - Kreisel Modul-Einfuegesystem (v4.0)
|
||||||
|
|
||||||
Zeichnet ILS-Kreiselmodule mit konfigurierbarem Abstand und PIN-Typ.
|
Zeichnet ILS-Kreiselmodule mit konfigurierbarem Abstand und PIN-Typ.
|
||||||
|
|
||||||
@@ -31,7 +31,7 @@ dxfmakros/
|
|||||||
├── Blocks/ # DWG-Bloecke (Motorstation, Spannstation, Vertikalboegen, etc.)
|
├── Blocks/ # DWG-Bloecke (Motorstation, Spannstation, Vertikalboegen, etc.)
|
||||||
├── Lisp/ # AutoLISP-Makros
|
├── Lisp/ # AutoLISP-Makros
|
||||||
│ ├── VarioFoerderer.lsp
|
│ ├── VarioFoerderer.lsp
|
||||||
│ └── ILSModulInsert.lsp
|
│ └── KreiselInsert.lsp
|
||||||
├── bin/ # Hilfs-Skripte
|
├── bin/ # Hilfs-Skripte
|
||||||
├── result/ # Ergebnisse / DXF-Exporte (nicht im Git)
|
├── result/ # Ergebnisse / DXF-Exporte (nicht im Git)
|
||||||
├── LICENSE
|
├── LICENSE
|
||||||
|
|||||||
Reference in New Issue
Block a user