- ;选择集与对象名表互转
- (defun cx-ss2en
- (ss / enlst)
- (cond
- ((= (type ss) 'PICKSET)
- (vl-remove-if-not '(lambda (x) (= (type x) 'ENAME)) (mapcar 'cadr (ssnamex SS)))
- )
- ((= (type ss) 'LIST)
- (setq enlst (ssadd))
- (last (mapcar '(lambda (x) (ssadd x enlst)) ss))
- )
- ((='ename(type ss))
- (ssadd ss)
- )
- )
- )
- (defun c:xzwt ( / bm ss i lst e en lstt);输入南方CASS编码批量选择物体
- (setq bm(cons 1000 (rtos(getreal "请输入实体南方编码" )2 0)) )
- (setq ss (ssget "x"'() ))
- (setq i 0)
- (setq lst '())
- (repeat (sslength ss)
- (setq e (ssname ss i))
- (setq en (entget e '("*")))
-
- (if
- (equal (car(cdr (car (cdr (assoc -3 en))))) bm)
-
- (setq lst (append lst (list e)) )
- )
- (setq i (1+ i))
-
- )
- (setq lstt (cx-ss2en lst))
- (sssetfirst nil lstt)
-
- )
|