用法
评论
建议
取 消
确 定
(defun pickset:sort-with-dxf (ss dxf-i n fuzz decreasep / ent index lst newlst newse tmp) "选择集按照给定的组码值进行排序。
n:如果组码值为一个表,则 n 指出使用第几个;否则nil 。
decreasep:T表示从大到小,nil表示从小到大 " "排序后的选择集" "(pickset:sort-with-dxf SS 62 nil 0 T) ;;表示按照62(颜色号)组码的值进行排序,顺序为从大到小" (setq lst (quote nil) index 0) (repeat (sslength ss) (setq ent (entget (ssname ss index)) tmp (cdr (assoc dxf-i ent))) (if (and n (= (type n) (quote int)) (= (type tmp) (quote list)) (< n (length tmp))) (setq tmp (nth n tmp))) (setq lst (cons (list tmp (cdr (assoc 5 ent))) lst)) (setq index (1+ index))) (if (and fuzz (or (= (type fuzz) (quote int)) (= (type fuzz) (quote real))) (or (= (type tmp) (quote int)) (= (type tmp) (quote real)))) (setq newlst (vl-sort lst (function (lambda (e1 e2) (< (+ (car e1) fuzz) (car e2)))))) (setq newlst (vl-sort lst (function (lambda (e1 e2) (< (car e1) (car e2))))))) (if decreasep (setq newlst (reverse newlst))) (setq newse (ssadd)) (foreach tmp newlst (setq newse (ssadd (handent (cadr tmp)) newse))) newse)
函数库使用说明
应用包
技术支持
统计信息
函数库规模: 733 个
函数库类别: 51 种
上传记录
刷新