乐筑天下

搜索
欢迎各位开发者和用户入驻本平台 尊重版权,从我做起,拒绝盗版,拒绝倒卖 签到、发布资源、邀请好友注册,可以获得银币 请注意保管好自己的密码,避免账户资金被盗
楼主: asos2000

[编程交流] 如何创建*。exe文件到

[复制链接]

51

主题

481

帖子

457

银币

后起之秀

Rank: 20Rank: 20Rank: 20Rank: 20

铜币
262
发表于 2022-7-6 18:22:47 | 显示全部楼层
霍斯敦
是plz
回复

使用道具 举报

1

主题

15

帖子

17

银币

初来乍到

Rank: 1

铜币
5
发表于 2022-7-6 18:30:31 | 显示全部楼层
好啊我将直接在这里粘贴代码,然后我们可以了解细节。
 
  1. ;;HubbardCADInstall
  2. ;;Installs the custom Hubbard menus and commands to AutoCAD
  3. ;;Copyright 2008 Hubbard Engineering
  4. ;;625 N. Gilbert Road Suite 106
  5. ;;Gilbert, Arizona  85234
  6. ;;heaz dot us
  7. ;;Licensed to the public under the terms of the GNU General Public License
  8. ;;This is Free Software. For more info read the license at fsf dot org.
  9. (DEFUN C:HCI () (C:HUBBARDCADINSTALL))
  10. (DEFUN
  11.   C:HUBBARDCADINSTALL ()
  12. ;;Add to or fix Support Files Search Path
  13. (HUBBARD-UPDATE-SUPPORTPATHS)
  14. ;;Add to or fix Printer Support File Path\Plot Style Table Search Path
  15. (HUBBARD-UPDATE-PLOTSTYLE-PATH)
  16. ;;Add or reload the Hubbard menus
  17. (HUBBARD-RELOAD-MENUS)
  18. ;;Exit quietly
  19. (PRINC)
  20. )
  21. (DEFUN C:HCM () (C:HUBBARDCADMENUS))
  22. (DEFUN C:HUBBARDCADMENUS () (HUBBARD-RELOAD-MENUS))
  23. (DEFUN
  24.   HUBBARD-UPDATE-SUPPORTPATHS (/ NEWUSERPATH)
  25. (SETQ NEWUSERPATH (STRCAT "R:\\AutoCADUsers\" (HUBBARD-USERNAME)))
  26. ;;Remove paths
  27. (REMOVE-SUPPORTPATH "R:\\HawsEDC")
  28. (REMOVE-SUPPORTPATH "R:\\AutoCADBlocks")
  29. (REMOVE-SUPPORTPATH "R:\\AutoCADMenu")
  30. (REMOVE-SUPPORTPATH "R:\\AutoCADSupport")
  31. (REMOVE-SUPPORTPATH NEWUSERPATH)
  32. ;;Remove old user path
  33. (REMOVE-SUPPORTPATH
  34.    (STRCAT "R:\\AutoCADUsers\" (HUBBARD-USERNAME-2008-05))
  35. )
  36. ;;Add paths in reverse order at top
  37. (ADD-SUPPORTPATH "R:\\HawsEDC")
  38. (ADD-SUPPORTPATH "R:\\AutoCADBlocks")
  39. (ADD-SUPPORTPATH "R:\\AutoCADMenu")
  40. (ADD-SUPPORTPATH "R:\\AutoCADSupport")
  41. (ADD-SUPPORTPATH NEWUSERPATH)
  42. )
  43. (DEFUN
  44.   HUBBARD-UPDATE-PLOTSTYLE-PATH ()
  45. (VLA-PUT-PRINTERSTYLESHEETPATH
  46.    (VLA-GET-FILES (VLA-GET-PREFERENCES (ACAD-OBJECT)))
  47.    "R:\\AutoCADSupport"
  48. )
  49. )
  50. (DEFUN
  51.   HUBBARD-RELOAD-MENUS (/ ISALLMENUSREQUESTED ISMENUREMOVED USERINPUT
  52.                         NMENUS HUBBARDMENUS COUNTER GROUP
  53.                        )
  54. (SETQ
  55.    HUBBARDMENUS
  56.     '("HawsEDC" "CNM" "FunKy" "Hubbard")
  57.    ISALLMENUSREQUESTED NIL
  58. )
  59. (FOREACH
  60.     GROUP HUBBARDMENUS
  61.    (SETQ
  62.      COUNTER -1
  63.      ISMENUREMOVED NIL
  64.      NMENUS
  65.       (VLA-GET-COUNT (VLA-GET-MENUGROUPS (ACAD-OBJECT)))
  66.    )
  67.    (COND
  68.      ;;If user gives permission
  69.      ((OR ISALLMENUSREQUESTED
  70.           (PROGN
  71.             (INITGET "Yes No All")
  72.             (/= "No"
  73.                 (SETQ
  74.                   USERINPUT
  75.                    (GETKWORD
  76.                      (STRCAT
  77.                        "\nLoad "
  78.                        GROUP
  79.                        " menu? [Yes/No/All] <Yes>: "
  80.                      )
  81.                    )
  82.                 )
  83.             )
  84.           )
  85.       )
  86.       (COND ((= USERINPUT "All") (SETQ ISALLMENUSREQUESTED T)))
  87.       ;;1.  Unload the menu if present
  88.       ;;Loop through load menus to find and unload this menu.
  89.       (WHILE (AND
  90.                (< (SETQ COUNTER (1+ COUNTER)) NMENUS)
  91.                (NOT ISMENUREMOVED)
  92.              )
  93.         (COND
  94.           ((= (STRCASE
  95.                 (VLA-GET-NAME
  96.                   (VLA-ITEM (VLA-GET-MENUGROUPS (ACAD-OBJECT)) COUNTER)
  97.                 )
  98.               )
  99.               (STRCASE GROUP)
  100.            )
  101.            (VLA-UNLOAD
  102.              (VLA-ITEM (VLA-GET-MENUGROUPS (ACAD-OBJECT)) COUNTER)
  103.            )
  104.            (SETQ ISMENUREMOVED T)
  105.           )
  106.         )
  107.       )
  108.       ;;2.  Load the menu.
  109.       (VLA-LOAD
  110.         (VLA-GET-MENUGROUPS (ACAD-OBJECT))
  111.         (FINDFILE (STRCAT GROUP ".mnu"))
  112.       )
  113.      )
  114.    )
  115. )
  116. )
  117. (DEFUN
  118.   ACAD-OBJECT ()
  119. (COND
  120.    (*ACAD-OBJECT*)
  121.    (T (SETQ *ACAD-OBJECT* (VLAX-GET-ACAD-OBJECT)))
  122. )
  123. )
  124. (DEFUN
  125.   ADD-SUPPORTPATH (NEWSTRING / FILES)
  126. (SETQ FILES (VLA-GET-FILES (VLA-GET-PREFERENCES (ACAD-OBJECT))))
  127. (VLA-PUT-SUPPORTPATH
  128.    FILES
  129.    (STRCAT NEWSTRING ";" (VLA-GET-SUPPORTPATH FILES))
  130. )
  131. )
  132. (DEFUN
  133.   REMOVE-SUPPORTPATH (STRING / FILES OLDSUPPORTPATH POSITION)
  134. (SETQ
  135.    FILES
  136.     (VLA-GET-FILES (VLA-GET-PREFERENCES (ACAD-OBJECT)))
  137.    OLDSUPPORTPATH
  138.     (VLA-GET-SUPPORTPATH FILES)
  139.    POSITION
  140.     (VL-STRING-SEARCH
  141.       (STRCASE STRING)
  142.       (STRCASE OLDSUPPORTPATH)
  143.     )
  144. )
  145. (COND
  146.    (POSITION
  147.     (VLA-PUT-SUPPORTPATH
  148.       FILES
  149.       (STRCAT
  150.         (SUBSTR OLDSUPPORTPATH 1 POSITION)
  151.         (SUBSTR OLDSUPPORTPATH (+ POSITION (STRLEN STRING) 2))
  152.       )
  153.     )
  154.    )
  155. )
  156. )
  157. (DEFUN
  158.   HUBBARD-USERNAME (/ RDLIN USERLIST)
  159. (SETQ F1 (OPEN "R:\\Network\\networknames.txt" "r"))
  160. (WHILE (SETQ RDLIN (READ-LINE F1))
  161.    (SETQ USERLIST (CONS (WIKI-STRTOLST RDLIN "`," """ T) USERLIST))
  162. )
  163. (SETQ F1 (CLOSE F1))
  164. (CADDR (ASSOC (GETVAR "loginname") USERLIST))
  165. )
  166. (DEFUN
  167.   HUBBARD-USERNAME-2008-05 ()
  168. (CDR
  169.    (ASSOC
  170.      (STRCASE (HAWS-GETCOMPUTERNAME))
  171.      '(("BECKY" . "Becky")
  172.        ("BEN" . "Ben")
  173.        ("BRIDGET" . "Bridget")
  174.        ("CRAIG-D" . "Craig-D")
  175.        ("CRAIG-H" . "Craig-H")
  176.        ("DAVID" . "David")
  177.        ("JEREMYPC" . "Jeremy")
  178.        ("ADMIN-2" . "Kayle")
  179.        ("KENNY" . "Kenny")
  180.        ("MACK" . "Mack")
  181.        ("MIKE" . "Mike")
  182.        ("MICHAEL" . "Michael")
  183.        ("SERVER" . "Server")
  184.        ("TABATHA" . "Tabatha")
  185.        ("TOM" . "Tom")
  186.       )
  187.    )
  188. )
  189. )
  190. ;; See next post for wiki-strtolst function from wikia dot com
  191. ;|«Visual LISP© Format Options»
  192. (72 2 40 2 nil "end of " 60 2 2 2 1 nil nil nil T)
  193. ;*** DO NOT add text below the comment! ***|;
回复

使用道具 举报

1

主题

15

帖子

17

银币

初来乍到

Rank: 1

铜币
5
发表于 2022-7-6 18:36:16 | 显示全部楼层
以下是不适用的wiki功能:
 
  1. ;;The following function was copied from AutoCAD Wiki at Wikia dot com
  2. ;;;WIKI-STRTOLST
  3. ;;;Parses a string into a list of fields.
  4. ;;;Usage: (wiki-strtolst
  5. ;;;         [inputString containing fields]
  6. ;;;         [FieldSeparatorWC field delimiter wildcard string
  7. ;;;          Use "`," for comma and " ,\t" for white space
  8. ;;;         ]
  9. ;;;         [TextDelimiter text delimiter character.]
  10. ;;;         [EmptyFieldsDoCount flag.
  11. ;;;           If nil, consecutive field delimiters are ignored.
  12. ;;;           Nil is good for word (white space) delimited strings.
  13. ;;;         ]
  14. ;;;       )
  15. ;|
  16.   Edit the source code for this function at
  17.   (redacted due to anti-spam measures htt..wikia...com/wiki/Strtolst)
  18. |;
  19. ;;;Avoid cleverness.
  20. ;;;Human readability trumps elegance and economy and cleverness here.
  21. ;;;This should be readable to a programmer familiar with any language.
  22. ;;;In this function, I'm trying to honor readability in a new (2008) way.
  23. ;;;And I am trying a new commenting style.
  24. ;;;Tests
  25. ;;;(alert (apply 'strcat (mapcar '(lambda (x) (strcat "\n----\n" x)) (wiki-strtolst "1 John,"2 2"" pipe,\nheated",3 the end,,,,," "`," """ nil))))
  26. ;;;(alert (apply 'strcat (mapcar '(lambda (x) (strcat "\n----\n" x)) (wiki-strtolst "1 John,"2 2"" pipe,\nheated",3 the end,,,,," "`," """ T))))
  27. (DEFUN
  28.   WIKI-STRTOLST (INPUTSTRING FIELDSEPARATORWC TEXTDELIMITER
  29.                  EMPTYFIELDSDOCOUNT / CHARACTERCOUNTER CONVERSIONISDONE
  30.                  CURRENTCHARACTER CURRENTFIELD CURRENTFIELDISDONE
  31.                  FIRSTCHARACTERINDEX PREVIOUSCHARACTER RETURNLIST
  32.                  TEXTMODEISON
  33.                 )
  34. ;;Initialize the variables for clarity's sake
  35. (SETQ
  36.    FIRSTCHARACTERINDEX 1
  37.    CHARACTERCOUNTER
  38.     (1- FIRSTCHARACTERINDEX)
  39.    PREVIOUSCHARACTER ""
  40.    CURRENTCHARACTER ""
  41.    CURRENTFIELD ""
  42.    CURRENTFIELDISDONE NIL
  43.    TEXTMODEISON NIL
  44.    CONVERSIONISDONE NIL
  45.    RETURNLIST NIL
  46. )
  47. ;;Make sure that the FieldSeparatorWC is not empty.
  48. (COND
  49.    ;;If an empty string matches the FieldSeparatorWC,
  50.    ((WCMATCH "" FIELDSEPARATORWC)
  51.     ;;Then
  52.     ;;1. Give an alert about the problem.
  53.     (ALERT
  54.       ;;Include princ to allow user to see and copy error
  55.       ;;after dismissing alert box.
  56.       (PRINC
  57.         (STRCAT
  58.           "\n""
  59.           FIELDSEPARATORWC
  60.           "" is not a valid field delimiter."
  61.         )
  62.       )
  63.     )
  64.     ;;2. Exit with error.
  65.     (EXIT)
  66.    )
  67. )
  68. ;;Start the main character-by-character InputString examination loop.
  69. (WHILE (NOT CONVERSIONISDONE)
  70.    (SETQ
  71.      ;;Save CurrentCharacter as PreviousCharacter.
  72.      PREVIOUSCHARACTER
  73.       CURRENTCHARACTER
  74.      ;;CharacterCounter is initialized above to start 1 before first character.  Increment it.
  75.      CHARACTERCOUNTER
  76.       (1+ CHARACTERCOUNTER)
  77.      ;;Get new CurrentCharacter from InputString.
  78.      CURRENTCHARACTER
  79.       (SUBSTR INPUTSTRING CHARACTERCOUNTER 1)
  80.    )
  81.    ;;Decide what to do with CurrentCharacter.
  82.    (COND
  83.      ;;If
  84.      ((AND
  85.         ;;there is a TextDelimiter,
  86.         (/= TEXTDELIMITER "")
  87.         ;;and CurrentCharacter is a TextDelimiter,
  88.         (= CURRENTCHARACTER TEXTDELIMITER)
  89.       )
  90.       ;;then
  91.       ;;1.  Toggle the TextModeIsOn flag
  92.       (IF (NOT TEXTMODEISON)
  93.         (SETQ TEXTMODEISON T)
  94.         (SETQ TEXTMODEISON NIL)
  95.       )
  96.       ;;2.  If this is the second consecutive TextDelimiter character, then
  97.       (IF (= PREVIOUSCHARACTER TEXTDELIMITER)
  98.         ;;Output it to CurrentField.
  99.         (SETQ CURRENTFIELD (STRCAT CURRENTFIELD CURRENTCHARACTER))
  100.       )
  101.      )
  102.      ;;Else if CurrentCharacter is a FieldDelimiter wildcard match,
  103.      ((WCMATCH CURRENTCHARACTER FIELDSEPARATORWC)
  104.       ;;Then
  105.       (COND
  106.         ;;If TextModeIsOn = True, then
  107.         ((= TEXTMODEISON T)
  108.          ;;Output CurrentCharacter to CurrentField.
  109.          (SETQ CURRENTFIELD (STRCAT CURRENTFIELD CURRENTCHARACTER))
  110.         )
  111.         ;;Else if
  112.         ((OR ;;EmptyFieldsDoCount, or
  113.              (= EMPTYFIELDSDOCOUNT T)
  114.              ;;the CurrentField isn't empty,
  115.              (/= "" CURRENTFIELD)
  116.          )
  117.          ;;Then
  118.          ;;Set the CurrentFieldIsDone flag to true.
  119.          (SETQ CURRENTFIELDISDONE T)
  120.         )
  121.         (T
  122.          ;;Else do nothing
  123.          ;;Do not flag the CurrentFieldDone,
  124.          ;;nor output the CurrentCharacter.
  125.          NIL
  126.         )
  127.       )
  128.      )
  129.      ;;Else if CurrentCharacter is empty,
  130.      ((= CURRENTCHARACTER "")
  131.       ;;Then
  132.       ;;We are at the end of the string.
  133.       ;;1.  Flag ConversionIsDone.
  134.       (SETQ CONVERSIONISDONE T)
  135.       ;;2.  If
  136.       (IF (OR ;;EmptyFieldsDoCount, or
  137.               EMPTYFIELDSDOCOUNT
  138.               ;;the PreviousCharacter wasn't a FieldSeparatorWC, or
  139.               (NOT (WCMATCH PREVIOUSCHARACTER FIELDSEPARATORWC))
  140.               ;;the ReturnList is still nil due to only empty non-counting fields in string,
  141.               ;;(Added 2008-02-18 TGH. Bug fix.)
  142.               (= RETURNLIST NIL)
  143.           )
  144.         ;;Then flag the CurrentFieldIsDone to wrap up the last field.
  145.         (SETQ CURRENTFIELDISDONE T)
  146.       )
  147.      )
  148.      ;;Else (CurrentCharacter is something else),
  149.      (T
  150.       ;;Output CurrentCharacter to CurrentField.
  151.       (SETQ CURRENTFIELD (STRCAT CURRENTFIELD CURRENTCHARACTER))
  152.      )
  153.    )
  154.    ;;If CurrentFieldIsDone,
  155.    (IF CURRENTFIELDISDONE
  156.      ;;Then
  157.      ;;Output it to the front of ReturnList.
  158.      (SETQ
  159.        RETURNLIST
  160.         (CONS CURRENTFIELD RETURNLIST)
  161.        ;;Start a new CurrentField.
  162.        CURRENTFIELD
  163.         ""
  164.        CURRENTFIELDISDONE NIL
  165.      )
  166.    )
  167.    ;;End the main character-by-character InputString examination loop.
  168. )
  169. ;;Reverse the backwards return list and we are done.
  170. (REVERSE RETURNLIST)
  171. )
回复

使用道具 举报

发表回复

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

  • 微信公众平台

  • 扫描访问手机版

  • 点击图片下载手机App

QQ|关于我们|小黑屋|乐筑天下 繁体中文

GMT+8, 2025-3-4 14:02 , Processed in 0.460572 second(s), 56 queries .

© 2020-2025 乐筑天下

联系客服 关注微信 帮助中心 下载APP 返回顶部 返回列表