- (defun c:pp (/ pet ss)
- (setq pet (getvar "PEDITACCEPT"))
- (setvar "peditaccept" 1)
- (setq entlist nil
- ss1 (ssadd)
- ss2 (ssadd)
- )
- (setq ss (ssget (list '(0 . "LWPOLYLINE,LINE,SPLINE,ARC"))))
- (setq ssl (sslength ss)
- i 0)
- (princ "\n开始循环")
- (repeat ssl
- (setq a (ssname ss i))
-
- (setq b (entget a))
- (setq e (cdr (assoc 0 b)))
- (princ e)
- (princ "\n开始分类……")
- (if (= e "SPLINE")
- (ssadd a ss1)
- (ssadd a ss2)
- )
- (princ "\n分类完成")
- (princ (strcat "ss1对象数=" (itoa (sslength ss1)) "ss2对象数=" (itoa (sslength ss2))))
-
- (setq i (1+ i))
- )
- (if (= (sslength ss1) 0)
- (command "_pedit" (ssname ss 0) "j" ss "" "")
- (command "_pedit" "m" ss "" 99 "j" "" "")
-
- )
- (setvar "PEDITACCEPT" pet)
- (princ)
- )
- ;*** 请不要在注释下添加文字! ***|;
|