- 积分
- 2165
- 明经币
- 个
- 注册时间
- 2004-1-22
- 在线时间
- 小时
- 威望
-
- 金钱
- 个
- 贡献
-
- 激情
-
|
程序代码如下
(defun c:ft (/ p0 p0xx py0y p0x p0y p1 p1xx p1yy p1x p1y p2 p2xx p2yy p2x p2y a1 a2 lx ly l2)
(command "undo" "begin") (setq CHO (getvar "CMDECHO")) (setvar "CMDECHO" 0)
(command "ucs" "world") ;转到世界坐标系 (setq os (getvar "osmode")) (setvar "osmode" 37) (setq p0 (getpoint "\n 请选择插入1点:")) (setq p1 (getpoint "\n 请选择插入2点:")) (setq p2 (getpoint "\n 请选择插入3点:")) (setq a1 (angle p0 p1)) (setq a2 (angle p0 p2)) (setq l2 (distance p0 p2)) (setq lxx (cos (- a2 a1))) (setq lyy (sin (- a2 a1))) (setq lx (* lxx l2)) (setq ly (* lyy l2)) (setq p0x (car p0)) (setq p0y (cadr p0)) (setq q2x (+ p0x lx)) (setq q2y (- p0y ly)) (setq q2 (list q2x q2y)) (command "layout" "set" "layout1") (command "RECTANGLE" p0 q2 "") (setq e1 (entlast)) (command "mview" "object" e1) (command "MSPACE" p0) (setvar "ucsfollow" 1) (command "ucs" "z" p0 p1) (setvar "ucsfollow" 0) (command "ucs" "w") (command "zoom" p0 p2) (command "PSPACE") (setvar "CMDECHO" cho) (setvar "osmode" os) (command "undo" "end")
)
请各位高手看看,为什么程序加载后,第一次运行的结果总是不对,而以后运行的结果就是对的,这是什么毛病,怎么改 |
|