Files

112 lines
3.6 KiB
Common Lisp

;------------------------------------------------------------------------;
; ST- zeichnen ;
; - Block \prog\acad\layout\ST.DWG setzen und den Gegebenheiten ;
; anpassen. ;
; - Anschlieáend mssen die Atribute ge„ndert werden ;
; -----------------------------------------------------------------------;
; AW 02.4.93 ;
;------------------------------------------------------------------------;
(defun datain ()
;-------------------------------------------------------
;>>>> Eingabeteil <<<<<<<
;-------------------------------------------------------
(setq ALTFANG (getvar "osmode"))
(setq P1 (getpoint "\n1. Punkt antippen: "))
(setq P2 (getpoint P1 "\n2. Punkt antippen: "))
(setvar "osmode" 0)
)
(defun berechne()
;------------------------------------------------------
;<<<<< Berechnungen durchfhren >>>>>>>
;------------------------------------------------------
(setq LAENGE (* (fix (/ (distance P1 P2) 5)) 5))
(setq WINKEL (/ (* (angle P1 P2) 180) PI))
(if (> LAENGE 6000)
(exit)
)
;--------------------
; 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 >>>>>>
;----------------------------------------------------------
(command "_layer" "_m" "L-7" "_c" "7" "" "")
(command "_insert" (strcat lw "/acadsst/layout/st") P1 LAENGE "1" WINKEL)
;-----------------------------------
;Artikel-Nr. abh„ngig von der L„nge
;-----------------------------------
(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) "")
(command "_exit")
(command "_layer" "_m" "L-7" "_c" "7" "" "")
)
;-----------------------------------------------------------------
(defun c:stl ( / P1 P2 LAENGE WINKEL M_ARTINR ENDST M_END1 M_END2)
(setvar "limcheck" 0)
(prompt "******* ST (Schraubtr„ger MIT Leitblech) *******")
(prompt "")
(datain)
(berechne)
(geometrie)
(attribute-aendern "0" "2" "1" (itoa LAENGE) (itoa M_END1) (itoa M_END2)
M_ARTINR (strcat "STL L= " (itoa LAENGE)))
(setq P3 (polar P1 (+ (angle P1 P2) (/ pi 6)) 100))
(command "_text" P3 "100" WINKEL (strcat "ST L=" (itoa LAENGE)))
(bemassung)
(setvar "osmode" ALTFANG)
)
;------------------------------------------------------------------