请教院长这个函数xyp-sc能公开吗?
感谢楼主分享好东西
来支持院长~
很强大,占位学习
支持看门的
好东西啊,三角函数帮了我大忙,数学差啊,多谢院长
哈哈,终于见到了院长的真源码,太好了。感谢院长。
本帖最后由 xyp1964 于 2017-11-20 21:59 编辑
;; 直线批量等分
(defun c:test1146 ()
(CMDLA0)
(setq int (Uint 7 "" "整数" int)
ss(ssget '((0 . "line")))
lst (xyp-Sort-Plist (xyp-Sort ss 10 "x-min") 6)
lst (mapcar 'cdr lst)
i 0
)
(while (and (setq s1 (nth i lst))
(setq s2 (nth (setq i (1+ i)) lst))
)
(setq s1 (xyp-Line-DtFormat s1)
s2 (xyp-Line-DtFormat s2)
ptn1 (xyp-get-CurveDivNumPtlst s1 int)
ptn2 (xyp-get-CurveDivNumPtlst s2 int)
)
(mapcar '(lambda (x y) (xyp-line x y)) ptn1 ptn2)
)
(CMDLA1)
)
本帖最后由 xyp1964 于 2017-11-20 21:59 编辑
;; xyp-SortListSub 以表内某子项为首重新排序 (xyp-SortListSub lst sub)
;; (xyp-SortListSub '(1 2 3 4 5 6 7 8 9 10) 5)→(5 6 7 8 9 10 1 2 3 4)
(defun xyp-SortListSub (lst sub / a n i new)
(if (setq a (member sub lst))
(progn
(setq n (- (length lst) (length a))
i 0
new'()
)
(while (< i n)
(setq new (cons (nth i lst) new)
i(1+ i)
)
)
(append a (reverse new))
)
)
)
这个排序很简洁。