用法
评论
建议
取 消
确 定
(defun pickset:sort (sspts key fuzz / keys funs orders equaled) "图元列表按组码10的坐标进行排序。参数:ssPts:图元列表;参数:KEY:xyzXYZ 任意组合 ,例如\"yX\",y在前表示y坐标优先,小y表示从小到大(注:二维点时,不能有z);参数:Fuzz:数值或列表,允许偏差;" "图元列表" "(pickset:sort (ssget) \"Yx\" '(3000 10)" (setq keys (vl-string->list key)) (setq funs (mapcar (quote (lambda (xyz) (if (< xyz 100) > <))) keys)) (setq orders (mapcar (quote (lambda (xyz) (cond ((< xyz 100) (- xyz 88)) (t (- xyz 120))))) keys)) (defun equal-compare (fun a b fuzz) (if equaled (if (not (equal a b fuzz)) (progn (setq equaled nil) (fun a b))))) (if (atom fuzz) (setq fuzz (list fuzz))) (while (< (length fuzz) (length keys)) (setq fuzz (append fuzz (list (last fuzz))))) (if (p:picksetp sspts) (setq sspts (pickset:to-list sspts))) (vl-sort sspts (quote (lambda (x y / i equaled) (setq equaled t) (apply (quote or) (mapcar (quote equal-compare) funs (mapcar (quote (lambda (m) (nth m (entity:getdxf x 10)))) orders) (mapcar (quote (lambda (m) (nth m (entity:getdxf y 10)))) orders) fuzz))))))
函数库使用说明
应用包
技术支持
统计信息
函数库规模: 772 个
函数库类别: 54 种
上传记录
刷新