- UID
- 184428
- 积分
- 0
- 精华
- 贡献
-
- 威望
-
- 活跃度
-
- D豆
-
- 在线时间
- 小时
- 注册时间
- 2004-10-18
- 最后登录
- 1970-1-1
|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?立即注册
×
(defun c:tfh(/ s1 b1 x y tfh zb1 zb2)
(command "osmode" "0")
(command "cmdecho" "0")
(prompt "\n图上指定点用来计算图幅号并绘制图廓线")
(setq s1 (getpoint"\n图幅内点点:"))
(setq s2 (getstring"\n 比例尺(500,1000,2000,5000,10000):"))
(if (or (= s1 nil) (= s2 nil))(exit))
(setq x (car s1))
(setq y (cadr s1))
(setq tfh (tfhjs y x b1))
(if (= b1 "500") (progn
(setq x(* (fix (/ x 250) 250))
(setq y(* (fix (/ y 200) 200))
(setq zb1(list x y))
(setq zb2(list (+ x 250) (+ y 200)))
)
(if (= b1 "1000") (progn
(setq x(* (fix (/ x 500) 500))
(setq y(* (fix (/ y 400) 400))
(setq zb1(list x y))
(setq zb2(list (+ x 500) (+ y 400)))
)
(if (= b1 "2000") (progn
(setq x(* (fix (/ x 1000 1000))
(setq y(* (fix (/ y 800) 800))
(setq zb1(list x y))
(setq zb2(list (+ x 1000) (+ y 800)))
)
(if (= b1 "5000") (progn
(setq x(* (fix (/ x 2500) 2500))
(setq y(* (fix (/ y 2000) 2000))
(setq zb1(list x y))
(setq zb2(list (+ x 2500) (+ y 2000)))
)
(if (= b1 "10000") (progn
(setq x(* (fix (/ x 5000) 5000))
(setq y(* (fix (/ y 4000) 4000))
(setq zb1(list x y))
(setq zb2(list (+ x 5000) (+ y 4000)))
)
(setq b1 (/ (atof b1) 1000))
(command "layer" "m" "tk" "")
(command "text" (list (+ x 50) (+ y 50)) "10" "0" tfh)
(command "rectang" zb1 zb2)
(command "layer" "s" "0" "")
(command "zoom" "e")
(princ)
)
(defun tfhjs(x y blc / zxjy zxjx zxjp xk yk xx yx xxh xt yt hwb ywx ywy wbh wbtfh ywtfh wqtfh tfh1)
(setq xk (* (fix(/ (fix(/ x 1000)) 4)) 4))
(setq yk (* (fix(/ (fix(/ y 1000)) 5)) 5))
(setq ywx(rtos xk 2 0))
(setq ywy(rtos yk 2 0))
(setq ywtfh (strcat ywx "-" ywy))
(if (= blc "2000")
(progn
(setq xx (-x (* xk 1000)))
(setq yy (-y (* yk 1000)))
(setq m (-5 (fix (/ xx 800)))
(setq n (+1 (fix (/ yy 1000)))
(setq hlq (+ (* (- m 1) 5) n))
(setq lqh(rtos hlq 2 0))
(setq lqtfh (strcat ywx "-" ywy "-" lqh))
)
)
(if (or (= blc "500") (= blc "5000") )
(progn
(setq xx (/ (- x (* xk 1000)) 2000))
(setq yy (/ (- y (* yk 1000)) 2500))
(if (and (> xx 1) (< yy 1))
(progn
(setq xxh "I")
(setq xt (* (- xx 1) 2000))
(setq yt (* yy 2500))
)
)
(if (and (> xx 1) (> yy 1))
(progn
(setq xxh "II")
(setq xt (* (- xx 1) 2000))
(setq yt (* (- yy 1) 2500))
)
)
(if (and (< xx 1) (< yy 1))
(progn
(setq xxh "III")
(setq xt (* xx 2000))
(setq yt (* yy 2500))
)
)
(if (and (< xx 1) (> yy 1))
(progn
(setq xxh "IV")
(setq xt (* xx 2000))
(setq yt (* (- yy 1) 2500))
)
)
(setq hwb (+ (* 10 (- 9 (fix (/ xt 200)))) (+ (fix (/ yt 250)) 1)))
(setq wbh(rtos hwb 2 0))
(setq wqtfh (strcat ywx "-" ywy "-" xxh))
(setq wbtfh (strcat ywx "-" ywy "-" xxh "-"wbh))
)
)
(if (= blc "10000") (setq tfh1 ywtfh))
(if (= blc "5000") (setq tfh1 wqtfh))
(if (= blc "2000") (setq tfh1 lqtfh))
(if (= blc "500") (setq tfh1 wbtfh))
(setq tfh tfh1)
) |
|