;------------------------------------------------------------------------; ; Baugruppe oder Sonder aus 2 STB 90 Grad ; ;------------------------------------------------------------------------; ; AW 13.05.93 ; ;------------------------------------------------------------------------; (defun Dbox (/ Dat) (setq Dat (load_dialog (strcat lw "/acadsst/layout/l_bg_2b.DCL"))) (if (not (new_dialog "l_bg_2b" Dat)) (exit)) (set_tile "RA" m_RA) (set_tile "BEMASSEN" m_BEMASSEN) (SetDia) (ACTION_TILE "RA" "(zeig_dia)") (ACTION_TILE "BEMASSEN" "(zeig_dia)") (action_tile "accept" "(SetPara) (done_dialog)") (action_tile "cancel" "(exit) (done_dialog)") (start_dialog) (unload_dialog Dat) ) (defun SetDia() (setq breite (dimx_tile "anzeige")) (setq hoehe (dimy_tile "anzeige")) (start_image "anzeige") (FILL_IMAGE 0 0 breite hoehe -18) (if (= m_BEMASSEN "1") ; mit Bemassung (progn (if (= m_RA "RA_1") ; 650 Radius (slide_image 0 0 breite hoehe "layout(stbbg65d)") ) (if (= m_RA "RA_2") ; 400 Radius (slide_image 0 0 breite hoehe "layout(stbbg40d)") ) (if (= m_RA "RA_3") ; 175 Radius (slide_image 0 0 breite hoehe "layout(stbbg17d)") ) ) ) (if (= m_BEMASSEN "0") ; ohne Bemassung (progn (if (= m_RA "RA_1") ; 650 Radius (slide_image 0 0 breite hoehe "layout(stbbg65)") ) (if (= m_RA "RA_2") ; 400 Radius (slide_image 0 0 breite hoehe "layout(stbbg40)") ) (if (= m_RA "RA_3") ; 175 Radius (slide_image 0 0 breite hoehe "layout(stbbg17)") ) ) ) (end_image) ) (defun zeig_dia() (setq m_RA (get_tile "RA")) (setq m_BEMASSEN (get_tile "BEMASSEN")) (SetDia) ) (defun SetPara () (setq m_RA (get_tile "RA") 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) ) ) (defun datain () (setq ALTFANG (getvar "osmode")) (setq MUFFE-ZAEHLER 0) ;------------------------ ;>>>> Eingabeteil <<<<<<< ;------------------------ (setq auswahl-satz nil) (initget (+ 1 2 4)) (setq PT0 (getpoint "\nPick 1st point: ")) (setq PT01 (getpoint PT0 "\nPick 2nd point: ")) (setq PT02 (getpoint PT01 "\nPick 3rd point: ")) (setq PT03 (getpoint PT02 "\nPick 4th point: ")) (bl-name PT0) ;--> Block-Name definieren -> Rckgabe: element-name (setvar "osmode" 0) (setq WINK_RAD1 (angle PT0 PT01)) (setq WINK_GRA1 (/ (* WINK_RAD1 180) pi)) (setq WINK_RAD2 (+ WINK_RAD1 (/ pi 2))) (setq WINK_GRA2 (/ (* WINK_RAD2 180) pi)) (setq WINK_RAD3 (+ WINK_RAD1 pi)) (setq WINK_GRA3 (/ (* WINK_RAD3 180) pi)) ;------------------; ;Abstnde berechnen; ;------------------; (setq L1 (* (fix (/ (+ (distance PT0 PT01) 1) 2)) 2)) (setq L2 (* (fix (/ (+ (distance PT01 PT02) 1) 2)) 2)) (setq L3 (* (fix (/ (+ (distance PT02 PT03) 1) 2)) 2)) (if (= RADIUS 1) ; Radius 650 (progn (if (or (< L1 650) (> L1 1800) (< L2 1300) (> L2 2000) (< L3 650) (> L3 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 800) (> L2 2000) (< L3 400) (> L3 1800)) (progn (alert "Abstand zu gro oder zu klein ...") (setvar "osmode" ALTFANG) (exit) ) ) ) ) (if (= RADIUS 3) ; Radius 175 (progn (if (or (< L1 250) (> L1 1800) (< L2 500) (> L2 2000) (< L1 250) (> L1 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")) ;------------------------------------------------------------ ; (setq PTA (getpoint "\nAufbaupunkt antippen: ")) ;------------------------------------------------------------ ;<<<<< Konstruktionspunkte definieren >>>>>>> ;-------------------------------------------------------- (setq PT1 (polar PT0 WINK_RAD1 L1)) (setq PT2 (polar PT1 WINK_RAD2 L2)) (setq PT3 (polar PT2 WINK_RAD3 L3)) ;-------- ; Muffen ;-------- (command "_layer" "_m" "L-6" "_c" "6" "" "") (command "_insert" (strcat lw "/acadsst/layout/muffe") PT0 "" "" "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") PT3 "" "" "0") (attribute-aendern "0" "0" "" "" "" block-kennung "825002016" "MUFFE ANGESCHWEISST (BG)" "" "") (ssadd (entlast) auswahl-satz) (setq MUFFE-ZAEHLER (+ MUFFE-ZAEHLER 1)) ) (defun geometrie-650() ;----------------------------------------- ; Abstnde analysieren und Elemente setzen ;----------------------------------------- ;*************** ; L1 bearbeiten ;*************** (if (or (< L1 800) (< L2 1600) (< L3 800)) (command "_layer" "_m" "L-1" "_c" "1" "" "") (command "_layer" "_m" "L-3" "_c" "3" "" "") ) (cond ( (< L1 800) (command "_insert" (strcat lw "/acadsst/layout/s90650l8") PT1 "" "" (rtos WINK_GRA1)) (attribute-aendern "0" "0" "" (rtos L1) "" block-kennung "" " SONDER IN (BG)" "" "") (ssadd (entlast) auswahl-satz) (if (> L1 650) (progn (setq PT4 (polar PT0 WINK_RAD1 (- L1 650))) (command "_line" PT0 PT4 "") (ssadd (entlast) auswahl-satz) ) ) ) ( (and (>= L1 800) (<= L1 1800)) (command "_insert" (strcat lw "/acadsst/layout/s90650l8") PT1 "" "" (rtos WINK_GRA1)) (attribute-aendern "0" "0" "" "" "" block-kennung "" " (BG)" "" "") (ssadd (entlast) auswahl-satz) (if (> L1 800) (progn (setq PT4 (polar PT0 WINK_RAD1 (- L1 800))) (command "_insert" (strcat lw "/acadsst/layout/verbind") PT4 "0.5" "0.5" (rtos WINK_GRA1)) (ssadd (entlast) auswahl-satz) (command "_insert" (strcat lw "/acadsst/layout/stbg") PT0 (- 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 ;*************** ; L2 bearbeiten ;*************** (cond ( (< L2 1600) (setq PT5 (polar PT1 WINK_RAD2 (/ L2 2))) (command "_insert" (strcat lw "/acadsst/layout/verbind") PT5 "0.5" "0.5" (rtos WINK_GRA2)) (ssadd (entlast) auswahl-satz) ) ( (and (>= L2 1600) (<= L2 2000)) (setq PT5 (polar PT1 WINK_RAD2 800)) (command "_insert" (strcat lw "/acadsst/layout/verbind") PT5 "0.5" "0.5" (rtos WINK_GRA2)) (ssadd (entlast) auswahl-satz) (if (> L2 1600) (progn (setq PT6 (polar PT1 WINK_RAD2 800)) (command "_insert" (strcat lw "/acadsst/layout/verbind") PT6 "0.5" "0.5" (rtos WINK_GRA2)) (ssadd (entlast) auswahl-satz) (command "_insert" (strcat lw "/acadsst/layout/stbg") PT6 (- L2 1600) "1" (rtos WINK_GRA2)) (attribute-aendern "0" "0" "" (rtos (- L2 1600)) "" block-kennung "" (strcat " L=" (rtos (- L2 1600))) "" "") (ssadd (entlast) auswahl-satz) ) ) ) ) ; endcond ;*************** ; L3 bearbeiten ;*************** (cond ( (< L3 800) (command "_insert" (strcat lw "/acadsst/layout/s90650r8") PT2 "" "" (rtos WINK_GRA1)) (attribute-aendern "0" "0" "" (rtos L3) "" block-kennung "" " SONDER IN (BG)" "" "") (ssadd (entlast) auswahl-satz) (if (> L3 650) (progn (setq PT7 (polar PT2 WINK_RAD3 650)) (command "_line" PT7 PT3 "") (ssadd (entlast) auswahl-satz) ) ) ) ( (and (>= L3 800) (<= L3 1800)) (command "_insert" (strcat lw "/acadsst/layout/s90650r8") PT2 "" "" (rtos WINK_GRA1)) (attribute-aendern "0" "0" "" "" "" block-kennung "" " (BG)" "" "") (ssadd (entlast) auswahl-satz) (if (> L3 800) (progn (setq PT7 (polar PT2 WINK_RAD3 800)) (command "_insert" (strcat lw "/acadsst/layout/verbind") PT7 "0.5" "0.5" (rtos WINK_GRA1)) (ssadd (entlast) auswahl-satz) (command "_insert" (strcat lw "/acadsst/layout/stbg") PT3 (- L3 800) "1" (rtos WINK_GRA1)) (attribute-aendern "0" "0" "" (rtos (- L3 800)) "" block-kennung "" (strcat " L=" (rtos (- L3 800))) "" "") (ssadd (entlast) auswahl-satz) ) ) ) ) ; endcond ) (defun geometrie-400() (if (or (< L1 500) (< L2 1000) (< L3 500)) (command "_layer" "_m" "L-1" "_c" "1" "" "") (command "_layer" "_m" "L-3" "_c" "3" "" "") ) ;----------------------------------------- ; Abstnde analysieren und Elemente setzen ;----------------------------------------- ;*************** ; L1 bearbeiten ;*************** (if (or (< L1 500) (< L2 1000) (< L3 500)) (command "_layer" "_m" "L-1" "_c" "1" "" "") (command "_layer" "_m" "L-3" "_c" "3" "" "") ) (cond ( (< L1 500) (command "_insert" (strcat lw "/acadsst/layout/s90400l5") PT1 "" "" (rtos WINK_GRA1)) (attribute-aendern "0" "0" "" (rtos L1) "" block-kennung "" " SONDER IN (BG)" "" "") (ssadd (entlast) auswahl-satz) (if (> L1 400) (progn (setq PT4 (polar PT0 WINK_RAD1 (- L1 400))) (command "_line" PT0 PT4 "") (ssadd (entlast) auswahl-satz) ) ) ) ( (and (>= L1 500) (<= L1 1800)) (command "_insert" (strcat lw "/acadsst/layout/s90400l5") PT1 "" "" (rtos WINK_GRA1)) (attribute-aendern "0" "0" "" "" "" block-kennung "" " (BG)" "" "") (ssadd (entlast) auswahl-satz) (if (> L1 500) (progn (setq PT4 (polar PT0 WINK_RAD1 (- L1 500))) (command "_insert" (strcat lw "/acadsst/layout/verbind") PT4 "0.5" "0.5" (rtos WINK_GRA1)) (ssadd (entlast) auswahl-satz) (command "_insert" (strcat lw "/acadsst/layout/stbg") PT0 (- 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 ;*************** ; L2 bearbeiten ;*************** (cond ( (< L2 1000) (setq PT5 (polar PT1 WINK_RAD2 (/ L2 2))) (command "_insert" (strcat lw "/acadsst/layout/verbind") PT5 "0.5" "0.5" (rtos WINK_GRA2)) (ssadd (entlast) auswahl-satz) ) ( (and (>= L2 1000) (<= L2 2000)) (setq PT5 (polar PT1 WINK_RAD2 500)) (command "_insert" (strcat lw "/acadsst/layout/verbind") PT5 "0.5" "0.5" (rtos WINK_GRA2)) (ssadd (entlast) auswahl-satz) (if (> L2 1000) (progn (setq PT6 (polar PT1 WINK_RAD2 500)) (command "_insert" (strcat lw "/acadsst/layout/verbind") PT6 "0.5" "0.5" (rtos WINK_GRA2)) (ssadd (entlast) auswahl-satz) (command "_insert" (strcat lw "/acadsst/layout/stbg") PT6 (- L2 1000) "1" (rtos WINK_GRA2)) (attribute-aendern "0" "0" "" (rtos (- L2 1000)) "" block-kennung "" (strcat " L=" (rtos (- L2 1000))) "" "") (ssadd (entlast) auswahl-satz) ) ) ) ) ; endcond ;*************** ; L3 bearbeiten ;*************** (cond ( (< L3 500) (command "_insert" (strcat lw "/acadsst/layout/s90400r5") PT2 "" "" (rtos WINK_GRA1)) (attribute-aendern "0" "0" "" (rtos L3) "" block-kennung "" " SONDER IN (BG)" "" "") (ssadd (entlast) auswahl-satz) (if (> L3 400) (progn (setq PT7 (polar PT2 WINK_RAD3 400)) (command "_line" PT7 PT3 "") (ssadd (entlast) auswahl-satz) ) ) ) ( (and (>= L3 500) (<= L3 1800)) (command "_insert" (strcat lw "/acadsst/layout/s90400r5") PT2 "" "" (rtos WINK_GRA1)) (attribute-aendern "0" "0" "" "" "" block-kennung "" " (BG)" "" "") (ssadd (entlast) auswahl-satz) (if (> L3 500) (progn (setq PT7 (polar PT2 WINK_RAD3 500)) (command "_insert" (strcat lw "/acadsst/layout/verbind") PT7 "0.5" "0.5" (rtos WINK_GRA1)) (ssadd (entlast) auswahl-satz) (command "_insert" (strcat lw "/acadsst/layout/stbg") PT3 (- L3 500) "1" (rtos WINK_GRA1)) (attribute-aendern "0" "0" "" (rtos (- L3 500)) "" block-kennung "" (strcat " L=" (rtos (- L3 500))) "" "") (ssadd (entlast) auswahl-satz) ) ) ) ) ; endcond ) (defun geometrie-175() (if (or (< L1 400) (< L2 400) (< L3 800)) (command "_layer" "_m" "L-1" "_c" "1" "" "") (command "_layer" "_m" "L-3" "_c" "3" "" "") ) ;----------------------------------------- ; Abstnde analysieren und Elemente setzen ;----------------------------------------- ;*************** ; L1 bearbeiten ;*************** (if (or (< L1 400) (< L2 800) (< L3 400)) (command "_layer" "_m" "L-1" "_c" "1" "" "") (command "_layer" "_m" "L-3" "_c" "3" "" "") ) (cond ( (< L1 400) (command "_insert" (strcat lw "/acadsst/layout/s90175l4") PT1 "" "" (rtos WINK_GRA1)) (attribute-aendern "0" "0" "" (rtos L1) "" block-kennung "" " SONDER IN (BG)" "" "") (ssadd (entlast) auswahl-satz) (if (> L1 250) (progn (setq PT4 (polar PT0 WINK_RAD1 (- L1 250))) (command "_line" PT0 PT4 "") (ssadd (entlast) auswahl-satz) ) ) ) ( (and (>= L1 400) (<= L1 1800)) (command "_insert" (strcat lw "/acadsst/layout/s90175l4") PT1 "" "" (rtos WINK_GRA1)) (attribute-aendern "0" "0" "" "" "" block-kennung "" " (BG)" "" "") (ssadd (entlast) auswahl-satz) (if (> L1 400) (progn (setq PT4 (polar PT0 WINK_RAD1 (- L1 400))) (command "_insert" (strcat lw "/acadsst/layout/verbind") PT4 "0.5" "0.5" (rtos WINK_GRA1)) (ssadd (entlast) auswahl-satz) (command "_insert" (strcat lw "/acadsst/layout/stbg") PT0 (- 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 ;*************** ; L2 bearbeiten ;*************** (cond ( (< L2 800) (setq PT5 (polar PT1 WINK_RAD2 (/ L2 2))) (command "_insert" (strcat lw "/acadsst/layout/verbind") PT5 "0.5" "0.5" (rtos WINK_GRA2)) (ssadd (entlast) auswahl-satz) ) ( (and (>= L2 800) (<= L2 2000)) (setq PT5 (polar PT1 WINK_RAD2 400)) (command "_insert" (strcat lw "/acadsst/layout/verbind") PT5 "0.5" "0.5" (rtos WINK_GRA2)) (ssadd (entlast) auswahl-satz) (if (> L2 800) (progn (setq PT6 (polar PT1 WINK_RAD2 400)) (command "_insert" (strcat lw "/acadsst/layout/verbind") PT6 "0.5" "0.5" (rtos WINK_GRA2)) (ssadd (entlast) auswahl-satz) (command "_insert" (strcat lw "/acadsst/layout/stbg") PT6 (- 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 ;*************** ; L3 bearbeiten ;*************** (cond ( (< L3 400) (command "_insert" (strcat lw "/acadsst/layout/s90175r4") PT2 "" "" (rtos WINK_GRA1)) (attribute-aendern "0" "0" "" (rtos L3) "" block-kennung "" " SONDER IN (BG)" "" "") (ssadd (entlast) auswahl-satz) (if (> L3 250) (progn (setq PT7 (polar PT2 WINK_RAD3 250)) (command "_line" PT7 PT3 "") (ssadd (entlast) auswahl-satz) ) ) ) ( (and (>= L3 400) (<= L3 1800)) (command "_insert" (strcat lw "/acadsst/layout/s90175r4") PT2 "" "" (rtos WINK_GRA1)) (attribute-aendern "0" "0" "" "" "" block-kennung "" " (BG)" "" "") (ssadd (entlast) auswahl-satz) (if (> L3 400) (progn (setq PT7 (polar PT2 WINK_RAD3 400)) (command "_insert" (strcat lw "/acadsst/layout/verbind") PT7 "0.5" "0.5" (rtos WINK_GRA1)) (ssadd (entlast) auswahl-satz) (command "_insert" (strcat lw "/acadsst/layout/stbg") PT3 (- L3 400) "1" (rtos WINK_GRA1)) (attribute-aendern "0" "0" "" (rtos (- L3 400)) "" block-kennung "" (strcat " L=" (rtos (- L3 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") (setq WINK_BEM1 (- WINK_RAD1 (/ pi 2))) (setq WINK_BEM2 (- WINK_RAD2 (/ pi 2))) (setq WINK_BEM3 (- WINK_RAD3 (/ pi 2))) (command "_align" PT0 PT01 (polar PT0 WINK_BEM1 200) "") (command "_align" PT01 PT02 (polar PT01 WINK_BEM2 200) "") (command "_align" PT02 PT03 (polar PT02 WINK_BEM3 200) "") (command "_exit") (command "_layer" "_m" "L-3" "_c" "3" "" "") ) ;------------------------------------------------------------------------------ (defun c:l_bg_2b ( / PT0 PT01 PT02 PT03 PT1 PT2 PT3 PT4 PT5 PT6 PT7 RADIUS ABSCHLUSS wink_rad1 wink_rad2 wink_rad3 wink_gra1 wink_gra2 wink_gra3 bez rad kleiner l1 l2 l3) (setvar "limcheck" 0) (prompt "**** Group of 2 STBL *******") (prompt "") (if (null m_RA) (setq m_RA "RA_1")) ; Radius 650 (if (null m_BEMASSEN) (setq m_BEMASSEN "1")) ; mit Bemaung (dbox) (datain) (setq KLEINER 0) (if (= RADIUS 1) (progn (geometrie-650) (setq RAD " R650") (if (or (< L1 800) (< L2 800)) (setq KLEINER 1) ) ) ) (if (= RADIUS 2) (progn (geometrie-400) (setq RAD " R400") (if (or (< L1 500) (< L2 500)) (setq KLEINER 1) ) ) ) (if (= RADIUS 3) (progn (geometrie-175) (setq RAD " R175") (if (or (< L1 400) (< L2 400)) (setq KLEINER 1) ) ) ) (if (= KLEINER 1) (setq BEZ (strcat "** BG 2 STBL(*)"RAD "/90- " (rtos L1) "-" (rtos L2) "-" (rtos L3) " + " (rtos MUFFE-ZAEHLER) " MUFFE(N)")) (setq BEZ (strcat "** BG 2 STBL"RAD "/90- " (rtos L1) "-" (rtos L2) "-" (rtos L3) " + " (rtos MUFFE-ZAEHLER) " MUFFE(N)")) ) (mach-block PT0 "0" auswahl-satz) (setq auswahl-satz nil) (attribute-aendern "0" "2" "1" "" "" block-kennung "111111111" (strcat BEZ " [BG1]") "" "") ; in SSTBASE.LSP (if (= m_BEMASSEN "1") (bemassung) ) (setvar "osmode" ALTFANG) ) ;------------------------------------------------------------------------------