(in-package :EXAMPLES) (use-package :OLI) ;-------------------------------------------------------------------------------_ ;-------------------------------------------------------------------------------_ (sd-defdialog 'am-bogenmass :dialog-title "Tabelle BogenmaÞ" :variables '( ("Position") (Startpunkt :value-type :docupoint :toggle-value-type :defundef) ("Durchmesser") (Durchmesser :value-type :distance :prompt-text "Ò angeben." :initial-value 0) ("Texteinstellungen") (TSIZE :range (2 2.5 3.5 5 7) :prompt-text "TextgrÎÞe angeben." :title "TextgrÎÞe" :initial-value 5 #| :after-input (progn (cond ((= TSIZE 2) (setf TFARBE 0,0,1)) ;;Blau ((= TSIZE 3.5) (setf TFARBE 1,1,1)) ;;Weiß ((= TSIZE 5) (setf TFARBE 1,1,0)) ;;Gelb ((= TSIZE 7) (setf TFARBE 0,1,0)) ;;Grün );;cond );;progn |# );;TSIZE (TFONT :range ("hp_i3098_v" "hp_i3098_c" "hp_block_v") :initial-value "hp_i3098_v" :prompt-text "Schriftart fÏr Tabellentext angeben." :title "Schriftart") (TFARBE :value-type :rgb-color :initial-value (sd-rgb-to-color 0,1,0) :title (sd-multi-lang-string "Color" :german "Farbe")) ;; ("Tabelleneinstellungen") ;; (GSIZE2 ;; :value-type :positive-number ;; :prompt-text "ZeilenhÎhe" ;; :title "ZeilenhÎhe" ;; :initial-value (+ TSIZE 2)) ;; (TFARBE2 ;; :value-type :rgb-color ;; :initial-value (sd-rgb-to-color 1,1,1) ;; :title (sd-multi-lang-string "Color" :german "Farbe")) ;; Eingabe der Winkel, Berechnung der Bogemaße für Winkel >0 ("Winkel in Grad") (Winkel_1 :value-type :angle :title "Winkel 1" :prompt-text "1. Winkel angeben." :initial-value 0) (Winkel_2 :value-type :angle :title "Winkel 2" :prompt-text "2. Winkel angeben." :initial-value 0) (Winkel_3 :value-type :angle :title "Winkel 3" :prompt-text "3. Winkel angeben." :initial-value 0) (Winkel_4 :value-type :angle :title "Winkel 4" :prompt-text "4. Winkel angeben." :initial-value 0) (Winkel_5 :value-type :angle :title "Winkel 5" :prompt-text "5. Winkel angeben." :initial-value 0) (Winkel_6 :value-type :angle :title "Winkel 6" :prompt-text "6. Winkel angeben." :initial-value 0) (Winkel_7 :value-type :angle :title "Winkel 7" :prompt-text "7. Winkel angeben." :initial-value 0) (Winkel_8 :value-type :angle :title "Winkel 8" :prompt-text "8. Winkel angeben." :initial-value 0) (Winkel_9 :value-type :angle :title "Winkel 9" :prompt-text "9. Winkel angeben." :initial-value 0) (Winkel_10 :value-type :angle :title "Winkel 10" :prompt-text "10. Winkel angeben." :initial-value 0) (Winkel_11 :value-type :angle :title "Winkel 11" :prompt-text "10. Winkel angeben." :initial-value 0) (Winkel_12 :value-type :angle :title "Winkel 12" :prompt-text "10. Winkel angeben." :initial-value 0) (Winkel_13 :value-type :angle :title "Winkel 13" :prompt-text "10. Winkel angeben." :initial-value 0) (Winkel_14 :value-type :angle :title "Winkel 14" :prompt-text "10. Winkel angeben." :initial-value 0) (Winkel_15 :value-type :angle :title "Winkel 15" :prompt-text "10. Winkel angeben." :initial-value 0) ) :local-functions '((draw-2d-text(text x y) () (sd-execute-annotator-command :cmd (format nil "TEXT '~A' ~A,~A END" text x (oli:sd-num-to-string y 2)))) (draw-2d-line(x1 y1 x2 y2) (sd-execute-annotator-command :cmd (format nil "LINE ~A,~A ~A,~A END" x1 y1 x2 y2))) ) :ok-action '(progn ;; Skizze erzeugen (sd-am-create-sketch :name "TAB_Bogen" :position Startpunkt :owner_type :current-sheet) ;; Schreibe Default-Texte und Bogenmasse auf Zeichnungsblatt ;; Texteinstellungen setzen (sd-call-cmds (am_text_settings :size TSIZE :fill :OFF :ratio 1 :slant 0 :abs_angle 0 :linesp 1.5 :font1b TFONT :font2b "hp_kanji_c" :color TFARBE) ) ;; Tabellentexte schreiben (draw-2d-text "Ò" (+ (gpnt2d_x Startpunkt) 1) (- (gpnt2d_y Startpunkt) (* 2 TSIZE) -2)) (draw-2d-text Durchmesser (+ (gpnt2d_x Startpunkt) 60) (- (gpnt2d_y Startpunkt) (* 2 TSIZE) -2) ) (draw-2d-text "Winkel [Grad]" (+ (gpnt2d_x Startpunkt) 1) (- (gpnt2d_y Startpunkt) (* 6 TSIZE) -2) ) (draw-2d-text "BogenmaÞ [mm]" (+ (gpnt2d_x Startpunkt) 60) (- (gpnt2d_y Startpunkt) (* 6 TSIZE) -2) ) (let ((winkelliste (list Winkel_1 Winkel_2 Winkel_3 Winkel_4 Winkel_5 Winkel_6 Winkel_7 Winkel_8 Winkel_8 Winkel_9 Winkel_10 Winkel_11 Winkel_12 Winkel_13 Winkel_14 Winkel_15)) (yoffset 8) bogenmass) (dolist (w winkelliste) (setf bogenmass (* 0.5 w Durchmesser)) ;; Prüfen ob Bogenmass dargestellt werden muss (when (> bogenmass 0) (draw-2d-text (* w 180 (/ 1 pi)) (+ (gpnt2d_x Startpunkt) 1) (- (gpnt2d_y Startpunkt) (* yoffset TSIZE) -2)) (draw-2d-text bogenmass (+ (gpnt2d_x Startpunkt) 60) (- (gpnt2d_y Startpunkt) (* yoffset TSIZE) -2) ) (draw-2d-line (gpnt2d_x Startpunkt) (- (gpnt2d_y Startpunkt) (* yoffset TSIZE)) (+ (gpnt2d_x Startpunkt) (* 25 TSIZE)) (- (gpnt2d_y Startpunkt) (* yoffset TSIZE)) ) (setf yoffset (+ 2 yoffset)))) ) ;-------------------------------------------------------------------------------_ ;-------------------------------------------------------------------------------_ ;; Zeichne Tabelle auf Zeichnungsblatt (am_geo_default :color :rgb 1,1,1) (draw-2d-line (gpnt2d_x Startpunkt) (gpnt2d_y Startpunkt) (+ (gpnt2d_x Startpunkt) (* 25 TSIZE)) ;; 20 = Länge der oberen Linie (gpnt2d_y Startpunkt) ) (draw-2d-line (gpnt2d_x Startpunkt) (- (gpnt2d_y Startpunkt) (* 2 TSIZE)) (+ (gpnt2d_x Startpunkt) (* 25 TSIZE)) ;; 20 = Länge der unteren Linie (- (gpnt2d_y Startpunkt) (* 2 TSIZE)) ) (draw-2d-line (gpnt2d_x Startpunkt) (- (gpnt2d_y Startpunkt) (* 4 TSIZE)) (+ (gpnt2d_x Startpunkt) (* 25 TSIZE)) ;; 20 = Länge der unteren Linie (- (gpnt2d_y Startpunkt) (* 4 TSIZE)) ) (draw-2d-line (gpnt2d_x Startpunkt) (- (gpnt2d_y Startpunkt) (* 6 TSIZE)) (+ (gpnt2d_x Startpunkt) (* 25 TSIZE)) ;; 20 = Länge der unteren Linie (- (gpnt2d_y Startpunkt) (* 6 TSIZE)) ) (draw-2d-line (gpnt2d_x Startpunkt) (- (gpnt2d_y Startpunkt) (* 8 TSIZE)) (+ (gpnt2d_x Startpunkt) (* 25 TSIZE)) ;; 20 = Länge der unteren Linie (- (gpnt2d_y Startpunkt) (* 8 TSIZE)) ) ;; Zeichnen der senkrechten Linien (draw-2d-line (gpnt2d_x Startpunkt) (- (gpnt2d_y Startpunkt) (* 2 TSIZE)) ;; 1= Länge der 1. senkrechten Linie (gpnt2d_x Startpunkt) (- (gpnt2d_y Startpunkt) (* 0 2 TSIZE)) ;; *0??? ) (draw-2d-line (+ (gpnt2d_x Startpunkt) (* 11 TSIZE)) (- (gpnt2d_y Startpunkt) (* 2 TSIZE)) (+ (gpnt2d_x Startpunkt) (* 11 TSIZE)) (- (gpnt2d_y Startpunkt) (* 0 2 TSIZE)) ;; *0??? ) (draw-2d-line (+ (gpnt2d_x Startpunkt) (* 25 TSIZE)) (- (gpnt2d_y Startpunkt) (* 2 TSIZE)) (+ (gpnt2d_x Startpunkt) (* 25 TSIZE)) (- (gpnt2d_y Startpunkt) (* 0 2 TSIZE)) ;; *0??? ) ;; Prüfen ob Bogen richtig berechnet wird, Darstellung im Text-Fenster ) ;; Hilfefunktion :help-action '(progn (display :show ) (display " ") (display "Hilfe zu 'Tabelle fÏr BogenmaÞe'") (display " ") (display "a") (display " ") (display "b") (display " ") (display "c") (display " ") (display "d") (display " ") (display "e") (display " ") (display "f") (display " ") (display "g") (display " ") ))