;------------------------------------------------------------------------; ; ST- zeichnen ; ; -----------------------------------------------------------------------; ; AW 26.5.93 ; ;------------------------------------------------------------------------; (defun datain () ;------------------------------------------------------- ;>>>> Eingabeteil <<<<<<< ;------------------------------------------------------- (setq ALTFANG (getvar "osmode")) (setq AUSWAHL-SATZ nil) (initget (+ 1 2 4)) (setq P1 (getpoint "\n1. Punkt antippen: ")) (setq P2 (getpoint P1 "\n2. Punkt antippen: ")) (setvar "osmode" 0) (bl-name P1) ;--> Block-Name definieren -> Rckgabe: element-name ) (defun berechne() ;------------------------------------------------------ ;<<<<< Berechnungen durchfhren >>>>>>> ;------------------------------------------------------ ; (setq LAENGE (* (fix (/ (distance P1 P2) 5)) 5)) (setq LAENGE (fix (distance P1 P2))) (setq WINKEL (/ (* (angle P1 P2) 180) PI)) (setq P3 (polar P1 (angle P1 P2) (/ LAENGE 2))) (if (> LAENGE 6000) (progn (alert "Abstand ber 6000 mm !") (setvar "osmode" ALTFANG) (exit) ) ) (initget (+ 2 4)) (setq AUSFUEHRUNG (getint "\n(1)-OHNE oder (2)-MIT Leitblech <1> : ")) (if (or (= nil AUSFUEHRUNG) (< AUSFUEHRUNG 1) (> AUSFUEHRUNG 2)) (setq AUSFUEHRUNG 1) ) (if (= AUSFUEHRUNG 1) (setq NEV "ST ") (setq NEV "STL ") ) (initget "J N") (setq ANTWORT (getkword "\nMuffe am 2.Endpunkt anschweiáen ? (J/N) ?: ")) (if (not ANTWORT) (setq ANTWORT "N") ) (setq ANTWORT (strcase ANTWORT)) ;-------------------- ; Endstcke berechnen ;-------------------- (setq ENDST (- LAENGE (* (fix (/ LAENGE 500)) 500))) (if (and (>= ENDST 0) (< ENDST 160)) (progn (setq M_END1 250) (setq M_END2 (- (+ ENDST 500) M_END1)) ) ) (if (and (>= ENDST 160) (< ENDST 330)) (progn (setq M_END1 (/ ENDST 2)) (setq M_END2 M_END1) ) ) (if (and (>= ENDST 330) (<= ENDST 500)) (progn (setq M_END1 250) (setq M_END2 (- ENDST M_END1)) ) ) ) (defun geometrie() ;---------------------------------------------------------- ;<<<<<< Bl”cke einfgen >>>>>> ;---------------------------------------------------------- (if (= AUSFUEHRUNG 1) (command "_layer" "_m" "L-2" "_c" "2" "" "") (command "_layer" "_m" "L-7" "_c" "7" "" "") ) (command "_line" P3 P1 "") (setq AUSWAHL-SATZ (ssget "_L")) (command "_line" P3 P2 "") (ssadd (entlast) AUSWAHL-SATZ) (if (= AUSFUEHRUNG 1) (progn ;-------------------------------------- ;Artikel-Nr. abh„ngig von der L„nge ST ;-------------------------------------- (if (and (> LAENGE 0) (<= LAENGE 1000)) (setq M_ARTINR "821084001") ) (if (and (> LAENGE 1000) (<= LAENGE 2000)) (setq M_ARTINR "821084002") ) (if (and (> LAENGE 2000) (<= LAENGE 3000)) (setq M_ARTINR "821084003") ) (if (and (> LAENGE 3000) (<= LAENGE 4000)) (setq M_ARTINR "821084004") ) (if (and (> LAENGE 4000) (<= LAENGE 5000)) (setq M_ARTINR "821084005") ) (if (and (> LAENGE 5000) (<= LAENGE 6000)) (setq M_ARTINR "821084006") ) ) (progn ;---------------------------------------- ;Artikel-Nr. abh„ngig von der L„nge STL ;---------------------------------------- (if (and (> LAENGE 0) (<= LAENGE 1000)) (setq M_ARTINR "821084051") ) (if (and (> LAENGE 1000) (<= LAENGE 2000)) (setq M_ARTINR "821084052") ) (if (and (> LAENGE 2000) (<= LAENGE 3000)) (setq M_ARTINR "821084053") ) (if (and (> LAENGE 3000) (<= LAENGE 4000)) (setq M_ARTINR "821084054") ) (if (and (> LAENGE 4000) (<= LAENGE 5000)) (setq M_ARTINR "821084055") ) (if (and (> LAENGE 5000) (<= LAENGE 6000)) (setq M_ARTINR "821084056") ) ) ) ) (defun BEMASSUNG () ;--------- ; Bemaáung ;--------- (command "_layer" "_m" "L-10" "_c" "10" "" "") (command "_dim") (command "_dimtad" "0") (command "_dimtxt" "125") (command "_dimasz" "40") (command "_align" P1 P2 (polar P1 (- (angle P1 P2) (/ pi 2)) 200) (itoa LAENGE)) (command "_exit") (command "_layer" "_m" "L-2" "_c" "2" "" "") ) ;----------------------------------------------------------------- (defun c:schraub ( / P1 P2 LAENGE WINKEL M_ARTINR ENDST M_END1 M_END2 AUSFUEHRUNG) (setvar "limcheck" 0) (prompt "******* ST / STL (Schraubtr„ger OHNE oder MIT Leitblech) *******") (prompt "") (datain) (berechne) (geometrie) (mach-block P3 "0" AUSWAHL-SATZ) (if (= ANTWORT "J") (attribute-aendern "0" "2" "1" (itoa LAENGE) (strcat (itoa M_END1) "-" (itoa M_END2)) block-kennung M_ARTINR (strcat NEV "L= " (itoa LAENGE) " + 1 MUFFE") "" "") (attribute-aendern "0" "2" "1" (itoa LAENGE) (strcat (itoa M_END1) "-" (itoa M_END2)) block-kennung M_ARTINR (strcat NEV "L= " (itoa LAENGE)) "" "") ) (setq P3 (polar P1 (+ (angle P1 P2) (/ pi 6)) 100)) (command "_text" P3 "100" WINKEL (strcat NEV "L=" (itoa LAENGE))) ; (bemassung) (if (= ANTWORT "J") (progn (command "_layer" "_m" "L-1" "_c" "1" "" "") (command "_insert" (strcat lw "/acadsst/layout/muffe") P2 "" "" (rtos WINKEL)) (attribute-aendern "0" "0" "" "" "" block-kennung "825002017" "MUFFE ANGESCHWEISST (ST)" "" "") (if (= AUSFUEHRUNG 1) (command "_layer" "_m" "L-2" "_c" "2" "" "") (command "_layer" "_m" "L-7" "_c" "7" "" "") ) ) ) (setq AUSWAHL-SATZ nil) (setvar "osmode" ALTFANG) ) ;------------------------------------------------------------------