d (atof eidt1)
l (atof eidt2)
)
)
(defun choose_one (one)
(cond
((= one "t") (setq edit3 1))
((= one "n") (setq edit3 2))
((= one "f") (setq edit3 3))
)
)
(defun c:aa()
(setq dcl_id (load_dialog "luoshuan1.dcl"))
(if (not (new_dialog "luoshuan" dcl_id))
(exit)
)
(action_tile "choose_someone" " (choose_one $value) ")
(action_tile "accept" "(act_accept)(done_dialog 1)")
(action_tile "cancel" "(done_dialog 0)")
(start_dialog)
(if (= 1 (start_dialog))
(progn
(if (= 1 edit3) (load "txing"))
(if (= 2 edit3) (load "liujiao"))
(if (= 3 edit3) (load "fangtou"))
)
)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;(defun liujiao (d l / o x y e b k e2 s p1 p2 p3 p4 p5 p6 p7 p8 p9 p10 p11 p12 p13 p14 p15 p16 p17 p24 p25 p26 p27 p28 p29 c1)
(command "-osnap" "" "ucs" "world" "")
(setq ;d (getint "\n输入直径:")
;L (getint "\n输入长度:")
o (getpoint "\n输入坐标:")
x (nth 0 o)
y (nth 1 o)
)
(cond ((= d 3)
(setq e 6.1
b 12
k 2
)
)
((= d 4)(setq e 7.7 b 14 k 2.8))
((= d 5)(setq e 8.8 b 16 k 3.5))
((= d 6)(setq e 11.1 b 18 k 4))
((= d 8)(setq e 14.4 b 22 k 5.3))
((= d 10)(setq e 17.9 b 26 k 6.4))
((= d 12)(setq e 20 b 30 k 7.5))
((= d 14)(setq e 23.4 b 34 k 8.8))
((= d 16)(setq e 26.8 b 38 k 10))
((= d 18)(setq e 30 b 42 k 11.5))
((= d 20)(setq e 33.5 b 46 k 12.5))
((= d 22)(setq e 37.1 b 50 k 14))
((= d 24)(setq e 40 b 54 k 15))
((= d 27)(setq e 45.2 b 60 k 17))
((= d 30)(setq e 50.9 b 66 k 18.7))
((= d 36)(setq e 60.8 b 78 k 22.5))
((= d 42)(setq e 72 b 96 k 26))
((= d 48)(setq e 82.6 b 108 k 30))
((= d 56)(setq e 93.6 b 124 k 35))
((= d 64)(setq e 104.9 b 140 k 40))
)
(setq e2 (/ e 2.0)
s (* 0.86602540378443864676372317075294 e))
(setq p1 (list (+ x (/ d 2.0)) y)
p2 (list (+ x (/ d 2.0)) (- y (- l (* d 0.075))))
p3 (list (- (+ x (/ d 2.0)) (* d 0.075)) (- y l))
p4 (list (+ (- x (/ d 2.0)) (* d 0.075)) (- y l))
p5 (list (- x (/ d 2.0)) (- y (- l (* d 0.075))))
p6 (list (- x (/ d 2.0)) y)
p25
(list (- (+ x (/ d 2.0)) (* d 0.075)) (+ y (- 0 l) b))
p24
(list (+ (- x (/ d 2.0)) (* d 0.075)) (+ y (- 0 l) b))
p26
(list (- x (/ d 2.0)) (+ y (- 0 l) b))
p27
(list (+ x (/ d 2.0)) (+ y (- 0 l) b))
p28
(list (+ (- x (/ d 2.0)) (* d 0.075)) y)
p29
(list (- (+ x (/ d 2.0)) (* d 0.075)) y)
p7 (list (+ x (/ e 2.0)) y)
p8 (list (- x (/ e 2.0)) y)
p16 (list (+ x (/ (* 0.57735026918962576450914878050196 e) 2))
y
)
p15 (list (- x (/ (* 0.57735026918962576450914878050196 e) 2))
y
)
p10 (list (+ x (/ e 2.0)) (+ y (* k 0.75)))
p9 (list (- x (/ e 2.0)) (+ y (* k 0.75)))
p13 (list (- x (/ (* 0.57735026918962576450914878050196 e) 2))
(+ y (* k 0.75))
)
p14 (list (+ x (/ (* 0.57735026918962576450914878050196 e) 2))
(+ y (* k 0.75))
)
p11 (list
(/
(+ (- x (/ e 2.0))
(- x (/ (* 0.57735026918962576450914878050196 e) 2))
)
2
)
(+ y k)
)
p12 (list
(-
x
(/ (+ (- x (+ x (/ e 2.0)))
(- x
(+ x (/ (* 0.57735026918962576450914878050196 e) 2))
)
)
2
))
(+ y k)
)
p17 (list x (+ y k))
c1 (list x (- y l (* 2 e)))
)
(command "line" p1 p2 p3 p4 p5 p6 "" "line"
p3 p25 "" "line" p4 p24 "" "line"
p26 p27 "" "line" p2 p5 "" "line"
p10 p7 p8 p9 "" "line" p11 p12 ""
"line" p15 p13 "" "line" p14 p16 "" "line" p11 p12 ""
"arc" p9 p11 p13 "arc" p13 p17 p14 "arc" p14 p12 p10 "polygon" "6" c1 "i" e2 "circle" c1 "d" s)
(redraw)
(princ)
(command "-osnap" "end,cen,int")
)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;(defun txing (d l / o x y e b s k i p1 p2 p3 p4 p5 p6 p7 p8 p24 p25 p26 p27 p28 p29 a1 a2 a3 a4 a5 a6 a7 a8 a9 c1 c2 c3 c4 c5 c6 c7)
(command "-osnap" "" "ucs" "world" "")
(setq ;d (getint "\n输入直径:")
;L (getint "\n输入长度:")
o (getpoint "\n输入坐标:")
x (nth 0 o)
y (nth 1 o)
)
(cond ((= d 5)
(setq e 12
b 16
k 4.24
s 9
)
)
((= d 6)(setq e 16 b 18 k 5.24 s 12))
((= d 8)(setq e 20 b 22 k 6.24 s 14))
((= d 10)(setq e 25 b 26 k 7.29 s 18))
((= d 12)(setq e 30 b 30 k 9.29 s 22))
((= d 16)(setq e 38 b 38 k 12.35 s 28))
((= d 20)(setq e 46 b 46 k 14.35 s 34))
((= d 24)(setq e 58 b 54 k 16.35 s 44))
((= d 30)(setq e 75 b 66 k 20.42 s 57))
((= d 36)(setq e 85 b 78 k 24.42 s 67))
((= d 42)(setq e 95 b 96 k 28.42 s 76))
((= d 48)(setq e 105 b 108 k 32.5 s 86))
)
(setq i (sqrt (- (* (/ e 2) (/ e 2)) (* (/ s 2) (/ s 2)))))
(setq p1 (list (+ x (/ d 2.0)) y)
p2 (list (+ x (/ d 2.0)) (- y (- l (* d 0.075))))
p3 (list (- (+ x (/ d 2.0)) (* d 0.075)) (- y l))
p4 (list (+ (- x (/ d 2.0)) (* d 0.075)) (- y l))
p5 (list (- x (/ d 2.0)) (- y (- l (* d 0.075))))
p6 (list (- x (/ d 2.0)) y)
p25
(list (- (+ x (/ d 2.0)) (* d 0.075)) (+ y (- 0 l) b))
p24
(list (+ (- x (/ d 2.0)) (* d 0.075)) (+ y (- 0 l) b))
p26
(list (- x (/ d 2.0)) (+ y (- 0 l) b))
p27
(list (+ x (/ d 2.0)) (+ y (- 0 l) b))
p28
(list (+ (- x (/ d 2.0)) (* d 0.075)) y)
p29
(list (- (+ x (/ d 2.0)) (* d 0.075)) y)
p7 (list (+ x (/ e 2.0)) y)
p8 (list (- x (/ e 2.0)) y)
a8 (list (- x i) y)
a9 (list (+ x i) y)
a3 (list (- x (/ e 2.0)) (+ y (* k 0.66666666666666666666666666666667)))
a4 (list (+ x (/ e 2.0)) (+ y (* k 0.66666666666666666666666666666667)))
a5 (list x (+ y k))
a6 (list (- x i) (+ y (* k 0.66666666666666666666666666666667)))
a7 (list (+ x i) (+ y (* k 0.66666666666666666666666666666667)))
a1 (list (+ (- x (/ e 2.0)) (* 0.33333333333333333333333333333333 k)) (+ y k))
a2 (list (- (+ x (/ e 2.0)) (* 0.33333333333333333333333333333333 k)) (+ y k))
c1 (list x (- y l (* 2 e)))
c2 (list (- x i) (+ (- y l (* 2 e)) (/ s 2.0)))
c3 (list (+ x i) (+ (- y l (* 2 e)) (/ s 2.0)))
c4 (list (+ x i) (- (- y l (* 2 e)) (/ s 2.0)))
c5 (list (- x i) (- (- y l (* 2 e)) (/ s 2.0)))
c6 (list (- x (/ e 2.0)) (- y l (* 2 e)))
c7 (list (+ x (/ e 2.0)) (- y l (* 2 e))))
(command "line" p1 p2 p3 p4 p5 p6 "" "line"
p3 p25 "" "line" p4 p24 "" "line"
p26 p27 "" "line" p2 p5 "" "line"
a4 p7 p8 a3 "" "line" a8 a6 a3 a1 a2 a4 a7 a9 ""
"arc" a6 a5 a7 "line" c2 c3 "" "line" c4 c5 "" "arc" c2 c6 c5 "arc" c3 c7 c4
"circle" c1 "d" s)
(redraw)
(princ)
(command "-osnap" "end,cen,int")
);;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(defun fangtou (d l / x o y s b k e p1 p2 p3 p4 p5 p6 p7 p8 p9 p10 p11 p12 p13 p14 p15 p16 p17 c1 c2 c3 c4 c5)
(command "-osnap" "" )
(setq ;d (getint "\n输入直径:")
;L (getint "\n输入长度:")
o (getpoint "\n输入坐标:")
x (nth 0 o)
y (nth 1 o)
)
(cond ((= d 10)(setq s 16 b 26 k 7))
((= d 12)(setq s 18 b 30 k 8))
((= d 14)(setq s 21 b 34 k 9))
((= d 16)(setq s 24 b 38 k 10))
((= d 18)(setq s 27 b 42 k 12))
((= d 20)(setq s 30 b 46 k 13))
((= d 22)(setq s 34 b 50 k 14))
((= d 24)(setq s 36 b 54 k 15))
((= d 27)(setq s 41 b 60 k 17))
((= d 30)(setq s 46 b 66 k 19))
((= d 36)(setq s 55 b 78 k 23))
((= d 42)(setq s 65 b 96 k 26))
((= d 48)(setq s 75 b 108 k 30))
)
(setq e (* 1.4142135623730950488016887242097 s)
)
(setq p4 (list (+ x (/ d 2.0)) (- y l))
p5 (list (- x (/ d 2.0)) (- y l))
p3 (list (+ x (/ d 2.0)) (+ b (- y l)))
p2 (list (- (+ x (/ d 2.0)) (* d 0.075)) (+ b (- y l) (* d 0.075)))
p1 (list (- (+ x (/ d 2.0)) (* d 0.075)) y)
p8 (list (+ (- x (/ d 2.0)) (* d 0.075)) y)
p7 (list (+ (- x (/ d 2.0)) (* d 0.075)) (+ b (- y l) (* d 0.075)))
p6 (list (- x (/ d 2.0)) (+ b (- y l)))
p9 (list (- (+ x (/ d 2.0)) (* d 0.075)) (- y l))
p10 (list (+ (- x (/ d 2.0)) (* d 0.075)) (- y l))
p11 (list (+ x (/ e 2.0)) y)
p12 (list (- x (/ e 2.0))y)
p17 (list (+ x (/ e 2.0)) (+ y (/ k 1.25)))
p13 (list (- x (/ e 2.0))(+ y (/ k 1.25)))
p15 (list x (+ y (/ k 1.25)))
p14 (list (/ (+ (- x (/ e 2.0)) x) 2) (+ k y))
p16 (list (/ (+ (+ x (/ e 2.0)) x) 2) (+ k y))
c1 (list x (- y l (* 2 e)))
c2 (list x (+ (- y l (* 2 e)) (/ e 2.0)))
c4 (list x (-(- y l (* 2 e)) (/ e 2.0)))
c3 (list (+ x (/ e 2.0)) (- y l (* 2 e)))
c5 (list (- x (/ e 2.0)) (- y l (* 2 e))))
高手那你帮我把这两个连上吗?多谢!
(defun c:fangtou ()
(command "-osnap" "" )
(setq d (getint "\n输入直径:")
L (getint "\n输入长度:")
o (getpoint "\n输入坐标:")
x (nth 0 o)
y (nth 1 o)
)
(cond ((= d 10)(setq s 16 b 26 k 7))
((= d 12)(setq s 18 b 30 k 8))
((= d 14)(setq s 21 b 34 k 9))
((= d 16)(setq s 24 b 38 k 10))
((= d 18)(setq s 27 b 42 k 12))
((= d 20)(setq s 30 b 46 k 13))
((= d 22)(setq s 34 b 50 k 14))
((= d 24)(setq s 36 b 54 k 15))
((= d 27)(setq s 41 b 60 k 17))
((= d 30)(setq s 46 b 66 k 19))
((= d 36)(setq s 55 b 78 k 23))
((= d 42)(setq s 65 b 96 k 26))
((= d 48)(setq s 75 b 108 k 30))
)
(setq e (* 1.4142135623730950488016887242097 s)
)
(setq p4 (list (+ x (/ d 2.0)) (- y l))
p5 (list (- x (/ d 2.0)) (- y l))
p3 (list (+ x (/ d 2.0)) (+ b (- y l)))
p2 (list (- (+ x (/ d 2.0)) (* d 0.075)) (+ b (- y l) (* d 0.075)))
p1 (list (- (+ x (/ d 2.0)) (* d 0.075)) y)
p8 (list (+ (- x (/ d 2.0)) (* d 0.075)) y)
p7 (list (+ (- x (/ d 2.0)) (* d 0.075)) (+ b (- y l) (* d 0.075)))
p6 (list (- x (/ d 2.0)) (+ b (- y l)))
p9 (list (- (+ x (/ d 2.0)) (* d 0.075)) (- y l))
p10 (list (+ (- x (/ d 2.0)) (* d 0.075)) (- y l))
p11 (list (+ x (/ e 2.0)) y)
p12 (list (- x (/ e 2.0))y)
p17 (list (+ x (/ e 2.0)) (+ y (/ k 1.25)))
p13 (list (- x (/ e 2.0))(+ y (/ k 1.25)))
p15 (list x (+ y (/ k 1.25)))
p14 (list (/ (+ (- x (/ e 2.0)) x) 2) (+ k y))
p16 (list (/ (+ (+ x (/ e 2.0)) x) 2) (+ k y))
c1 (list x (- y l (* 2 e)))
c2 (list x (+ (- y l (* 2 e)) (/ e 2.0)))
c4 (list x (-(- y l (* 2 e)) (/ e 2.0)))
c3 (list (+ x (/ e 2.0)) (- y l (* 2 e)))
c5 (list (- x (/ e 2.0)) (- y l (* 2 e))))