跪求高手,谁能帮忙看下这个程序那里有问题啊加载后输入BSB提示不确定的对象绑定T
本帖最后由 243811238 于 2014-3-18 08:35 编辑(defun c:BSB (/ OLDOS p0 p1 p0x p0y p1x p1y xi yi pc txi tyi t);测量矩形并生成文本
(COMMAND "UNDO" "BE")
(SETQ OLDLN (GETVAR "CLAYER"))
(SETQ OLDOS(GETVAR "OSMODE"))
(initget 1)
(setq p0 (getpoint "\nFirst Point:"))
(initget 33)
(setq p1 (getcorner p0 "\nSecond Point:"))
(SETQ p0x (NTH 0 P0))
(SETQ p0y (NTH 1 P0))
(SETQ p1x (NTH 0 P1))
(SETQ p1y (NTH 1 P1))
(SETQ xi (- p1x p0x))
(SETQ yi (- p1y p0y))
(if (and p0 p1)
(progn
(setq pc (polar p0 (angle p0 p1) (/ (distance p0 p1) 2)))
(setq txi (RTOS (abs xi) 2 0))
(setq tyi (RTOS (abs yi) 2 0))
(SETVAR "OSMODE" 0)
(if (ssget "w" p0 p1)(command "erase" "p" ""))
(if (> (abs xi) (abs yi))
(COMMAND "TEXT" "j" "m" pc "50" "0" t)
(COMMAND "TEXT" "j" "m" pc "50" "90" t)
)
)
)
(SETVAR "OSMODE" OLDOS)
(SETVAR "CLAYER" OLDLN)
(COMMAND "UNDO" "E")
(PRINC)
) (setq t (STRCAT tYi " BSB " tXi))
不要用T當變數 楼上的钻石会员还是 牛 啊 哈哈我在t后面又加了个y,可以了 谢谢了LSJJ
页:
[1]