;; 发个新的自定义函数以示祝贺- ;; xyp-SsSort-Dxf 选择集依据dxf码值分类 (xyp-SsSort-Dxf ss dxfmode)
- (defun xyp-SsSort-Dxf (ss dxfmode / lst-dxf i s1 lst-num a b lst)
- (if (and ss (= (type ss) 'PICKSET) (> (sslength ss) 0))
- (progn
- (setq lst-dxf '()
- i -1
- )
- (while (setq s1 (ssname ss (setq i (1+ i))))
- (setq lst-dxf (cons (list (xyp-dxf dxfmode s1) s1) lst-dxf))
- )
- (setq lst-dxf (vl-sort lst-dxf '(lambda (x y) (< (car x) (car y))))
- lst-num '()
- a (car lst-dxf)
- lst-dxf (cdr lst-dxf)
- lst (list (cadr a))
- )
- (while (setq b (car lst-dxf))
- (setq lst-dxf (cdr lst-dxf))
- (if (equal (car a) (car b))
- (setq lst (cons (cadr b) lst))
- (setq lst-num (cons (list (car a) (reverse lst)) lst-num)
- lst (list (cadr b))
- a b
- )
- )
- )
- (reverse (cons (list (car a) (reverse lst)) lst-num))
- )
- )
- )
|