既然用得不多,为啥还要单独写一个那么复杂的呢?
 - (defun ss:n ()
- (setq aa '("##." "###." "####." "#####."))
- (setq bb '("#" "##"))
- (setq cc '("(#)" "(##)" "(###)"))
- (setq n1 (zuhe aa (zuhe bb cc)))
- (setq n2 (mapcar '(lambda (x) (apply 'strcat x)) n1))
- (ssget (list (cons 1 (strjoin n2 ","))))
- )
- ;;;字符串连接
- (defun strjoin (lst del)
- (if (cdr lst)
- (strcat (car lst) del (strjoin (cdr lst) del))
- (car lst)
- )
- )
- ;;;两个表两两组合成新表
- (defun zuhe (lst1 lst2 / i j a lst)
- (setq i 0)
- (repeat (length lst1)
- (setq a (nth i lst1))
- (if (atom a)(setq a (cons a nil)))
- (setq j 0)
- (repeat (length lst2)
- (setq b (nth j lst2))
- (if (atom b)(setq b (cons b nil)))
- (setq lst
- (append
- lst
- (list(append a b))
- )
- )
- (setq j (1+ j))
- )
- (setq i (1+ i))
- )
- Lst
- )
|