- ;选择集与对象名表互转
- (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 "请输入高程点字高 \n" )2 0)) )
- (setq bm (getreal "请输入高程点字高 \n" ))
- (setq ss (ssget "x"'((0 . "INSERT")(2 . "GC200") ) ))
- (setq i 0)
- (setq lst '())
- (repeat (sslength ss)
- (setq e (ssname ss i))
- (setq en (entget e '("*")))
-
- (if
- (equal (cdr(assoc 40 (entget(entnext e) ) )) bm)
-
- (setq lst (append lst (list e)) )
- )
- (setq i (1+ i))
-
- )
- (setq lstt (cx-ss2en lst))
- (sssetfirst nil lstt)
-
- )
- ;(cdr(assoc 40 (entget(entnext(car(entsel))) ) ))
|