; Programm: "3D_Behälter.lsp" ; ; erstellt einen 3D Behälter ; Programmiert von : Hans Jürgen Scheeren ; am : 11.03.2008 ; geändert : 16.05.2008 ;**************************************************************** (defun c:3DBE ( / ) (setvar "cmdecho" 0) (command "osmode" "0" ) (command "ortho" "_off" ) (setq pickmode (getvar "pickstyle")) (setvar "pickstyle" 0) ;@@@@@@@@@@@@@@@@@@@@@@@@@@@@ ; ; Eingabewerte ; ;@@@@@@@@@@@@@@@@@@@@@@@@@@@@ (setq bedurchm (getreal "\nBehälter Durchmesser: ")) (setq behoe (getreal "\nBehälterhöhe: ")) (setq befues (getreal "\nHöhe Behälterfüsse: ")) (setq startpkt (getpoint "\nEinfügepunkt wählen: ")) (setq xstart (car startpkt)) (setq ystart (car (cdr startpkt))) ;@@@@@@@@@@@@@@@@@@@@@@@@@@@@ ; ; Berechnung der Bogen ; ;@@@@@@@@@@@@@@@@@@@@@@@@@@@@ (setq hk (- (* 0.1935 bedurchm) (* 0.445 3.0))) (setq r1 bedurchm) (setq r2 (* bedurchm 0.1)) (setq zw1 (- r1 r2)) (setq zw2 (- (* bedurchm 0.5) r2)) (setq zw3 (sqrt (- (expt zw1 2) (expt zw2 2)))) (setq dx1 (* (/ zw2 zw1) r1)) (setq r3 (* bedurchm 0.05));Durchmesser Behälterfüsse ;@@@@@@@@@@@@@@@@@@@@@@@@@@@@ ; ; Koordinaten ; ;@@@@@@@@@@@@@@@@@@@@@@@@@@@@ ;Mittellinie (setq X1 xstart) (setq Y1 ystart) (setq X2 xstart) (setq Y2 (+ ystart behoe)) ;erster Bogengroß (setq X3 (- xstart dx1)) (setq Y3 (- (+ ystart behoe) (- hk r2))) (setq r1x xstart) (setq r1y (- (+ ystart behoe) zw3)) ;zweiter Bogenklein (setq X4 (- xstart (* bedurchm 0.5))) (setq Y4 (- (+ ystart behoe) hk)) (setq r2x (- xstart zw2)) (setq r2y (- (+ ystart behoe) hk)) ;Behälterwand (setq X5 (- xstart (* bedurchm 0.5))) (setq Y5 (+ ystart hk)) ;dritte Bogenklein (setq X6 (- xstart dx1)) (setq Y6 (- (+ ystart hk) r2)) (setq r3x (- xstart zw2)) (setq r3y (+ ystart hk)) ;vierter Bogengroß (setq r4x xstart) (setq r4y (+ ystart zw3)) ;Z-Höhe Behälter (setq X7 xstart) (setq Y7 (+ ystart befues)) ;Behälterfüsse (setq X8 (- xstart dx1)) (setq Y8 ystart) (setq X9 (- xstart zw2)) (setq Y9 (+ (+ ystart befues) r2)) ;@@@@@@@@@@@@@@@@@@@@@@@@@@@@ ; ; Listen ; ;@@@@@@@@@@@@@@@@@@@@@@@@@@@@ (setq p1 (list X1 Y1 0.0)) (setq p2 (list X2 Y2 0.0)) (setq p3 (list X3 Y3 0.0)) (setq p4 (list X4 Y4 0.0)) (setq p5 (list X5 Y5 0.0)) (setq p6 (list X6 Y6 0.0)) (setq p7 (list X7 Y7 0.0)) (setq p8 (list X8 Y8 0.0)) (setq p9 (list X9 Y9 0.0)) (setq RA1 (list r1x r1y 0.0)) (setq RA2 (list r2x r2y 0.0)) (setq RA3 (list r3x r3y 0.0)) (setq RA4 (list r4x r4y 0.0)) ;@@@@@@@@@@@@@@@@@@@@@@@@@@@@ ; ; Behälter Zeichnen ; ;@@@@@@@@@@@@@@@@@@@@@@@@@@@@ (command "_line" p1 p2 "") (setq e1 (entlast)) (command "_arc" p2 "_e" p3 "_r" RA1 "") (setq e2 (entlast)) (command "_arc" p3 "_e" p4 "_r" RA2 "") (setq e3 (entlast)) (command "_line" p4 p5 "") (setq e4 (entlast)) (command "_arc" p5 "_e" p6 "_r" RA3 "") (setq e5 (entlast)) (command "_arc" p6 "_e" p1 "_r" RA4 "") (setq e6 (entlast)) ; Basispunkt und Mittellinie zeichnen (command "_color" "1" "") (command "_line" p1 p2 "")(setq ml1 (entlast)) (command "_point" p1) (command "_color" "_bylayer" "") ; in Polyline umwandeln und Voloumenkörper erstellen (command "pedit" e1 "" "v" e2 e3 e4 e5 e6 "" "") (setq e7 (entlast)) (command "_revolve" e7 "" p1 p2 "") (setq e8 (entlast)) ;@@@@@@@@@@@@@@@@@@@@@@@@@@@@ ; ; Behälterfüsse ; ;@@@@@@@@@@@@@@@@@@@@@@@@@@@@ ;Behälter Z-Höhe setzen (command "_move" e8 ml1 "" p1 p7 "") ;Behälter füsse (command "_line" p8 p9 "") (setq e9 (entlast)) (command "_rotate3d" e8 ml1 e9 "" "x" p1 "90" "") (command "_circle" p8 r3 "") (command "_extrude" "_last" "" "Pfad" e9 ) (command "_copy" "_last" "" p1 p1 "") (command "_rotate" "_last" "" p1 "120" ) (command "_copy" "_last" "" p1 p1 "") (command "_rotate" "_last" "" p1 "120" ) ;@@@@@@@@@@@@@@@@@@@@@@@@@@@@ ; ; endlich Fertig ; ;@@@@@@@@@@@@@@@@@@@@@@@@@@@@ (setvar "pickstyle" pickmode) (command "_ucs" "_w" ) (setvar "cmdecho" 1) (princ) ) (princ "starten mit 3DBE")