估计是特征点捕捉打开闹的。将最后的函数更改如下:- (defun c:ZK()
- (setvar "cmdecho" 0)
- (textscr)
- (print " 1. 计算长度 " )
- (print " 2. 计算展开 " )
- (initget (+ 1 2 4))
- (setq c (getint "\n 请选择 ( 1 2 ) "))
- (setq t (getreal "\n 请输入材料厚度 t = "))
- (setq sst (ssget))
- (setq n (sslength sst))
- (setq I 0)
- (setq tl 0)
- (setq l 0)
- (while (< I n)
- (setq ety (entget (ssname sst I)))
- (setq name (cdr (assoc 0 ety)))
- (cond ((= c 1) (CL))
- ((= c 2) (ZKA))
- )
- (setq TL (+ TL L))
- )
- (cond ((= c 1) (princ "\n 总长 L = ") (princ TL) (print " OK "))
- ((= c 2)
- (princ "\n 总长 L = ")
- (princ TL)
- (setq pa (getpoint "\n 请输入点坐标:"))
- (setq pb (polar pa 0 TL))
- (setq pc (polar pb (/ pi 2) t))
- (setq pd (polar pa (/ pi 2) t))
- (SETQ OLSOS (GETVAR "OSMODE"))
- (SETVAR "OSMODE" 0)
- (command "pline" pa pb pc pd "c")
- (SETVAR "OSMODE" OLDOS)
- )
- )
- )
|