- ;读入参数
- (defun readdata ()
- (setq r3 (atof (get_tile "R1"))
- r1 (atof (get_tile "R2"))
- r (atof (get_tile "R3"))
- n (atof (get_tile "n"))
- x (atof (get_tile "x"))
- y (atof (get_tile "y"))
- )
- )
- ;主程序
- (defun c:falanpan()
- (if (> (setq dcl_id (load_dialog "falanpan")) 0) (progn
- (if (new_dialog "flpdlg" dcl_id) (progn
- (Start_Image "flp")
- (Slide_Image 0 0 (Dimx_Tile "flp") (Dimy_Tile "flp") "flp")
- (End_Image)
- (action_tile "accept" "(readdata) (done_dialog 1)")
- (action_tile "cancel" "(done_dialog 0)")
- (setq re (Start_Dialog))
- ))
- (unload_dialog dcl_id)
- ))
- (if (= re 1 ) (progn
- (setq pt(list x y 0.0))
- (setq r2 (/ (+ r1 r3) 2))
- (setq pt1 (polar pt (/ pi 2.0)(+ r3 3))
- pt2 (polar pt (-(/ pi 2.0))(+ r3 3))
- pt3 (polar pt pi(+ r3 3))
- pt4 (polar pt 0.0 (+ r3 3))
- )
- (command "ltscale" "10")
- (command "layer" "m" "0" "1" "continuous" "0" "c" "green" "0" "")
- (command "circle" pt r1)
- (command "circle" pt r3)
- (command "circle" (polar pt 0 r2) r)
- (command "array" "1" "" "p" pt n 360 "n")
- (command "ltscale" "30")
- (command "layer" "m" "1" "1" "center" "1" "c" "red" "1" "")
- (command "circle" pt r2)
- (command "line" pt1 pt2 "")
- (command "line" pt3 pt4 "")
- (command "redraw")
- (setq area (* pi (-(* r3 r3)(* r1 r1)(* n r r))))
- ))
- (princ)
- )
|