还是不行啊,与(setq sa (ssget "p"' ((0 . "CToolPath") )))的效果是一样的,还是找不到,只有用(if (setq sa (ssget ))这种能行,但会多出许多不需要的点,下面是我的源程序。 (defun c:rrtp() (setq cm (getvar "cmdecho")) (setvar "cmdecho" 0) (command "layer" "s" 6 "" ) (command "color" "byl" ) ; (if (setq sa (ssget )) ;只有这种能行,但会多出许多不需要的点 ;(setq sa (ssget "x"(list(cons 0 "CToolPath")))) (if (setq sa (ssget "x"(list(cons 0 "CToolPath")))) ;(if (setq sa (ssget "p"' ((0 . "CToolPath") ))) (progn (setq n (sslength sa) i 0) (repeat n (setq db (cdr (assoc 10 (entget (ssname sa i)))) i (1+ i) x (atof(rtos (car db) 2 5)) y (atof(rtos (cadr db) 2 5)) pt (list x y )) (command "point" pt ) ) ) (alert "所选取范围内没有切割线") ) (command "layer" "s" 0 "" ) (command "color" "byl" ) (setvar "cmdecho" cm)(princ) ) |