445 lines
14 KiB
Common Lisp
445 lines
14 KiB
Common Lisp
;------------------------------------------------------------------------;
|
|
; SCHRAUB1 - STRECKEN/PROFILE /DRT ;
|
|
; -----------------------------------------------------------------------;
|
|
; AW 17.06.32007 ;
|
|
;------------------------------------------------------------------------;
|
|
|
|
(defun Dbox (/ Dat)
|
|
(setq Dat (load_dialog (strcat lw "/acadsst/layout/SCHRAUB1.DCL")))
|
|
(if (not (new_dialog "SCHRAUB1" Dat))
|
|
(exit)
|
|
)
|
|
(set_tile "ART" m_ART)
|
|
(set_tile "BEMASS" m_BEMASS)
|
|
(set_tile "ST_MUFFE" m_ST_MUFFE)
|
|
|
|
(SetDia)
|
|
(ACTION_TILE "ART" "(zeig_dia)")
|
|
(ACTION_TILE "ST_MUFFE" "(zeig_dia)")
|
|
(action_tile "help" "(acad_helpdlg \HIDATEI\ \"LAUFPROFIL\")" )
|
|
(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 (and (= m_ART "ART_1") (= m_ST_MUFFE "1")) ; ST
|
|
(slide_image 0 0 breite hoehe "layout(st_verb)")
|
|
(slide_image 0 0 breite hoehe "layout(1)")
|
|
)
|
|
(if (and (= m_ART "ART_2") (= m_ST_MUFFE "1")) ; STL
|
|
(slide_image 0 0 breite hoehe "layout(st_verb)")
|
|
(slide_image 0 0 breite hoehe "layout(1)")
|
|
)
|
|
(if (and (= m_ART "ART_3") (= m_ST_MUFFE "1")) ; AP110
|
|
(slide_image 0 0 breite hoehe "layout(ap_verb1)")
|
|
(slide_image 0 0 breite hoehe "layout(1)")
|
|
)
|
|
(if (and (= m_ART "ART_4") (= m_ST_MUFFE "1")) ; APG110
|
|
(slide_image 0 0 breite hoehe "layout(ap_verb1)")
|
|
(slide_image 0 0 breite hoehe "layout(1)")
|
|
)
|
|
(if (and (= m_ART "ART_5") (= m_ST_MUFFE "1")) ; AP60
|
|
(slide_image 0 0 breite hoehe "layout(ap_verb1)")
|
|
(slide_image 0 0 breite hoehe "layout(1)")
|
|
)
|
|
(if (and (= m_ART "ART_6") (= m_ST_MUFFE "1")) ; APS110
|
|
(slide_image 0 0 breite hoehe "layout(ap_verb2)")
|
|
(slide_image 0 0 breite hoehe "layout(1)")
|
|
)
|
|
(if (and (= m_ART "ART_7") (= m_ST_MUFFE "1")) ; DRT80
|
|
(slide_image 0 0 breite hoehe "layout(rt_verb1)")
|
|
(slide_image 0 0 breite hoehe "layout(1)")
|
|
)
|
|
(if (and (= m_ART "ART_8") (= m_ST_MUFFE "1")) ; RT 80/80
|
|
(slide_image 0 0 breite hoehe "layout(rt_verb1)")
|
|
(slide_image 0 0 breite hoehe "layout(1)")
|
|
)
|
|
(if (and (= m_ART "ART_9") (= m_ST_MUFFE "1")) ; DRT114
|
|
(slide_image 0 0 breite hoehe "layout(rt_verb1)")
|
|
(slide_image 0 0 breite hoehe "layout(1)")
|
|
)
|
|
(if (and (= m_ART "ART_10") (= m_ST_MUFFE "1")) ; ROHR 1x2.6
|
|
(slide_image 0 0 breite hoehe "layout(rt_verb2)")
|
|
(slide_image 0 0 breite hoehe "layout(1)")
|
|
)
|
|
(end_image)
|
|
)
|
|
|
|
(defun zeig_dia()
|
|
(setq m_ART (get_tile "ART"))
|
|
(setq m_ST_MUFFE (get_tile "ST_MUFFE"))
|
|
(SetDia)
|
|
)
|
|
|
|
(defun SetPara ()
|
|
(setq m_ART (get_tile "ART"))
|
|
(setq m_BEMASS (get_tile "BEMASS"))
|
|
(setq m_ST_MUFFE (get_tile "ST_MUFFE"))
|
|
(zeig_dia)
|
|
;-----------------------------------------------
|
|
(initget (+ 2 4))
|
|
;---------------------------------------
|
|
)
|
|
|
|
(defun datain ()
|
|
;-------------------------------------------------------
|
|
;>>>> Eingabeteil <<<<<<<
|
|
;-------------------------------------------------------
|
|
; (setq GEF_GRAD (atof m_GRAD)) ; Winkel
|
|
; (setq ANZ_BEARB (atoi m_BEARB))
|
|
(initget (+ 1 2 4))
|
|
(command "_elevation" "0")
|
|
(command "_fill" "_off")
|
|
(setvar "osmode" ALTFANG)
|
|
(setq P1 (getpoint "\n1. Punkt antippen: "))
|
|
(setq P2 (getpoint P1 "\n2. Punkt antippen: "))
|
|
(setvar "osmode" 0)
|
|
(setq LAENGE (distance P1 P2))
|
|
(setq LAENGE1 (distance P1 P2))
|
|
(setq WINKEL (angle P1 P2))
|
|
)
|
|
|
|
(defun berechne()
|
|
(setq P4 (polar P1 (+ WINKEL (/ pi 2)) 40))
|
|
(setq P5 (polar P1 (- WINKEL (/ pi 2)) 40))
|
|
(setq P6 (polar P2 (+ WINKEL (/ pi 2)) 40))
|
|
(setq P7 (polar P2 (- WINKEL (/ pi 2)) 40))
|
|
|
|
(setq P11 (polar P1 WINKEL 100))
|
|
(setq P12 (polar P11 (+ WINKEL (/ pi 2)) 30))
|
|
(setq P13 (polar P2 (+ WINKEL pi) 100))
|
|
(setq P14 (polar P13 (+ WINKEL (/ pi 2)) 30))
|
|
)
|
|
|
|
(defun geometrie()
|
|
(setvar "osmode" 0)
|
|
(command "_thickness" "0")
|
|
|
|
(cond
|
|
((= m_ART "ART_1") ; ST
|
|
(setq M_PROFILART "ST")
|
|
(setq M_EBENE "L-2")
|
|
(setq M_FARBE "2")
|
|
(setq M_BEZ "ST L= ")
|
|
)
|
|
((= m_ART "ART_2") ; STL
|
|
(setq M_PROFILART "STL")
|
|
(setq M_EBENE "L-7")
|
|
(setq M_FARBE "7")
|
|
(setq M_BEZ "STL L= ")
|
|
)
|
|
((= m_ART "ART_3") ; AP110
|
|
(setq M_PROFILART "AP110")
|
|
(setq M_EBENE "A-7")
|
|
(setq M_FARBE "7")
|
|
(setq M_BEZ "AP110 L= ")
|
|
)
|
|
((= m_ART "ART_4") ; APG110
|
|
(setq M_PROFILART "APG110")
|
|
(setq M_EBENE "A-2")
|
|
(setq M_FARBE "2")
|
|
(setq M_BEZ "APG110 L= ")
|
|
)
|
|
((= m_ART "ART_5") ; AP60
|
|
(setq M_PROFILART "AP60")
|
|
(setq M_EBENE "A-4")
|
|
(setq M_FARBE "4")
|
|
(setq M_BEZ "AP60 L= ")
|
|
)
|
|
((= m_ART "ART_6") ; APS110
|
|
(setq M_PROFILART "APS110")
|
|
(setq M_EBENE "A-1")
|
|
(setq M_FARBE "1")
|
|
(setq M_BEZ "APS110 L= ")
|
|
)
|
|
((= m_ART "ART_7") ; DRT80
|
|
(setq M_PROFILART "DRT80")
|
|
(setq M_EBENE "D-1")
|
|
(setq M_FARBE "1")
|
|
(setq M_BEZ "DRT80 L= ")
|
|
)
|
|
((= m_ART "ART_8") ; RT 80/80
|
|
(setq M_PROFILART "RT 80/80")
|
|
(setq M_EBENE "D-5")
|
|
(setq M_FARBE "5")
|
|
(setq M_BEZ "RT 80/80 L= ")
|
|
)
|
|
((= m_ART "ART_9") ; DRT114
|
|
(setq M_PROFILART "DRT114")
|
|
(setq M_EBENE "D-3")
|
|
(setq M_FARBE "3")
|
|
(setq M_BEZ "DRT114 L= ")
|
|
)
|
|
((= m_ART "ART_10") ; ROHR 1x2.6
|
|
(setq M_PROFILART "ROHR")
|
|
(setq M_EBENE "D-6")
|
|
(setq M_FARBE "6")
|
|
(setq M_BEZ "ROHR 1X2.6 L= ")
|
|
)
|
|
) ; endcond
|
|
|
|
|
|
(setvar "osmode" 0)
|
|
(setq ANZAHL (fix (/ LAENGE 6000)))
|
|
|
|
(if (= ANZAHL 0) ; Länge < 6000 -> es gibt nur ein Stück
|
|
(progn
|
|
(ARTIKELNR LAENGE M_PROFILART)
|
|
(TRAEGER LAENGE WINKEL P1 P2 M_EBENE M_FARBE M_ARTINR M_BEZ)
|
|
)
|
|
)
|
|
|
|
(setq ZAEHLER 1)
|
|
(setq P_TEMP1 P1)
|
|
(setq P_TEMP2 P1)
|
|
(while (and (> ANZAHL 0) (<= ZAEHLER ANZAHL)) ; 6000 mm Stücke setzen
|
|
(setq ZAEHLER (1+ ZAEHLER))
|
|
(setq P_TEMP1 P_TEMP2)
|
|
(setq P_TEMP2 (polar P_TEMP1 WINKEL 6000))
|
|
(ARTIKELNR 6000 M_PROFILART)
|
|
(TRAEGER 6000 WINKEL P_TEMP1 P_TEMP2 M_EBENE M_FARBE M_ARTINR M_BEZ)
|
|
|
|
(setq LAENGE (- LAENGE 6000))
|
|
)
|
|
|
|
;-- Reststück
|
|
(if (and (> ANZAHL 0) (> LAENGE 0))
|
|
(progn
|
|
(ARTIKELNR LAENGE M_PROFILART)
|
|
(TRAEGER LAENGE WINKEL P_TEMP2 P2 M_EBENE M_FARBE M_ARTINR M_BEZ)
|
|
(= LAENGE 0)
|
|
)
|
|
)
|
|
(setvar "osmode" ALTFANG)
|
|
|
|
;-------------------------------------------------------------------------------------------
|
|
)
|
|
|
|
;********************************************************************
|
|
(defun TRAEGER (T_LAENGE WINKEL T1 T2 EBENE FARBE ARTINR BEZEICHNUNG)
|
|
;********************************************************************
|
|
(bl-name T1) ;--> Block-Name definieren -> R�ckgabe: element-name
|
|
(command "_layer" "_m" EBENE "_c" FARBE "" "")
|
|
(command "_line" T1 T2 "")
|
|
(setq AUSWAHL-SATZ1 (ssget "_L"))
|
|
|
|
(mach-block T1 "0" AUSWAHL-SATZ1) ; Profil erstellen
|
|
(attribute-aendern "0" "2" "3" (rtos T_LAENGE) "0" block-kennung ARTINR (strcat BEZEICHNUNG (rtos T_LAENGE)) "1" "")
|
|
(setq AUSWAHL-SATZ (ssget "_L"))
|
|
|
|
(if (= m_ST_MUFFE "1") ; Verbindungselemente setzen
|
|
(progn
|
|
(cond
|
|
((or (= m_ART "ART_1") (= m_ART "ART_2")) ; ST oder STL
|
|
(command "_layer" "_m" "L-1" "_c" "1" "" "")
|
|
(command "_insert" (strcat lw "/acadsst/layout/muffe") T2 "" "" (rtos (/ (* WINKEL 180) pi)))
|
|
(attribute-aendern "0" "0" "" "" "" block-kennung "825002017" "MUFFE ANGESCHWEISST (ST)" "" "")
|
|
)
|
|
((or (= m_ART "ART_3") (= m_ART "ART_4") (= m_ART "ART_5")) ; AP110,APG110 oder AP60
|
|
(command "_layer" "_m" "A-3" "_c" "3" "" "")
|
|
(command "_insert" (strcat lw "/acadsst/alu/821114001") T2 "" "" (rtos (/ (* WINKEL 180) pi)))
|
|
(attribute-aendern "0" "0" "" "" "" block-kennung "" "" "2" "")
|
|
)
|
|
((= m_ART "ART_6") ; APS110
|
|
(command "_layer" "_m" "A-3" "_c" "3" "" "")
|
|
(command "_insert" (strcat lw "/acadsst/alu/821114043") T2 "" "" (rtos (/ (* WINKEL 180) pi)))
|
|
(attribute-aendern "0" "0" "" "" "" block-kennung "" "" "2" "")
|
|
)
|
|
((or (= m_ART "ART_7") (= m_ART "ART_8") (= m_ART "ART_9")) ; DRT80, RT80/80 oder DRT114
|
|
(command "_layer" "_m" "D-1" "_c" "1" "" "")
|
|
(command "_insert" (strcat lw "/acadsst/rohr/d_muffe") T2 "" "" (rtos (/ (* WINKEL 180) pi)))
|
|
(attribute-aendern "0" "0" "" "" "" block-kennung "825004007" "MUFFE ANGESCHWEISST" "2" "")
|
|
)
|
|
((= m_ART "ART_10") ; ROHR 1x2.6
|
|
(command "_layer" "_m" "D-1" "_c" "1" "" "")
|
|
(command "_insert" (strcat lw "/acadsst/rohr/d_muffe") T2 "" "" (rtos (/ (* WINKEL 180) pi)))
|
|
(attribute-aendern "0" "0" "" "" "" block-kennung "825004007" "MUFFE ANGESCHWEISST" "1" "")
|
|
)
|
|
) ; endcond
|
|
)
|
|
)
|
|
|
|
(if (= m_BEMASS "1")
|
|
(bemassung T1 T2 WINKEL 1)
|
|
)
|
|
)
|
|
|
|
;********************************************************************
|
|
(defun ARTIKELNR (LAENGE PROFILART)
|
|
;********************************************************************
|
|
(if (= PROFILART "ST")
|
|
(progn
|
|
(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")
|
|
)
|
|
)
|
|
)
|
|
(if (= PROFILART "STL")
|
|
(progn
|
|
(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")
|
|
)
|
|
)
|
|
)
|
|
(if (= PROFILART "AP110")
|
|
(setq M_ARTINR "821106001")
|
|
)
|
|
(if (= PROFILART "APG110")
|
|
(setq M_ARTINR "821106002")
|
|
)
|
|
(if (= PROFILART "AP60")
|
|
(setq M_ARTINR "821096001")
|
|
)
|
|
(if (= PROFILART "APS110")
|
|
(setq M_ARTINR "821076001")
|
|
)
|
|
(if (= PROFILART "DRT80")
|
|
(progn
|
|
(if (and (> LAENGE 0) (<= LAENGE 1000))
|
|
(setq M_ARTINR "825084001")
|
|
)
|
|
(if (and (> LAENGE 1000) (<= LAENGE 2000))
|
|
(setq M_ARTINR "825084002")
|
|
)
|
|
(if (and (> LAENGE 2000) (<= LAENGE 3000))
|
|
(setq M_ARTINR "825084003")
|
|
)
|
|
(if (and (> LAENGE 3000) (<= LAENGE 4000))
|
|
(setq M_ARTINR "825084004")
|
|
)
|
|
(if (and (> LAENGE 4000) (<= LAENGE 5000))
|
|
(setq M_ARTINR "825084005")
|
|
)
|
|
(if (and (> LAENGE 5000) (<= LAENGE 6000))
|
|
(setq M_ARTINR "825084006")
|
|
)
|
|
)
|
|
)
|
|
(if (= PROFILART "RT 80/80")
|
|
(progn
|
|
(if (and (> LAENGE 0) (<= LAENGE 1000))
|
|
(setq M_ARTINR "825144001")
|
|
)
|
|
(if (and (> LAENGE 1000) (<= LAENGE 2000))
|
|
(setq M_ARTINR "825144002")
|
|
)
|
|
(if (and (> LAENGE 2000) (<= LAENGE 3000))
|
|
(setq M_ARTINR "825144003")
|
|
)
|
|
(if (and (> LAENGE 3000) (<= LAENGE 4000))
|
|
(setq M_ARTINR "825144004")
|
|
)
|
|
(if (and (> LAENGE 4000) (<= LAENGE 5000))
|
|
(setq M_ARTINR "825144005")
|
|
)
|
|
(if (and (> LAENGE 5000) (<= LAENGE 6000))
|
|
(setq M_ARTINR "825144006")
|
|
)
|
|
)
|
|
)
|
|
(if (= PROFILART "DRT114")
|
|
(progn
|
|
(if (and (> LAENGE 0) (<= LAENGE 1000))
|
|
(setq M_ARTINR "825104001")
|
|
)
|
|
(if (and (> LAENGE 1000) (<= LAENGE 2000))
|
|
(setq M_ARTINR "825104002")
|
|
)
|
|
(if (and (> LAENGE 2000) (<= LAENGE 3000))
|
|
(setq M_ARTINR "825104003")
|
|
)
|
|
(if (and (> LAENGE 3000) (<= LAENGE 4000))
|
|
(setq M_ARTINR "825104004")
|
|
)
|
|
(if (and (> LAENGE 4000) (<= LAENGE 5000))
|
|
(setq M_ARTINR "825104005")
|
|
)
|
|
(if (and (> LAENGE 5000) (<= LAENGE 6000))
|
|
(setq M_ARTINR "825104006")
|
|
)
|
|
)
|
|
)
|
|
(if (= PROFILART "ROHR")
|
|
(setq M_ARTINR "821006026")
|
|
)
|
|
)
|
|
|
|
(defun BEMASSUNG (T1 T2 WINKEL VERSATZ)
|
|
(command "_layer" "_m" "BEMASSUNG" "_c" "8" "" "")
|
|
(command "_dimaligned" T1 T2 (polar T1 (- WINKEL (/ pi 2)) (* VERSATZ -125)))
|
|
)
|
|
;-----------------------------------------------------------------
|
|
(defun c:SCHRAUB1 ( / ART WINKEL NEV P1 P2 P3 P4 P5 P6 ARTINR1 ARTINR2 ARTINR3
|
|
ARTINR4 ARTINR5 NEV SEP)
|
|
(command "_ucs" "_w")
|
|
(command "_dimtad" "0")
|
|
(command "_dimtxt" "75")
|
|
(command "_dimasz" "75")
|
|
(command "_dimexo" "35")
|
|
(command "_dimexe" "35")
|
|
(command "_dimtix" "1")
|
|
(command "_dimzin" "0")
|
|
(setq ALTFANG (getvar "osmode"))
|
|
(setq HIDATEI (strcat lw "/acadsst/hfs/hfs.hlp"))
|
|
(setvar "limcheck" 0)
|
|
(setq AUSWAHL-SATZ nil)
|
|
(setq SATZ1 nil)
|
|
(setq SATZ2 nil)
|
|
(setq ALTFANG (getvar "osmode"))
|
|
(prompt "******* ILS 2100 LAUFPROFIL *******")
|
|
(prompt "")
|
|
(if (null m_ART) (setq m_ART "ART_1")) ; LP
|
|
(if (null m_BEMASS) (setq m_BEMASS "0")) ; keine Bemassung
|
|
(if (null m_ST_MUFFE) (setq m_ST_MUFFE "ST_MUFFE")) ; Verbindungselemente
|
|
(Dbox)
|
|
(datain)
|
|
(berechne)
|
|
(geometrie)
|
|
; (if (= m_BEMASS "1")
|
|
; (bemassung)
|
|
; )
|
|
(command "_ucs" "_w")
|
|
(setq AUSWAHL-SATZ nil)
|
|
(setq SATZ1 nil)
|
|
(setq SATZ2 nil)
|
|
(setvar "osmode" ALTFANG)
|
|
(command "_thickness" "0")
|
|
(command "_elevation" "0")
|
|
)
|