乐筑天下

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

[编程交流] 在我看来

[复制链接]

40

主题

132

帖子

107

银币

后起之秀

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

铜币
227
发表于 2022-7-6 17:09:57 | 显示全部楼层 |阅读模式
我有一个真正的老Lisp程序,可以使用看看谁能帮我配置/更新这个Lisp程序-我打赌它是一个门将-
其中一个文件是。bmp不知道这是什么意思,希望有人能帮上忙!
谢谢大家
回复

使用道具 举报

40

主题

132

帖子

107

银币

后起之秀

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

铜币
227
发表于 2022-7-6 17:48:44 | 显示全部楼层
  1. ;;;   Table.lsp
  2. ;;;   
  3. ;;;   Permission to use, copy, modify, and distribute this software and its
  4. ;;;   documentation for any purpose and without fee is hereby granted.  
  5. ;;;
  6. ;;;   THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY.
  7. ;;;   ALL IMPLIED WARRANTIES OF FITNESS FOR ANY PARTICULAR PURPOSE AND OF
  8. ;;;   MERCHANTABILITY ARE HEREBY DISCLAIMED.
  9. ;;;
  10. ;;;   Copyright© Roy Everitt
  11. ;;;   February, 2000
  12. ;;;
  13. ;;;    Note: Older versions of Autocad will not recognize the *error* function. You will
  14. ;;;          need to replace the (defun-q *error* (msg) statement with (defun *error* (msg).
  15. ;;;
  16. ;;;    Generate a Table or Chart using a combination of the "dimtxt" and "dimscale"
  17. ;;;    settings from the Autocad drawing to determine the appropriate table text sizes.
  18. ;;;    The only known limitations for the size of table (I.E. number of rows and
  19. ;;;    number of columns) is the input dialogs. Generally, depending on the size of
  20. ;;;    your monitor and the screen resolution settings, a 10 X 10 matrix, (default) will not
  21. ;;;    exceed Autocad's ability to build the edit box dialogs and display them for input.
  22. ;;;    Keep this in mind if you get any dialog errors. Try smaller row and column input
  23. ;;;    combinations, until you can determine what your system's display limitation is.
  24. ;;;    The 10 X 10 matrix limit established from the popup list can be increased to whatever
  25. ;;;    your preferences might be, by adjusting the popup list values in the "set_row" &
  26. ;;;    "set_col" functions.
  27. ;;;    The edit_box defaults for row and column inputs have been set to an edit_width of
  28. ;;;    (7) and an edit_limit of (20). You can adjust these settings to enhance the dialog
  29. ;;;    input capabilities for various screen size and resolution limitations as well.
  30. ;;;    The program gives you the ability to input the (body) of matrix text, by using the
  31. ;;;    tab key, (by default), to step through row and column input.
  32. ;;;    For those who prefer to input the (body) of matrix text, by columns, the program will
  33. ;;;    also allow you to step through input by columns. Place the cursor at the top of each
  34. ;;;    column, then use the return (enter) key to move down to the next row for input.
  35. ;;;
  36. ;;;    The program also generates a custom DCL file (temp.dcl) that is re-written each
  37. ;;;    time it is executed. The code may be changed so that temp.dcl is written to, and
  38. ;;;    found in any user preferred folder, as long as that folder is in the Support Files
  39. ;;;    Search Path.
  40. ;;;    Note: By default, it will be written in your Autocad Working Directory, (wherever
  41. ;;;          your shortcut or "Start In" Icon is set up to work).
  42. ;;;    Example: Look for the code: (setq fd (open "temp.dcl" "w"))
  43. ;;;             Change it to: (setq fd (open "c:\\myfolder\\temp.dcl" "w"))
  44. ;;;             Look for the code: (close (open "temp.dcl" "w") )
  45. ;;;             Change it to: (close (open "c:\\myfolder\\temp.dcl" "w") )
  46. ;;;             Look for the code: (if (< (setq *Tableid* (load_dialog "temp.dcl")) 0)
  47. ;;;             Change it to: (if (< (setq *Tableid* (load_dialog "c:\\myfolder\\temp.dcl")) 0)
  48. ;;;                           (Where "myfolder" is your designated folder name)
  49. ;;;=================================================================================
  50. (princ "\Table program loading...")
  51. (defun
  52.   C:TABLE (/ CR DLG_CLOSE DLG_HEADER DLG_DIALOG DLG_ITEM DLG_PROTO
  53.            DLG_ATT SYMTOS DCL_TEMP DCL_MATRIX DCL_MATRIX_HED SET_COL
  54.            GET_COL SET_ROW GET_ROW GET_QTY CHECK_NEXT
  55.            SET_NEXT_MATRIX_ITEM TOGG_ASSOC OL OS OC DLG_MAIN
  56.            DELETE_TEMP_DCL DLG_MATRIX DLG_MATRIX_HEAD GET_MATRIX
  57.            GET_MATRIX_HEAD DRAW_TABLE DRAW_TABLE_HEAD *TABLEID* FD
  58.            ROW_NDX COL_NDX COL_QTY COL_NUM COL_INPUT NO_OF_COLS ROW_QTY
  59.            ROW_NUM ROW_INPUT NO_OF_ROWS FLAG NEXT_MATRIX TOG_VALUE INCL
  60.            DCL_ID TITLE DS OSMODE CECOLOR CLAYER SCALE SIZE HALFSIZE
  61.            TITLESIZE SP CNT TOTAL_WIDTH TOTAL_HEIGHT
  62.           )
  63. ;;;;;Main dialog control functions;;;;
  64. (defun CR () (princ "\n" FD))
  65. (defun DLG_CLOSE () (princ "}" FD) (CR))
  66. (defun
  67.     DLG_HEADER (AUDIT)
  68.    (princ "dcl_settings : default_dcl_settings {" FD)
  69.    (CR)
  70.    (princ (strcat " audit_level = " (itoa AUDIT) "; }") FD)
  71.    (CR)
  72. ) ;_ end of defun
  73. (defun DLG_DIALOG (NAME) (princ (strcat NAME " : dialog {") FD) (CR))
  74. (defun DLG_ITEM (ITEM) (princ (strcat ": " ITEM "{") FD) (CR))
  75. (defun DLG_PROTO (type) (princ (strcat type ";") FD) (CR))
  76. (defun
  77.     DLG_ATT (ATT VAL)
  78.    (cond
  79.      ((= (type VAL) 'INT)
  80.       (princ (strcat ATT "=" (itoa VAL) ";") FD)
  81.       (CR)
  82.      )
  83.      ((= (type VAL) 'REAL)
  84.       (princ (strcat ATT "=" (rtos VAL) ";") FD)
  85.       (CR)
  86.      )
  87.      ((= (type VAL) 'STR)
  88.       (princ (strcat ATT "="" VAL "";") FD)
  89.       (CR)
  90.      )
  91.      ((= (type VAL) 'SYM)
  92.       (princ (strcat ATT "=" (SYMTOS VAL) ";") FD)
  93.       (CR)
  94.      )
  95.    ) ;_ end of cond
  96. ) ;_ end of defun
  97. (defun
  98.     SYMTOS (SYM / FD)
  99.    (setq FD (open "symtos.txt" "w"))
  100.    (princ SYM FD)
  101.    (close FD)
  102.    (setq
  103.      FD  (open "symtos.txt" "r")
  104.      SYM (strcase (read-line FD) t)
  105.    ) ;_ end of setq
  106.    (close FD)
  107.    SYM
  108. ) ;_ end of defun
  109. (defun
  110.     DCL_TEMP (/ FD)
  111.    (setq FD (open "temp.dcl" "w"))
  112.    (DLG_HEADER 0)
  113. ;;;Define Main Dialog;;;
  114.    (DLG_DIALOG "dlg_main")
  115.    (DLG_ATT "label" "Table Matrix Selection")
  116.    (DLG_ITEM "text_part")
  117.    (DLG_ATT "label" "Include a Table Title Heading ?")
  118.    (DLG_ATT "alignment" 'CENTERED)
  119.    (DLG_CLOSE)
  120.    (DLG_ITEM "toggle")
  121.    (DLG_ATT "fixed_width" 'TRUE)
  122.    (DLG_ATT "alignment" 'CENTERED)
  123.    (DLG_ATT "key" "togg")
  124.    (DLG_CLOSE)
  125.    (DLG_ITEM "boxed_column")
  126.    (DLG_ATT "label" "Select the Number of Columns")
  127.    (DLG_ITEM "popup_list")
  128.    (DLG_ATT "alignment" 'CENTERED)
  129.    (DLG_ATT "width" 5)
  130.    (DLG_ATT "key" "col_qty")
  131.    (DLG_ATT "fixed_width" 'TRUE)
  132.    (DLG_CLOSE)
  133.    (DLG_CLOSE)
  134.    (DLG_ITEM "boxed_column")
  135.    (DLG_ATT "label" "Select the Number of Rows")
  136.    (DLG_ITEM "popup_list")
  137.    (DLG_ATT "alignment" 'CENTERED)
  138.    (DLG_ATT "width" 5)
  139.    (DLG_ATT "key" "row_qty")
  140.    (DLG_ATT "fixed_width" 'TRUE)
  141.    (DLG_CLOSE)
  142.    (DLG_CLOSE)
  143.    (DLG_ITEM "button")
  144.    (DLG_ATT "key" "get_qty")
  145.    (DLG_ATT "label" "Input Table Information")
  146.    (DLG_ATT "alignment" 'CENTERED)
  147.    (DLG_ATT "fixed_width" 'TRUE)
  148.    (DLG_ATT "height" 3)
  149.    (DLG_CLOSE)
  150.    (DLG_PROTO "spacer_1")
  151.    (DLG_PROTO "cancel_button")
  152.    (DLG_CLOSE)
  153.    (close FD)
  154.    "temp.dcl"
  155. ) ;_ end of defun
  156. (defun
  157.     DCL_MATRIX (/ FD)
  158.    (setq FD (open "temp.dcl" "w"))
  159.    (DLG_HEADER 0)
  160. ;;;define Table matrix dialog;;;
  161.    (DLG_DIALOG "dlg_matrix")
  162.    (DLG_ATT "label" "Table Matrix Input (NO Title Heading)")
  163.    (DLG_ITEM "boxed_column")
  164.    (DLG_ATT "label" "Table Matrix Input (Includes Column Headings)")
  165.    (setq ROW_NDX 1)
  166.    (repeat NO_OF_ROWS
  167.      (DLG_ITEM "row")
  168.      (setq COL_NDX 1)
  169.      (repeat NO_OF_COLS
  170.        (DLG_ITEM "edit_box")
  171.        (DLG_ATT
  172.          "key"
  173.          (strcat "row" (itoa ROW_NDX) "col" (itoa COL_NDX))
  174.        ) ;_ end of dlg_att
  175.        (DLG_ATT "edit_width" 7)
  176.        (DLG_ATT "edit_limit" 20)
  177.        (DLG_CLOSE)
  178.        (setq COL_NDX (1+ COL_NDX))
  179.      ) ;_ end of repeat
  180.      (DLG_CLOSE)
  181.      (setq ROW_NDX (1+ ROW_NDX))
  182.    ) ;_ end of repeat
  183.    (DLG_CLOSE)
  184.    (DLG_ITEM "button")
  185.    (DLG_ATT "fixed_width" 'TRUE)
  186.    (DLG_ATT "height" 3)
  187.    (DLG_ATT "alignment" 'CENTERED)
  188.    (DLG_ATT "key" "do_Table")
  189.    (DLG_ATT "label" "Complete the Table")
  190.    (DLG_CLOSE)
  191.    (DLG_PROTO "cancel_button")
  192.    (DLG_ATT "alignment" 'CENTERED)
  193.    (DLG_CLOSE)
  194.    (close FD)
  195.    "temp.dcl"
  196. ) ;_ end of defun
  197. (defun
  198.     DCL_MATRIX_HEAD (/ FD)
  199.    (setq FD (open "temp.dcl" "w"))
  200.    (DLG_HEADER 0)
  201. ;;;define Table Matrix_head dialog;;;
  202.    (DLG_DIALOG "dlg_matrix_head")
  203.    (DLG_ATT "label" "Table Matrix Input with Title Heading")
  204.    (DLG_ITEM "text_part")
  205.    (DLG_ATT "label" "Table Title Heading")
  206.    (DLG_ATT "alignment" 'CENTERED)
  207.    (DLG_ATT "fixed_width" 'TRUE)
  208.    (DLG_CLOSE)
  209.    (DLG_ITEM "edit_box")
  210.    (DLG_ATT "key" "title")
  211.    (DLG_ATT "edit_width" (* NO_OF_COLS 7))
  212.    (DLG_ATT "edit_limit" (* NO_OF_COLS 20))
  213.    (DLG_ATT "alignment" 'CENTERED)
  214.    (DLG_ATT "fixed_width" 'TRUE)
  215.    (DLG_CLOSE)
  216.    (DLG_ITEM "boxed_column")
  217.    (DLG_ATT "label" "Table Matrix Input (Includes Column Headings)")
  218.    (setq ROW_NDX 1)
  219.    (repeat NO_OF_ROWS
  220.      (DLG_ITEM "row")
  221.      (setq COL_NDX 1)
  222.      (repeat NO_OF_COLS
  223.        (DLG_ITEM "edit_box")
  224.        (DLG_ATT
  225.          "key"
  226.          (strcat "row" (itoa ROW_NDX) "col" (itoa COL_NDX))
回复

使用道具 举报

40

主题

132

帖子

107

银币

后起之秀

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

铜币
227
发表于 2022-7-6 17:54:38 | 显示全部楼层
这是代码,请帮助使用bmp文件:shock:??
桌子拉链
回复

使用道具 举报

40

主题

132

帖子

107

银币

后起之秀

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

铜币
227
发表于 2022-7-6 18:28:51 | 显示全部楼层
  1. Once you get to 2004, shouldn't you just use the built in table command? (I think that's the version it was introduced in).

 
我在网上找到了这句话,我想我应该先把我的帖子重新发一遍
回复

使用道具 举报

发表回复

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

本版积分规则

  • 微信公众平台

  • 扫描访问手机版

  • 点击图片下载手机App

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

GMT+8, 2025-5-28 01:06 , Processed in 1.339495 second(s), 61 queries .

© 2020-2025 乐筑天下

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