马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?立即注册
×

- [FONT=courier new]
- (defun c:pm(/ x0 y0 x y p0 n m x1 y1 p1 g high i)
- (setq y0 4000)
- (setq x0 3000)
- (setq g 1000)
- (setq y1 (- y0 2))
- (setq p1 (list x0 y1))
- (setq high (strcat (rtos x0) "," (rtos y0)))
- (setq x x0)
- (setq y y0)
- (setq p0 (list x0 y0))
- (setq n 5)
- (setq m 5)
- (setq x1 x0)
- (setq y1 (+ y0 (* m 100)))
- (setq p1 (list x1 y1))
- ;--------vertical line---------------
- (repeat n
- (setq x (+ x 100))
- (setq p0 (list x y0))
- (setq p1 (list x y1))
- )
- ;-------------hor-line----------------
- (setq p0 (list x0 y0))
- (setq x1 (+ x0 (* n 100)))
- (setq p1 (list x1 y0))
- (repeat m
- (setq y (+ y 100))
- (setq p0 (list x0 y))
- (setq p1 (list x1 y))
- )
- ;-----------Post of [xmy]------------------
- (setq i 1)
- (while i
- (setq x(getreal "\nEnter[x,y]:"))
- (setq y(getreal "\nEnter[x,y]:"))
- (setq x1 (+ x0 (/ (* 1000.0 (- y x0)) g)))
- (setq y1 (+ y0 (/ (* 1000.0 (- x y0)) g)))
- (setq p0 (list x1 y1))
- (setq p1 (list (+ x1 1) y1))
- (setq high (getstring "High:"))
- (if (= high "-1")
- (setq i NIL)
- (progn
- (command "donut" 0 0.3 p0 "")
- (command "text" "j" "ML" p1 1.5 0 high)
- ))
- ) ;while
- )
- 最后一段能不能从手工输入改为以文件形式输入,如文件为:
- 1000,2000,1678.23
- 1050,2080,1656.78
- ...........
- x,y,high[/FONT]
|