明经CAD社区

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
楼主: xyp1964

[讨论] 【e派】工具箱函数再揭秘及应用实例

    [复制链接]
发表于 2012-8-22 20:10 | 显示全部楼层
请教院长这个函数xyp-sc能公开吗?

点评

xyp-sc是个全局变量,与图纸出图比例相关联  发表于 2012-8-22 20:45
回复 支持 0 反对 1

使用道具 举报

发表于 2012-8-26 10:43 | 显示全部楼层
感谢楼主分享好东西
发表于 2012-8-28 15:07 | 显示全部楼层
来支持院长~
发表于 2012-9-1 10:39 | 显示全部楼层
很强大,占位学习
发表于 2012-9-1 12:01 | 显示全部楼层
支持看门的
发表于 2012-9-6 11:24 | 显示全部楼层
好东西啊,三角函数帮了我大忙,数学差啊,多谢院长
发表于 2012-10-16 23:42 | 显示全部楼层
哈哈,终于见到了院长的真源码,太好了。感谢院长。
 楼主| 发表于 2012-10-17 17:50 | 显示全部楼层
本帖最后由 xyp1964 于 2017-11-20 21:59 编辑

  1. ;; 直线批量等分
  2. (defun c:test1146 ()
  3.   (CMDLA0)
  4.   (setq int (Uint 7 "" "整数" int)
  5. ss  (ssget '((0 . "line")))
  6. lst (xyp-Sort-Plist (xyp-Sort ss 10 "x-min") 6)
  7. lst (mapcar 'cdr lst)
  8. i   0
  9.   )
  10.   (while (and (setq s1 (nth i lst))
  11.        (setq s2 (nth (setq i (1+ i)) lst))
  12.   )
  13.     (setq s1   (xyp-Line-DtFormat s1)
  14.    s2   (xyp-Line-DtFormat s2)
  15.    ptn1 (xyp-get-CurveDivNumPtlst s1 int)
  16.    ptn2 (xyp-get-CurveDivNumPtlst s2 int)
  17.     )
  18.     (mapcar '(lambda (x y) (xyp-line x y)) ptn1 ptn2)
  19.   )
  20.   (CMDLA1)
  21. )


本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?注册

x

点评

(xyp-Sort-Plist (xyp-Sort ss 10 "x-min") 6) 这俩能提供下吗  发表于 2023-11-12 03:42
 楼主| 发表于 2012-10-17 17:59 | 显示全部楼层
本帖最后由 xyp1964 于 2017-11-20 21:59 编辑

  1. ;; xyp-SortListSub 以表内某子项为首重新排序 (xyp-SortListSub lst sub)
  2. ;; (xyp-SortListSub '(1 2 3 4 5 6 7 8 9 10) 5)→(5 6 7 8 9 10 1 2 3 4)
  3. (defun xyp-SortListSub (lst sub / a n i new)
  4.   (if (setq a (member sub lst))
  5.     (progn
  6.       (setq n (- (length lst) (length a))
  7.             i   0
  8.             new  '()
  9.       )
  10.       (while (< i n)
  11.         (setq new (cons (nth i lst) new)
  12.               i  (1+ i)
  13.         )
  14.       )
  15.       (append a (reverse new))
  16.     )
  17.   )
  18. )

点评

(defun xyp-SortListSub1 (lst sub / a n i new) (if (setq a (member sub lst)) (progn (setq b (member (- (length lst) sub 1) (reverse lst))) (append a (reverse b)) ) ) )  发表于 2012-10-21 17:18
发表于 2012-10-17 23:38 | 显示全部楼层
这个排序很简洁。
您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|CAD论坛|CAD教程|CAD下载|联系我们|关于明经|明经通道 ( 粤ICP备05003914号 )  
©2000-2023 明经通道 版权所有 本站代码,在未取得本站及作者授权的情况下,不得用于商业用途

GMT+8, 2024-5-22 01:27 , Processed in 0.292518 second(s), 20 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表