明经CAD社区

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 12287|回复: 44

[已解答] 函数搜索,便于大家收集整理自己的函数库~~~

    [复制链接]
发表于 2014-7-7 17:45 | 显示全部楼层 |阅读模式
本帖最后由 77077 于 2014-7-9 10:59 编辑

我的函数库.lsp
  1. ;;;用vlisp程序搜索收集的函数.保存函数时,按照格式保存,以便搜索.
  2. ;;;函数库文件格式:
  3. ;;;[功能]
  4. ;;;[用法]
  5. ;;;思路:1.点击搜索后,提取关键词,在函数库文件中搜索含有关键词的行和下一行,组成列表显示到列表框中.
  6. ;;;     2.点击函数列表框中的项,分别显示到功能和用法两个文本框中.
  7. ;;;=============函数库开始===================
  8. ;[功能]entmake直线
  9. ;[用法](entmakeline p1 p2)
  10. (defun entmakeline (p1 p2)
  11.   (entmakex (list '(0 . "line") (cons 10 p1) (cons 11 p2)))
  12. )
  13. ;[功能]entmake两顶点多段线(多顶点类似)
  14. ;[用法](entmakelwpolyline p1 p2)
  15. (defun entmakelwpolyline (pt1 pt2)
  16.   (entmakex
  17.     (list '(0 . "lwpolyline")
  18.    '(100 . "acdbentity")
  19.    '(100 . "acdbpolyline")
  20.    (cons 90 2)
  21.    (cons 10 pt1)
  22.    (cons 10 pt2)
  23.     )
  24.   )
  25. )
  26. ;[功能]entmake点表生成多段线
  27. ;[用法](make-lwpolyline ptlst)
  28. (defun make-lwpolyline (lst / pt)
  29.   (entmakex
  30.     (append
  31.       (list '(0 . "lwpolyline")
  32.      '(100 . "acdbentity")
  33.      '(100 . "acdbpolyline")
  34.      (cons 90 (length lst))
  35.       )
  36.       (mapcar '(lambda (pt) (cons 10 pt)) lst)
  37.     )
  38.   )
  39. )
  40. ;[功能]entmake圆
  41. ;[用法](entmakecircle cen r)
  42. (defun entmakecircle (cen r)
  43.   (entmakex (list '(0 . "circle") (cons 10 cen) (cons 40 r)))
  44. )
  45. ;[功能]entmake圆弧
  46. ;[用法](entmakearc pt r ang1 ang2)
  47. (defun entmakearc (pt r ang1 ang2)
  48.   (entmakex
  49.     (list '(0 . "arc")
  50.    (cons 10 pt)
  51.    (cons 40 r)
  52.    (cons 50 ang1)
  53.    (cons 51 ang2)
  54.     )
  55.   )
  56. )
  57. ;[功能]entmake单行文本
  58. ;[用法](make-text str pt)
  59. (defun make-text (str pt)
  60.   (entmakex
  61.     (list '(0 . "text") (cons 1 str) (cons 10 pt) (cons 40 5))
  62.   )
  63. )
  64. ;[功能]entmake居中单行文字
  65. ;[用法](entmaketext pt str textheigh)
  66. (defun entmaketext (pt str textheigh)
  67.   (entmakex
  68.     (list '(0 . "text")
  69.    (cons 1 str)
  70.    (cons 10 pt)
  71.    (cons 40 textheigh)
  72.    (cons 11 pt)
  73.    (cons 72 1)
  74.    (cons 73 2)
  75.     )
  76.   )
  77. )
  78. ;[功能]entmake多行文本
  79. ;[用法](entmakemtext str pt)
  80. (defun entmakemtext (str pt)
  81.   (entmakex
  82.     (list '(0 . "mtext")
  83.    '(100 . "acdbentity")
  84.    '(100 . "acdbmtext")
  85.    ;;'(7 . "standard")
  86.    (cons 1 str)
  87.    (cons 10 pt)
  88.     )
  89.   )
  90. )
  91. ;[功能]entmake半径标注
  92. ;[用法](entmakeradial (getpoint) (getpoint))
  93. (defun entmakeradial (cen p2)
  94.   (entmakex
  95.     (list '(0 . "dimension")
  96.    '(100 . "acdbentity")
  97.    '(100 . "acdbdimension")
  98.    (cons 10 cen)
  99.    '(70 . 36)
  100.    '(100 . "acdbradialdimension")
  101.    (cons 15 p2)
  102.     )
  103.   )
  104. )
  105. ;[功能]entmake直径标注
  106. ;[用法](setq ed (entmakediametric (getpoint)(getpoint)(getpoint)))p1 p2圆上点,txtpt文字放置点
  107. (defun entmakediametric        (p1 p2 txtpt)
  108.   (entmakex
  109.     (list '(0 . "dimension")
  110.           '(100 . "acdbentity")
  111.           '(100 . "acdbdimension")
  112.           (cons 10 p1)
  113.           (cons 11 txtpt)
  114.           '(70 . 163)
  115.           '(100 . "acdbdiametricdimension")
  116.           (cons 15 p2)
  117.     )
  118.   )
  119. )

  120. ;[功能]entmake水平标注
  121. ;[用法](setq ed (entmakedimensionh p1点 p2点 文字放置点))
  122. (defun entmakedimensionh (p1 p2 txtpt)
  123.   (entmakex
  124.     (list '(0 . "dimension")
  125.           '(100 . "acdbentity")
  126.           '(100 . "acdbdimension")
  127.           (cons 10 txtpt)
  128.           '(70 . 32)
  129.           '(1 . "")
  130.           '(100 . "acdbaligneddimension")
  131.           (cons 13 p1)
  132.           (cons 14 p2)
  133.           '(100 . "acdbrotateddimension")
  134.     )
  135.   )
  136. )

  137. ;[功能]entmake垂直标注
  138. ;[用法](entmakedimensionv p1点 p2点 文字放置点)
  139. (defun entmakedimensionv (p1 p2 txtpt)
  140.   (entmakex
  141.     (list '(0 . "dimension")
  142.           '(100 . "acdbentity")
  143.           '(100 . "acdbdimension")
  144.           (cons 10 txtpt)
  145.           '(70 . 32)
  146.           '(1 . "")
  147.           '(100 . "acdbaligneddimension")
  148.           (cons 13 p1)
  149.           (cons 14 p2)
  150.           '(50 . 1.5708)
  151.           '(100 . "acdbrotateddimension")
  152.     )
  153.   )
  154. )

  155. ;[功能]entmake倾斜标注
  156. ;[用法](entmakealigneddim p1点 p2点 文字放置点)
  157. (defun entmakealigneddim (p1 p2 txtpt)
  158.   (entmakex
  159.     (list '(0 . "dimension")
  160.           '(100 . "acdbentity")
  161.           '(100 . "acdbdimension")
  162.           (cons 10 txtpt)
  163.           '(70 . 33)
  164.           '(1 . "")
  165.           '(100 . "acdbaligneddimension")
  166.           (cons 13 p1)
  167.           (cons 14 p2)
  168.     )
  169.   )
  170. )

评分

参与人数 1明经币 +1 收起 理由
xyp1964 + 1 赞一个!

查看全部评分

"觉得好,就打赏"
还没有人打赏,支持一下

本帖被以下淘专辑推荐:

发表于 2023-7-25 18:02 | 显示全部楼层



修改了AutoCAD2021运行的问题

  1. (defun make-dcl  (/ lst_str str file f)
  2.     (setq lst_str '(
  3. "hsss:dialog {"
  4. "    label = \"函数搜索\" ;"
  5. "    :spacer {}"
  6. "    :row {"
  7. "        :edit_box {"
  8. "            key = \"key1\" ;"
  9. "            label = \"关键词(&K)\" ;"
  10. "            width = 60 ;"
  11. "        }"
  12. "        :button {"
  13. "            key = \"key2\" ;"
  14. "            label = \"搜索(&S)\" ;"
  15. "        }"
  16. "        :button {"
  17. "            key = \"key3\" ;"
  18. "            label = \"显示全部(&A)\" ;"
  19. "        }"
  20. "    }"
  21. "    :boxed_column {"
  22. "        label = \"函数列表(&L)\" ;"
  23. "        :list_box {"
  24. "            key = \"key4\" ;"
  25. "        }"
  26. "    }"
  27. "    :edit_box {"
  28. "        key = \"key5\" ;"
  29. "        label = \"功能(&F)\" ;"
  30. "    }"
  31. "    :edit_box {"
  32. "        key = \"key6\" ;"
  33. "        label = \"用法(&U)\" ;"
  34. "    }"
  35. "    :spacer {}"
  36. "        :row {"
  37. "    ok_cancel;"
  38. "        :button {"
  39. "            key = \"key7\" ;"
  40. "            label = \"执行(&R)\" ;"
  41. "            fixed_width = true ;"
  42. "            width = 12 ;"
  43. "        }"
  44. "        }"
  45. "}"
  46.         )
  47.     )
  48.     (setq file (vl-filename-mktemp "DclTemp.dcl"))
  49.     (setq f (open file "w"))
  50.     (foreach str lst_str
  51.   (princ "\n" f)
  52.   (princ str f)
  53.     )
  54.     (close f)
  55.     file
  56. )
  57. ;读取txt文本文件,按行组成表
  58. (defun xx-txt2lst(files / out)
  59. (setq file (open files "r"))
  60. (setq out '())
  61. (while (setq a (read-line file))
  62.       (if (= (substr a 1 2) ";[");只提取";["开头的行.
  63.       (setq out (cons a out))
  64.       )
  65.   )
  66. (close file)
  67. (setq out (reverse out))
  68. )
  69. ;填充列表框
  70. (defun fill-list-box (key lst)
  71.      (start_list key)
  72.      (mapcar 'add_list lst)
  73.      (end_list)
  74. )
  75. ;;返回关键字所在的字符串表位置
  76. ;;code by edata@mjtd
  77. (defun sk_ss_str(str_lst key_str / i lst lst2)
  78.   (setq i -1 lst str_lst)
  79.   (while (setq a(car lst))
  80.     (setq lst(cdr lst) i (1+ i))
  81.     (if(wcmatch a (strcat "*" key_str "*"))
  82.       (setq lst2(cons  i lst2)))
  83.     )
  84.   (if lst2 (setq lst2(reverse lst2)))
  85. )
  86. ;=================程序开始========================
  87. (defun C:HSSS( / lst  lst1 lst2 lstx1 lstx2 dcl_file)
  88.   (setq f(open "D:\\XX工具箱\\我的函数库.lsp" "r"))
  89.   (if f (progn (and f (close f))(setq sk_path  "D:\\XX工具箱\\我的函数库.lsp"))
  90.     (or sk_path (setq sk_path(getfiled "选择函数库文件" "c:/" "lsp;dat;txt;*" 8))))
  91. (if sk_path
  92.   (progn   
  93. (setq lst  (xx-txt2lst sk_path)
  94.       lst1  (vl-remove-if '(lambda (x) (/= (substr x 1 (if (= (getvar 'lispsys) 1) 5 7)) ";[功能]")) lst)
  95.       lst2  (vl-remove-if '(lambda (x) (/= (substr x 1 (if (= (getvar 'lispsys) 1) 5 7)) ";[用法]")) lst)
  96.       lst1  (mapcar '(lambda (x) (substr x (if (= (getvar 'lispsys) 1) 6 8))) lst1)
  97.       lst2  (mapcar '(lambda (x) (substr x (if (= (getvar 'lispsys) 1) 6 8))) lst2)
  98.       lstx1 lst1
  99.       lstx2 lst2
  100.       )
  101. (setq dcl_id (load_dialog (setq dcl_file (make-dcl))))
  102. (if(findfile dcl_file)(vl-file-delete dcl_file))
  103. (new_dialog "hsss" dcl_id)
  104. (fill-list-box "key4" lstx1)
  105. (action_tile "key2" "(act-key2 lst1 lst2)")
  106. (action_tile "key3" "(act-key3)")
  107. (action_tile "key4" "(act-key4)")
  108. (action_tile "accept" "(act-key5)(done_dialog)")
  109. (action_tile "key7" "(act-key7)(done_dialog)")
  110. (start_dialog)(unload_dialog dcl_id)
  111. )
  112.   )
  113. (princ)
  114. )
  115. ;============DCL动作=============
  116. (defun act-key2(lst1 lst2 / str)
  117. (setq str (get_tile "key1"))   
  118.   (if (setq key_ss (sk_ss_str lst1 str))
  119.     (progn
  120.       (setq i -1 lstx1 '()  lstx2 '())
  121.       (while(setq a (nth (setq i (1+ i)) key_ss))
  122.         (setq lstx1(cons (nth a lst1) lstx1))
  123.         (setq lstx2(cons (nth a lst2) lstx2))
  124.         )
  125.       (if(and lstx1 lstx2)
  126.         (progn
  127.         (setq lstx1 (reverse lstx1)
  128.               lstx2 (reverse lstx2))
  129.         (fill-list-box "key4" lstx1)
  130.         )
  131.         )
  132.       )
  133.     (fill-list-box "key4" '("Sorry,未找到与描述相符的函数!"))
  134.     )
  135. )
  136. ;
  137. (defun act-key4( / n)
  138. (setq n (atoi (get_tile "key4")))     
  139. (set_tile "key5" (nth n lstx1))
  140. (set_tile "key6" (nth n lstx2))
  141. )
  142. ;
  143. (defun act-key3 ()
  144. (setq lstx1 lst1 lstx2 lst2)
  145. (fill-list-box "key4" lst1)
  146. )
  147. ;
  148. (defun act-key5        (/ str)
  149.   (if (/= (setq str (get_tile "key6")) "")
  150.     (sk_SetClipboard str)
  151.   )
  152. )
  153. ;
  154. (defun act-key7        (/ str)
  155.   (if (/= (setq str (get_tile "key6")) "")
  156.     (progn
  157.       (sk_SetClipboard str)
  158.     (if sk_path(load  sk_path))
  159.       (vla-SendCommand (vla-get-activedocument(vlax-get-acad-object)) (strcat str " "))
  160.        )
  161.   )
  162. )
  163. (defun sk_SetClipboard(clip / htm Clip_Bord);设置剪切板
  164. (setq htm (vlax-create-object "htmlfile"))
  165. (setq Clip_Bord (Vlax-Get-Property (Vlax-Get htm 'ParentWindow) 'ClipboardData))
  166. (Vlax-Invoke Clip_Bord 'SetData "text" clip)
  167. )

回复 支持 1 反对 0

使用道具 举报

发表于 2023-8-30 22:40 | 显示全部楼层
本帖最后由 mituzhe 于 2023-8-30 22:42 编辑
mituzhe 发表于 2023-8-30 19:33
为啥我的没有搜索结果啊,我这函数库格式应该没问题吧.路径也改了的

我找到问题了, 楼里给的代码, 判断lispsys只考虑到了 0 和 1, 我设置的是2
 楼主| 发表于 2014-7-7 17:48 | 显示全部楼层

函数搜索,便于大家收集整理自己的函数库~~~

本帖最后由 77077 于 2014-7-9 10:56 编辑

多谢各位高手指点,程序完成,贴上源码!
使用说明:
    1.本人也是新手,还在收集代码中,所以特写了此程序,方便搜索自己收集的函数.
    2.务必将代码中"D:\\XX工具箱\\我的函数库.lsp" 修改为自己的函数所在位置.
    3. 只管在"我的函数库.lsp "文件中按格式添加函数即可,无需另外编写索引什么的.添加函数的时候,务必在函数的前两行写入";[功能]xxxxxxxxx  ;[用法]xxxxxxxxxxxxx"以便搜索.
  1. (defun make-dcl  (/ lst_str str file f)
  2.     (setq lst_str '(
  3. "hsss:dialog {"
  4. "    label = "函数搜索" ;"
  5. "    :spacer {}"
  6. "    :row {"
  7. "        :edit_box {"
  8. "            key = "key1" ;"
  9. "            label = "关键词" ;"
  10. "            width = 60 ;"
  11. "        }"
  12. "        :button {"
  13. "            key = "key2" ;"
  14. "            label = "搜索" ;"
  15. "        }"
  16. "        :button {"
  17. "            key = "key3" ;"
  18. "            label = "显示全部" ;"
  19. "        }"
  20. "    }"
  21. "    :boxed_column {"
  22. "        label = "函数列表" ;"
  23. "        :list_box {"
  24. "            key = "key4" ;"
  25. "        }"
  26. "    }"
  27. "    :edit_box {"
  28. "        key = "key5" ;"
  29. "        label = "功能" ;"
  30. "    }"
  31. "    :edit_box {"
  32. "        key = "key6" ;"
  33. "        label = "用法" ;"
  34. "    }"
  35. "    :spacer {}"
  36. "    ok_cancel;"
  37. "}"
  38.         )
  39.     )
  40.     (setq file (vl-filename-mktemp "DclTemp.dcl"))
  41.     (setq f (open file "w"))
  42.     (foreach str lst_str
  43.   (princ "\n" f)
  44.   (princ str f)
  45.     )
  46.     (close f)
  47.     file
  48. )
  49. ;读取txt文本文件,按行组成表
  50. (defun xx-txt2lst(files / out)
  51. (setq file (open files "r"))
  52. (setq out '())
  53. (while (setq a (read-line file))
  54.       (if (= (substr a 1 2) ";[");只提取";["开头的行.
  55.       (setq out (cons a out))
  56.       )
  57.   )
  58. (close file)
  59. (setq out (reverse out))
  60. )
  61. ;填充列表框
  62. (defun fill-list-box (key lst)
  63.      (start_list key)
  64.      (mapcar 'add_list lst)
  65.      (end_list)
  66. )
  67. ;;返回关键字所在的字符串表位置
  68. ;;code by edata@mjtd
  69. (defun sk_ss_str(str_lst key_str / i lst lst2)
  70.   (setq i -1 lst str_lst)
  71.   (while (setq a(car lst))
  72.     (setq lst(cdr lst) i (1+ i))
  73.     (if(wcmatch a (strcat "*" key_str "*"))
  74.       (setq lst2(cons  i lst2)))
  75.     )
  76.   (if lst2 (setq lst2(reverse lst2)))
  77. )
  78. ;=================程序开始========================
  79. (defun C:HSSS( / lst  lst1 lst2 lstx1 lstx2)
  80. (setq lst  (xx-txt2lst "D:\\XX工具箱\\我的函数库.lsp")
  81.       lst1  (vl-remove-if '(lambda (x) (/= (substr x 1 7) ";[功能]")) lst)
  82.       lst2  (vl-remove-if '(lambda (x) (/= (substr x 1 7) ";[用法]")) lst)
  83.       lst1  (mapcar '(lambda (x) (substr x 8)) lst1)
  84.       lst2  (mapcar '(lambda (x) (substr x 8)) lst2)
  85.       lstx1 lst1
  86.       lstx2 lst2
  87.       )
  88. (setq dcl_id (load_dialog (make-dcl))) (new_dialog "hsss" dcl_id)
  89. (fill-list-box "key4" lstx1)
  90. (action_tile "key2" "(act-key2 lst1 lst2)")
  91. (action_tile "key3" "(act-key3)")
  92. (action_tile "key4" "(act-key4)")
  93. (start_dialog)(unload_dialog dcl_id)
  94. (princ)
  95. )
  96. ;============DCL动作=============
  97. (defun act-key2(lst1 lst2 / str)
  98. (setq str (get_tile "key1"))   
  99.   (if (setq key_ss (sk_ss_str lst1 str))
  100.     (progn
  101.       (setq i -1 lstx1 '()  lstx2 '())
  102.       (while(setq a (nth (setq i (1+ i)) key_ss))
  103.         (setq lstx1(cons (nth a lst1) lstx1))
  104.         (setq lstx2(cons (nth a lst2) lstx2))
  105.         )
  106.       (if(and lstx1 lstx2)
  107.         (progn
  108.         (setq lstx1 (reverse lstx1)
  109.               lstx2 (reverse lstx2))
  110.         (fill-list-box "key4" lstx1)
  111.         )
  112.         )
  113.       )
  114.     (fill-list-box "key4" '("Sorry,未找到与描述相符的函数!"))
  115.     )
  116. )
  117. ;
  118. (defun act-key4( / n)
  119. (setq n (atoi (get_tile "key4")))     
  120. (set_tile "key5" (nth n lstx1))
  121. (set_tile "key6" (nth n lstx2))
  122. )
  123. ;
  124. (defun act-key3 ()
  125. (setq lstx1 lst1 lstx2 lst2)
  126. (fill-list-box "key4" lst1)
  127. )

评分

参与人数 2明经币 +2 收起 理由
zctao1966 + 1 很给力!
yaokui25 + 1 很给力!

查看全部评分

 楼主| 发表于 2014-7-7 17:49 | 显示全部楼层

本帖子中包含更多资源

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

x
发表于 2014-7-7 18:07 | 显示全部楼层
点确定后应该直接复制到剪切板
发表于 2014-7-7 21:04 | 显示全部楼层
这样查找自己的函数就放便多了
发表于 2014-7-7 22:12 | 显示全部楼层
  1. (defun act-key2()
  2.   (setq key_ss(sk_ss_str lst1 (get_tile "key1")))  
  3.   (set_tile "key4" (nth (car key_ss) lst1))
  4.   (set_tile "key5" (nth (car key_ss) lst2))
  5.   )


  1. ;;返回关键字所在的字符串表位置2
  2. ;;code by edata@mjtd
  3. (defun sk_ss_str(str_lst key_str / i lst lst2)
  4.   (setq i -1 lst str_lst)
  5.   (while (setq a(car lst))
  6.     (setq lst(cdr lst) i (1+ i))
  7.     (if(wcmatch a (strcat "*" key_str "*"))
  8.       (setq lst2(cons  i lst2)))
  9.     )
  10.   (if lst2 (setq lst2(reverse lst2)))
  11.     )
发表于 2014-7-7 22:35 | 显示全部楼层
  1. ;;;======相关函数===========*
  2. ;读取txt文本文件,按行组成表
  3. (defun xx-txt2lst(files / out)
  4. (setq file (open files "r"))
  5. (setq out '())
  6. (while (setq a (read-line file))
  7.       (setq out (cons a out))
  8.   )
  9. (close file)
  10. (setq out (reverse out))
  11. )
  12. (defun fill-list-box (key lst)
  13.      (start_list key)
  14.      (mapcar 'add_list lst)
  15.      (end_list)
  16. )
  17. ;========主程序=============*

  18. (defun C:HSSS()
  19. (setq lst  (xx-txt2lst "c:\\我的函数库.lsp");读取lsp文件中的内容
  20.       lst1  (vl-remove-if '(lambda (x) (/= (substr x 1 7) ";[功能]")) lst);提取以;[功能]开头的行,保存为lst1
  21.       lst2  (vl-remove-if '(lambda (x) (/= (substr x 1 7) ";[用法]")) lst);提取以;[用法]开头的行,保存为lst2
  22.       lst1  (mapcar '(lambda (x) (substr x 8)) lst1);返回函数功能列表
  23.       lst2  (mapcar '(lambda (x) (substr x 8)) lst2);返回函数用法列表
  24.       lstx lst1
  25.       lstx1 lst1
  26.       lstx2 lst2
  27.       )
  28. (setq dcl_id (load_dialog "hsss.dcl"));(make-dcl)))
  29.   (new_dialog "hsss" dcl_id)
  30. (fill-list-box "key3" lstx)
  31.   (action_tile "key2" "(act-key2 lst1 lst2)")
  32. (action_tile "key3" "(act-key3)")
  33. (start_dialog)(unload_dialog dcl_id)
  34. (princ)
  35. )
  36. (defun act-key3( / n)
  37. (setq n (atoi (get_tile "key3")))     
  38. (set_tile "key4" (nth n lstx1))
  39. (set_tile "key5" (nth n lstx2))
  40. )

  41. (defun act-key2(lst1 lst2 / str)
  42. (setq str (get_tile "key1"))   
  43.       lstx ()
  44.   (if (setq key_ss(sk_ss_str lst1 str))
  45.     (progn
  46.       (setq i -1 lstx1 nil  lstx2 nil)
  47.       (while(setq a(nth (setq i (1+ i)) key_ss))
  48.         (setq lstx1(cons (nth a lst1) lstx1))
  49.         (setq lstx2(cons (nth a lst2) lstx2))
  50.         )
  51.       (if(and lstx1 lstx2)
  52.         (progn
  53.         (setq lstx1 (reverse lstx1)
  54.               lstx2 (reverse lstx2))
  55.         (fill-list-box "key3" lstx1)
  56.         )
  57.         )
  58.       )
  59.     (fill-list-box "key3" '("未找到与描述相符的函数"))
  60.     )
  61. )

  62. ;;返回关键字所在的字符串表位置2
  63. ;;code by edata@mjtd
  64. (defun sk_ss_str(str_lst key_str / i lst lst2)
  65.   (setq i -1 lst str_lst)
  66.   (while (setq a(car lst))
  67.     (setq lst(cdr lst) i (1+ i))
  68.     (if(wcmatch a (strcat "*" key_str "*"))
  69.       (setq lst2(cons  i lst2)))
  70.     )
  71.   (if lst2 (setq lst2(reverse lst2)))
  72.     )

评分

参与人数 1明经币 +1 收起 理由
lucas_3333 + 1 赞一个!

查看全部评分

发表于 2014-7-8 08:23 | 显示全部楼层
为什么沙发层函数内容是空的???
 楼主| 发表于 2014-7-8 08:59 | 显示全部楼层
机械工程师 发表于 2014-7-8 08:23
为什么沙发层函数内容是空的???

这只是一个例子,函数根据需要自己收集,按照格式填入.
发表于 2014-7-10 15:01 | 显示全部楼层
这个方便实用。
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2024-3-28 21:26 , Processed in 0.259581 second(s), 35 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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