;------------------------------------------------------------------------; ; Baugruppe oder Sonder aus 1 Weiche - links oder rechts (STAHL) ; ;------------------------------------------------------------------------; ; AW 12.05.93 ; ;------------------------------------------------------------------------; (defun Dbox (/ Dat) (setq Dat (load_dialog (strcat lw "/acadsst/layout/l_bg_w90.DCL"))) (if (not (new_dialog "l_bg_w90" Dat)) (exit)) (set_tile "RA" m_RA) (set_tile "RI" m_RI) (set_tile "WB" m_WB) (set_tile "BEMASSEN" m_BEMASSEN) (setq breite (dimx_tile "anzeige")) (setq hoehe (dimy_tile "anzeige")) (start_image "anzeige") (slide_image 0 0 breite hoehe "layout(l_bg_w90)") (end_image) (action_tile "accept" "(SetPara) (done_dialog)") (action_tile "cancel" "(exit) (done_dialog)") (start_dialog) (unload_dialog Dat) ) (defun SetPara () (setq m_RA (get_tile "RA") m_RI (get_tile "RI") m_WB (get_tile "WB") m_BEMASSEN (get_tile "BEMASSEN") ) (if (= m_RA "RA_1") (setq RADIUS 1) ) (if (= m_RA "RA_2") (setq RADIUS 2) ) (if (= m_RA "RA_3") (setq RADIUS 3) ) (if (= m_RI "RI_L") (setq RICHTUNG "L") ) (if (= m_RI "RI_R") (setq RICHTUNG "R") ) (if (= m_WB "WB_W") (setq ABSCHLUSS "W") ) (if (= m_WB "WB_B") (setq ABSCHLUSS "B") ) ) (defun datain () (setq ALTFANG (getvar "osmode")) (setq MUFFE-ZAEHLER 0) (setq auswahl-satz nil) ;------------------------ ;>>>> Eingabeteil <<<<<<< ;------------------------ (initget (+ 1 2 4)) (setq PT01 (getpoint "\nAnfangspunkt antippen: ")) (setq PT0 (getpoint PT01 "\nSchnittpunkt antippen: ")) (setq PT02 (getpoint PT0 "\nEndpunkt antippen: ")) (bl-name PT0) ;--> Block-Name definieren -> Rckgabe: element-name (setvar "osmode" 0) (setq WINK_RAD1 (angle PT01 PT0)) (setq WINK_GRA1 (/ (* WINK_RAD1 180) pi)) (if (= RICHTUNG "L") (setq WINK_RAD2 (+ WINK_RAD1 (/ pi 2))) (setq WINK_RAD2 (- WINK_RAD1 (/ pi 2))) ) (setq WINK_GRA2 (/ (* WINK_RAD2 180) pi)) ;------------------; ;Abstnde berechnen; ;------------------; (setq L1 (* (fix (/ (+ (distance PT01 PT0) 1) 2)) 2)) (setq L2 (* (fix (/ (+ (distance PT0 PT02) 1)2)) 2)) (if (= RADIUS 1) ; Radius 650 (progn (if (or (< L1 700) (> L1 1800) (< L2 700) (> L2 1800)) (progn (alert "Abstand zu gro oder zu klein ...") (setvar "osmode" ALTFANG) (exit) ) ) ) ) (if (= RADIUS 2) ; Radius 400 (progn (if (or (< L1 400) (> L1 1800) (< L2 400) (> L2 1800)) (progn (alert "Abstand zu gro oder zu klein ...") (setvar "osmode" ALTFANG) (exit) ) ) ) ) (if (= RADIUS 3) ; Radius 175 (progn (if (or (< L1 270) (> L1 1800) (< L2 270) (> L2 1800)) (progn (alert "Abstand zu gro oder zu klein ...") (setvar "osmode" ALTFANG) (exit) ) ) ) ) ;------------------------------------------------------------ (princ (strcat "\nL1= " (rtos L1) " | L2= " (rtos L2) "W1= " (rtos WINK_RAD1 3 3) " | W2= " (rtos WINK_RAD2 3 3) "\n")) ;-------- ; Muffen ;-------- (command "_layer" "_m" "L-6" "_c" "6" "" "") (command "_insert" (strcat lw "/acadsst/layout/muffe") PT01 "" "" "0") (attribute-aendern "0" "0" "" "" "" block-kennung "825002016" "MUFFE ANGESCHWEISST (BG)" "" "") (setq auswahl-satz (ssget "_L")) (setq MUFFE-ZAEHLER (+ MUFFE-ZAEHLER 1)) (command "_insert" (strcat lw "/acadsst/layout/muffe") PT02 "" "" "0") (attribute-aendern "0" "0" "" "" "" block-kennung "825002016" "MUFFE ANGESCHWEISST (BG)" "" "") (ssadd (entlast) auswahl-satz) (setq MUFFE-ZAEHLER (+ MUFFE-ZAEHLER 1)) (if (= ABSCHLUSS "W") (progn (command "_layer" "_m" "L-7" "_c" "7" "" "") (if (= RADIUS 3) (command "_insert" (strcat lw "/acadsst/layout/muffe") (polar PT0 WINK_RAD1 400) "" "" "0") (command "_insert" (strcat lw "/acadsst/layout/muffe") PT0 "" "" "0") ) (attribute-aendern "0" "0" "" "" "" block-kennung "825004017" "DREIKANTLASCHE" "" "") (ssadd (entlast) auswahl-satz) ) ) (command "_layer" "_m" "L-3" "_c" "3" "" "") ) (defun geometrie-650() ;----------------------------------------- ; Abstnde analysieren und Elemente setzen ;----------------------------------------- ;*************** ; L1 bearbeiten ;*************** (if (= ABSCHLUSS "W") (progn (cond ( (< L1 800) (command "_layer" "_m" "L-1" "_c" "1" "" "") (if (= RICHTUNG "L") (progn (command "_insert" (strcat lw "/acadsst/layout/w90650l7") PT0 "" "" (rtos WINK_GRA1)) (attribute-aendern "0" "0" "" (rtos L1) "" block-kennung "824052002" " (BG)" "" "") (ssadd (entlast) auswahl-satz) ) (progn (command "_insert" (strcat lw "/acadsst/layout/w90650r7") PT0 "" "" (rtos WINK_GRA1)) (attribute-aendern "0" "0" "" (rtos L1) "" block-kennung "824052001" " (BG)" "" "") (ssadd (entlast) auswahl-satz) ) ) (if (> L1 700) (progn (setq PT3 (polar PT01 WINK_RAD1 (- L1 700))) (command "_line" PT01 PT3 "") (ssadd (entlast) auswahl-satz) ) ) ) ( (and (>= L1 800) (<= L1 1800)) (command "_layer" "_m" "L-3" "_c" "3" "" "") (if (= RICHTUNG "L") (command "_insert" (strcat lw "/acadsst/layout/w90650l8") PT0 "" "" (rtos WINK_GRA1)) (command "_insert" (strcat lw "/acadsst/layout/w90650r8") PT0 "" "" (rtos WINK_GRA1)) ) (attribute-aendern "0" "0" "" "" "" block-kennung "" " (BG)" "" "") (ssadd (entlast) auswahl-satz) (if (> L1 800) (progn (setq PT3 (polar PT01 WINK_RAD1 (- L1 800))) (command "_insert" (strcat lw "/acadsst/layout/verbind") PT3 "0.5" "0.5" (rtos WINK_GRA1)) (ssadd (entlast) auswahl-satz) (command "_insert" (strcat lw "/acadsst/layout/stbg") PT01 (- L1 800) "1" (rtos WINK_GRA1)) (attribute-aendern "0" "0" "" (rtos (- L1 800)) "" block-kennung "" (strcat " L=" (rtos (- L1 800))) "" "") (ssadd (entlast) auswahl-satz) ) ) ) ) ; endcond ) ;----end PROGN ) ;---- endif ABSCHLUSS="W" (if (= ABSCHLUSS "B") (progn (cond ( (< L1 800) (command "_layer" "_m" "L-1" "_c" "1" "" "") (if (= RICHTUNG "L") (command "_insert" (strcat lw "/acadsst/layout/s90650l8") PT0 "" "" (rtos WINK_GRA1)) (command "_insert" (strcat lw "/acadsst/layout/s90650r8") PT0 "" "" (rtos WINK_GRA1)) ) (attribute-aendern "0" "0" "" (rtos L1) "" block-kennung "" " SONDER IN (BG)" "" "") (ssadd (entlast) auswahl-satz) (if (> L1 700) (progn (setq PT3 (polar PT01 WINK_RAD1 (- L1 700))) (command "_line" PT01 PT3 "") (ssadd (entlast) auswahl-satz) ) ) ) ( (and (>= L1 800) (<= L1 1800)) (command "_layer" "_m" "L-3" "_c" "3" "" "") (if (= RICHTUNG "L") (command "_insert" (strcat lw "/acadsst/layout/s90650l8") PT0 "" "" (rtos WINK_GRA1)) (command "_insert" (strcat lw "/acadsst/layout/s90650r8") PT0 "" "" (rtos WINK_GRA1)) ) (attribute-aendern "0" "0" "" "" "" block-kennung "" " (BG)" "" "") (ssadd (entlast) auswahl-satz) (if (> L1 800) (progn (setq PT3 (polar PT01 WINK_RAD1 (- L1 800))) (command "_insert" (strcat lw "/acadsst/layout/verbind") PT3 "0.5" "0.5" (rtos WINK_GRA1)) (ssadd (entlast) auswahl-satz) (command "_insert" (strcat lw "/acadsst/layout/stbg") PT01 (- L1 800) "1" (rtos WINK_GRA1)) (attribute-aendern "0" "0" "" (rtos (- L1 800)) "" block-kennung "" (strcat " L=" (rtos (- L1 800))) "" "") (ssadd (entlast) auswahl-satz) ) ) ) ) ; endcond ) ;----end PROGN ) ;---- endif ABSCHLUSS="B" ;*************** ; L2 bearbeiten ;*************** (cond ( (< L2 800) (command "_layer" "_m" "L-1" "_c" "1" "" "") (if (> L2 700) (progn (setq PT4 (polar PT0 WINK_RAD2 700)) (command "_line" PT02 PT4 "") (ssadd (entlast) auswahl-satz) ) ) ) ( (and (>= L2 800) (<= L2 1800)) (command "_layer" "_m" "L-3" "_c" "3" "" "") (if (> L2 800) (progn (setq PT4 (polar PT0 WINK_RAD2 800)) (command "_insert" (strcat lw "/acadsst/layout/verbind") PT4 "0.5" "0.5" (rtos WINK_GRA2)) (ssadd (entlast) auswahl-satz) (command "_insert" (strcat lw "/acadsst/layout/stbg") PT4 (- L2 800) "1" (rtos WINK_GRA2)) (attribute-aendern "0" "0" "" (rtos (- L2 800)) "" block-kennung "" (strcat " L=" (rtos (- L2 800))) "" "") (ssadd (entlast) auswahl-satz) ) ) ) ) ; endcond ) (defun geometrie-400() ;----------------------------------------- ; Abstnde analysieren und Elemente setzen ;----------------------------------------- ;*************** ; L1 bearbeiten ;*************** (if (= ABSCHLUSS "W") (progn (cond ( (and (>= L1 500) (<= L1 1800)) (command "_layer" "_m" "L-3" "_c" "3" "" "") (if (= RICHTUNG "L") (command "_insert" (strcat lw "/acadsst/layout/w90400l5") PT0 "" "" (rtos WINK_GRA1)) (command "_insert" (strcat lw "/acadsst/layout/w90400r5") PT0 "" "" (rtos WINK_GRA1)) ) (attribute-aendern "0" "0" "" "" "" block-kennung "" " (BG)" "" "") (ssadd (entlast) auswahl-satz) (if (> L1 500) (progn (setq PT3 (polar PT01 WINK_RAD1 (- L1 500))) (command "_insert" (strcat lw "/acadsst/layout/verbind") PT3 "0.5" "0.5" (rtos WINK_GRA1)) (ssadd (entlast) auswahl-satz) (command "_insert" (strcat lw "/acadsst/layout/stbg") PT01 (- L1 500) "1" (rtos WINK_GRA1)) (attribute-aendern "0" "0" "" (rtos (- L1 500)) "" block-kennung "" (strcat " L=" (rtos (- L1 500))) "" "") (ssadd (entlast) auswahl-satz) ) ) ) ) ; endcond ) ;----end PROGN ) ;---- endif ABSCHLUSS="W" (if (= ABSCHLUSS "B") (progn (cond ( (< L1 500) (command "_layer" "_m" "L-1" "_c" "1" "" "") (if (= RICHTUNG "L") (command "_insert" (strcat lw "/acadsst/layout/s90400l5") PT0 "" "" (rtos WINK_GRA1)) (command "_insert" (strcat lw "/acadsst/layout/s90400r5") PT0 "" "" (rtos WINK_GRA1)) ) (attribute-aendern "0" "0" "" (rtos L1) "" block-kennung "" " SONDER IN (BG)" "" "") (ssadd (entlast) auswahl-satz) (if (> L1 400) (progn (setq PT3 (polar PT01 WINK_RAD1 (- L1 400))) (command "_line" PT01 PT3 "") (ssadd (entlast) auswahl-satz) ) ) ) ( (and (>= L1 500) (<= L1 1800)) (command "_layer" "_m" "L-3" "_c" "3" "" "") (if (= RICHTUNG "L") (command "_insert" (strcat lw "/acadsst/layout/s90400l5") PT0 "" "" (rtos WINK_GRA1)) (command "_insert" (strcat lw "/acadsst/layout/s90400r5") PT0 "" "" (rtos WINK_GRA1)) ) (attribute-aendern "0" "0" "" "" "" block-kennung "" " (BG)" "" "") (ssadd (entlast) auswahl-satz) (if (> L1 500) (progn (setq PT3 (polar PT01 WINK_RAD1 (- L1 500))) (command "_insert" (strcat lw "/acadsst/layout/verbind") PT3 "0.5" "0.5" (rtos WINK_GRA1)) (ssadd (entlast) auswahl-satz) (command "_insert" (strcat lw "/acadsst/layout/stbg") PT01 (- L1 500) "1" (rtos WINK_GRA1)) (attribute-aendern "0" "0" "" (rtos (- L1 500)) "" block-kennung "" (strcat " L=" (rtos (- L1 500))) "" "") (ssadd (entlast) auswahl-satz) ) ) ) ) ; endcond ) ;----end PROGN ) ;---- endif ABSCHLUSS="B" ;*************** ; L2 bearbeiten ;*************** (cond ( (< L2 500) (command "_layer" "_m" "L-1" "_c" "1" "" "") (if (> L2 500) (progn (setq PT4 (polar PT0 WINK_RAD2 400)) (command "_line" PT02 PT4 "") (ssadd (entlast) auswahl-satz) ) ) ) ( (and (>= L2 500) (<= L2 1800)) (command "_layer" "_m" "L-3" "_c" "3" "" "") (if (> L2 500) (progn (setq PT4 (polar PT0 WINK_RAD2 500)) (command "_insert" (strcat lw "/acadsst/layout/verbind") PT4 "0.5" "0.5" (rtos WINK_GRA2)) (ssadd (entlast) auswahl-satz) (command "_insert" (strcat lw "/acadsst/layout/stbg") PT4 (- L2 500) "1" (rtos WINK_GRA2)) (attribute-aendern "0" "0" "" (rtos (- L2 500)) "" block-kennung "" (strcat " L=" (rtos (- L2 500))) "" "") (ssadd (entlast) auswahl-satz) ) ) ) ) ; endcond ) (defun geometrie-175() ;----------------------------------------- ; Abstnde analysieren und Elemente setzen ;----------------------------------------- ;*************** ; L1 bearbeiten ;*************** (if (= ABSCHLUSS "W") (progn (cond ( (and (>= L1 400) (<= L1 1800)) (command "_layer" "_m" "L-3" "_c" "3" "" "") (if (= RICHTUNG "L") (command "_insert" (strcat lw "/acadsst/layout/w90175l4") PT0 "" "" (rtos WINK_GRA1)) (command "_insert" (strcat lw "/acadsst/layout/w90175r4") PT0 "" "" (rtos WINK_GRA1)) ) (attribute-aendern "0" "0" "" "" "" block-kennung "" " (BG)" "" "") (ssadd (entlast) auswahl-satz) (if (> L1 400) (progn (setq PT3 (polar PT01 WINK_RAD1 (- L1 400))) (command "_insert" (strcat lw "/acadsst/layout/verbind") PT3 "0.5" "0.5" (rtos WINK_GRA1)) (ssadd (entlast) auswahl-satz) (command "_insert" (strcat lw "/acadsst/layout/stbg") PT01 (- L1 400) "1" (rtos WINK_GRA1)) (attribute-aendern "0" "0" "" (rtos (- L1 400)) "" block-kennung "" (strcat " L=" (rtos (- L1 400))) "" "") (ssadd (entlast) auswahl-satz) ) ) ) ) ; endcond ) ;----end PROGN ) ;---- endif ABSCHLUSS="W" (if (= ABSCHLUSS "B") (progn (cond ( (< L1 400) (command "_layer" "_m" "L-1" "_c" "1" "" "") (if (= RICHTUNG "L") (command "_insert" (strcat lw "/acadsst/layout/s90175l4") PT0 "" "" (rtos WINK_GRA1)) (command "_insert" (strcat lw "/acadsst/layout/s90175r4") PT0 "" "" (rtos WINK_GRA1)) ) (attribute-aendern "0" "0" "" (rtos L1) "" block-kennung "" " SONDER IN (BG)" "" "") (ssadd (entlast) auswahl-satz) (if (> L1 270) (progn (setq PT3 (polar PT01 WINK_RAD1 (- L1 270))) (command "_line" PT01 PT3 "") (ssadd (entlast) auswahl-satz) ) ) ) ( (and (>= L1 400) (<= L1 1800)) (command "_layer" "_m" "L-3" "_c" "3" "" "") (if (= RICHTUNG "L") (command "_insert" (strcat lw "/acadsst/layout/s90175l4") PT0 "" "" (rtos WINK_GRA1)) (command "_insert" (strcat lw "/acadsst/layout/s90175r4") PT0 "" "" (rtos WINK_GRA1)) ) (attribute-aendern "0" "0" "" "" "" block-kennung "" " (BG)" "" "") (ssadd (entlast) auswahl-satz) (if (> L1 400) (progn (setq PT3 (polar PT01 WINK_RAD1 (- L1 400))) (command "_insert" (strcat lw "/acadsst/layout/verbind") PT3 "0.5" "0.5" (rtos WINK_GRA1)) (ssadd (entlast) auswahl-satz) (command "_insert" (strcat lw "/acadsst/layout/stbg") PT01 (- L1 400) "1" (rtos WINK_GRA1)) (attribute-aendern "0" "0" "" (rtos (- L1 400)) "" block-kennung "" (strcat " L=" (rtos (- L1 400))) "" "") (ssadd (entlast) auswahl-satz) ) ) ) ) ; endcond ) ;----end PROGN ) ;---- endif ABSCHLUSS="B" ;*************** ; L2 bearbeiten ;*************** (cond ( (< L2 400) (command "_layer" "_m" "L-1" "_c" "1" "" "") (if (> L2 270) (progn (setq PT4 (polar PT0 WINK_RAD2 270)) (command "_line" PT02 PT4 "") (ssadd (entlast) auswahl-satz) ) ) ) ( (and (>= L2 400) (<= L2 1800)) (command "_layer" "_m" "L-3" "_c" "3" "" "") (if (> L2 400) (progn (setq PT4 (polar PT0 WINK_RAD2 400)) (command "_insert" (strcat lw "/acadsst/layout/verbind") PT4 "0.5" "0.5" (rtos WINK_GRA2)) (ssadd (entlast) auswahl-satz) (command "_insert" (strcat lw "/acadsst/layout/stbg") PT4 (- L2 400) "1" (rtos WINK_GRA2)) (attribute-aendern "0" "0" "" (rtos (- L2 400)) "" block-kennung "" (strcat " L=" (rtos (- L2 400))) "" "") (ssadd (entlast) auswahl-satz) ) ) ) ) ; endcond ) ;------------------- (defun BEMASSUNG () ;--------- ; Bemaung ;--------- (command "_layer" "_m" "L-10" "_c" "10" "" "") (command "_dim") (command "_dimtad" "0") (command "_dimtxt" "125") (command "_dimasz" "40") (if (= RICHTUNG "L") (setq WINK_BEM1 (- WINK_RAD1 (/ pi 2))) (setq WINK_BEM1 (+ WINK_RAD1 (/ pi 2))) ) (if (= RICHTUNG "L") (setq WINK_BEM2 (- WINK_RAD2 (/ pi 2))) (setq WINK_BEM2 (+ WINK_RAD2 (/ pi 2))) ) (command "_align" PT01 PT0 (polar PT01 WINK_BEM1 200) "") (command "_align" PT0 PT02 (polar PT0 WINK_BEM2 200) "") (command "_exit") (command "_layer" "_m" "L-3" "_c" "3" "" "") ) ;------------------------------------------------------------------------------ (defun c:l_bg_w90 ( / PT0 PT01 PT02 PT3 PT4 RADIUS RICHTUNG ABSCHLUSS) (setvar "limcheck" 0) (prompt "**** BG aus 1 Weiche + ST - links oder rechts *******") (prompt "") (if (null m_RA) (setq m_RA "RA_1")) ; Radius 650 (if (null m_RI) (setq m_RI "RI_L")) ; Links (if (null m_WB) (setq m_WB "WB_W")) ; Weiche (if (null m_BEMASSEN) (setq m_BEMASSEN "1")) ; mit Bemaung (dbox) (datain) (if (= ABSCHLUSS "W") (setq ART "** BG W") (setq ART "** BG STBL") ) (if (= RADIUS 1) (progn (geometrie-650) (setq RAD " R650") (if (or (< L1 800) (< L2 800)) (setq BEZ (strcat ART " (SONDER)" RAD "/90-" RICHTUNG " L=" (rtos L1) "-" (rtos L2))) (setq BEZ (strcat ART "+ST" RAD "/90-" RICHTUNG " L=" (rtos L1) "-" (rtos L2))) ) ) ) (if (= RADIUS 2) (progn (geometrie-400) (setq RAD " R400") (if (or (< L1 500) (< L2 500)) (setq BEZ (strcat ART " (SONDER)" RAD "/90-" RICHTUNG " L=" (rtos L1) "-" (rtos L2))) (setq BEZ (strcat ART "+ST" RAD "/90-" RICHTUNG " L=" (rtos L1) "-" (rtos L2))) ) ) ) (if (= RADIUS 3) (progn (geometrie-175) (setq RAD " R175") (if (or (< L1 400) (< L2 400)) (setq BEZ (strcat ART " (SONDER)" RAD "/90-" RICHTUNG " L=" (rtos L1) "-" (rtos L2))) (setq BEZ (strcat ART "+ST" RAD "/90-" RICHTUNG " L=" (rtos L1) "-" (rtos L2))) ) ) ) (mach-block PT0 "0" auswahl-satz) (setq auswahl-satz nil) (setq BEZ (strcat BEZ " + " (rtos MUFFE-ZAEHLER) " MUFFE(N)")) (attribute-aendern "0" "2" "1" "" "" block-kennung "111111111" (strcat BEZ " [BG1]") "" "") ; in SSTBASE.LSP (if (= m_BEMASSEN "1") (bemassung) ) (setvar "osmode" ALTFANG) ) ;------------------------------------------------------------------------------