乐筑天下

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

[编程交流] 批绘图Lisp?

[复制链接]

7

主题

29

帖子

22

银币

初来乍到

Rank: 1

铜币
35
发表于 2022-7-6 00:27:30 | 显示全部楼层
我写了一个我在工作中使用的,我真的不确定它是否能帮到你,因为我在代码中使用了很多我们的标准来缩小我想要打印的图形和目录的范围。不过基本上,它会得到一个图形列表,编写一个脚本,运行脚本打开所有图形,然后运行我编写的自动打印lisp,关闭图形并继续下一个。
如果你想要的话,我可以贴出来,但就像我说的,你肯定要修改它。
回复

使用道具 举报

114

主题

1万

帖子

1万

银币

中流砥柱

Rank: 25

铜币
543
发表于 2022-7-6 00:32:01 | 显示全部楼层
 
啊,对了,我明白了,也许一个Mod可以做到
 
但选择正确的线程或合并最好的线程将是一项艰巨的任务。。。
回复

使用道具 举报

12

主题

395

帖子

384

银币

初露锋芒

Rank: 3Rank: 3Rank: 3

铜币
60
发表于 2022-7-6 00:33:11 | 显示全部楼层
 
我认为任何输入都是好的
回复

使用道具 举报

7

主题

29

帖子

22

银币

初来乍到

Rank: 1

铜币
35
发表于 2022-7-6 00:38:29 | 显示全部楼层
 
这是我使用的lisp绘图,脚本调用它。
 
回复

使用道具 举报

114

主题

1万

帖子

1万

银币

中流砥柱

Rank: 25

铜币
543
发表于 2022-7-6 00:41:37 | 显示全部楼层
提示:为什么不使用
  1. <p> tags when posting code, instead of </p> tags - then the code will be indented
回复

使用道具 举报

7

主题

29

帖子

22

银币

初来乍到

Rank: 1

铜币
35
发表于 2022-7-6 00:42:51 | 显示全部楼层
哎呀,
哈哈,很抱歉,我做了一个快速回复,只是使用了
回复

使用道具 举报

114

主题

1万

帖子

1万

银币

中流砥柱

Rank: 25

铜币
543
发表于 2022-7-6 00:48:13 | 显示全部楼层
没问题,只是提醒你一下
回复

使用道具 举报

20

主题

344

帖子

325

银币

初露锋芒

Rank: 3Rank: 3Rank: 3

铜币
100
发表于 2022-7-6 00:48:37 | 显示全部楼层
我已经研究这个问题8个多月了。
 
我用我所有的技巧,还有很多我没有的技巧,把我(现在)的骄傲和快乐,亲切地命名为闪电战。因为它是为我们在工作中使用的绘图设备定制的,所以我决定省去“绒毛”,为优秀的人提供重要的部分。。也就是说,只是闪电战。
 
也就是说,请允许我谦恭地介绍我的批lisp。如果你对它的功能有任何疑问,请告诉我。此外,我知道还有一些松散的结尾,我相信这可以从头开始,并重新工作到更有效的东西。如果你有任何意见或建议,请告诉我。
 
第1部分,共2部分
 
  1. ; Blitz Batch Program
  2. ; Written by Mark Mercier, with a little help from my friends
  3. ; Version history:
  4. ;    08/06/08 v3 Alpha - printlayout, makeitso and dostuff functions operating
  5. ;    08/07/08 v3.1 Alpha - printsettings function operating
  6. ;    08/07/08 v3.14 Beta - makeitso function operating, first Beta version.
  7. ;    09/10/08 v3.141 - Most non-setting-related bugs removed and help option added. Improved layout list functionality.
  8. ;    01/23/09 v3.1415 - Added function for selection of multiple settings
  9. ;    01/30/09 v3.14159 - Added function for complex tab selection
  10. ;    04/03/09 v3.141592 - Added function for plotting all files in a directory
  11. ;    04/10/09 v3.1415926 - Added subdirectory capability
  12. (defun c:bz() (blitz))
  13. (defun blitz()
  14. (princ "\n** Blitz - v3.1415926 **\n")
  15. (printsettings)                    ; Determine print settings
  16. (printlayout)                        ; Determine layouts to plot
  17. (if warpFactor (engage) (makeitso))            ; Use collected variables to plot
  18. (princ)
  19. )
  20. ; - Begin function set for collecting print settings - ;
  21. (defun printsettings()
  22. (setq multSettings nil)
  23. (setq printSetting nil)
  24. (setq printSettingList nil)
  25. (setq dirget "none")
  26. (setq dirPat "*")
  27. (setq dirSub "0")
  28. (setq warpFactor nil)
  29. (setq blitzPrintInputList nil)
  30. (setq copies 1)
  31. (setq printsetWhile 1)
  32. (GetPlotDevices)
  33. (while (= printsetWhile 1)
  34. (setq printsettingCheck nil)
  35. (princ "\n[0 - Setting1]")
  36. (setq printsettingGet (getstring "\nSelect number or [mUltiple/Directory/Files/?]: "))
  37.    (cond
  38.      
  39.      ; Create a condition to test for user input. In the (dostuff) function, create a correlating condition which supplies said function.
  40.      ; If plotting, create a function to check whether plot device exists, thereby allowing the user to remain in program loop upon device failure.
  41.      ; Similarly, functions can be present within the condition to test any other user input aside from selected setting, as to prevent errors later.
  42.      ((= printsettingGet "0") (printcheck))
  43.      
  44.      ((or (= (strcase printsettingGet) "D") (= (strcase printsettingGet) "DIRECTORY")) (directoryGet))
  45.      ((= (strcase printsettingGet) "U") (setq multSettings 1))
  46.      (t
  47.       (princ "\nOption not available, please select another.")
  48.       )
  49.      )
  50.    )
  51. (princ printSettingList)
  52. (setq blitzPrintInputList (append blitzPrintInputList (list (list (itoa copies)))))
  53. (setq blitzPrintInputList (append blitzPrintInputList (list printSettingList)))
  54. )
  55. (defun printcheck()
  56. ; Check to see if the current selection is kosher. If plot device or other settings are unavailable, inform the user and return to main loop.
  57. (if (or (= printsettingCheck nil) (membercase printsettingCheck DEVICELIST))
  58.    (progn
  59.      (if multSettings
  60.    (progn
  61.      (setq printSettingList (append printSettingList (list printSettingGet)))
  62.      (princ "\nPrint setting appended")
  63.      (setq acceptWhile nil)
  64.      (while (not acceptWhile)
  65.        (princ "\nCurrent settings: ")(princ printSettingList)(princ)
  66.        (setq acceptSettings (getstring "\nContinue with selected plot settings? [Yes/No/Remove] <No> "))
  67.        (cond
  68.          ((or (= acceptSettings "Y") (= acceptSettings "y"))
  69.           (setq printsetWhile 2)
  70.           (setq acceptWhile 1)
  71.           )
  72.          ((or (= acceptSettings "") (= acceptSettings "N") (= acceptSettings "n"))
  73.           (setq acceptWhile 1)
  74.           )
  75.          ((or (= acceptSettings "R") (= acceptSettings "r"))
  76.           (removeSetting)
  77.           )
  78.          (t
  79.           (princ "\nOption not available, please try again")
  80.           )
  81.          )
  82.        (if (not printSettingList)
  83.          (progn
  84.        (setq acceptWhile 1)
  85.        (princ "\nAll selections removed.")
  86.        )
  87.          )
  88.        )
  89.      )
  90.    (progn
  91.      (setq printSettingList (list printsettingGet))
  92.      (setq printsetWhile 2)
  93.      (princ "\nPrint setting accepted")
  94.      )
  95.    )
  96.      )
  97.    (progn
  98.      (princ "\nPrint setting not available.")
  99.      )
  100.    )
  101. )
  102. (defun removeSetting()
  103. (setq removeWhile nil)
  104. (while (not removeWhile)
  105.    (setq removeOption (getstring "\nEnter desired setting to remove: "))
  106.    (if (member removeOption printSettingList)
  107.      (progn
  108.    (setq printSettingList (remFromList removeOption printSettingList))
  109.    (setq removeWhile 1)
  110.    (princ "\nSetting removed.")
  111.    )
  112.      (princ "\nSetting not available.")
  113.      )
  114.    )
  115. )
  116. (defun directoryGet()
  117. (setq dirOpsWhile nil)
  118. (while (not dirOpsWhile)
  119.    (princ (strcat "\nCurrent directory: " dirGet " - Current pattern: " dirPat ".dwg - Subdirectory level: " dirSub))
  120.    (setq dirOp (getstring "\nEnter option [Directory/Subdirectories/Pattern/Clear/Files/Exit]: "))
  121.    (cond
  122.      ((= (strcase dirOp) "D")
  123.       (setq pathGetWhile 1)
  124.       (while pathGetWhile
  125.     (setq dirGetGet (getstring "\nEnter directory search path in the form "C:\\Folder 1\\Folder 2" or [back]: "))
  126.     (if (or (vl-directory-files dirGetGet nil 1) (= (strcase dirGetGet) "B"))
  127.       (progn
  128.         (if (not (= (strcase dirGetGet) "B")) (setq dirGet dirGetGet))
  129.         (setq pathGetWhile nil)
  130.         )
  131.       (progn
  132.         (princ "\nDirectory does not exist. Please try again.")
  133.         )
  134.       )
  135.     )
  136.       (if (= dirGet "") (setq dirGet "none"))
  137.       )
  138.      ((= (strcase dirOp) "S")
  139.       (setq dirSubWhile 1)
  140.       (while dirSubWhile
  141.     (setq dirSubGet (getstring "\nEnter level of subdirectories [0-9]: "))
  142.     (setq badSubList (list "0" "1" "2" "3" "4" "5" "6" "7" "8" "9"))
  143.         (if (not (strmemlst badSubList (list dirSubGet)))
  144.       (progn
  145.         (princ "\nSelected characters not allowed. Please try again.")
  146.         )
  147.       (progn
  148.         (setq dirSub dirSubGet)
  149.         (setq dirSubWhile nil)
  150.         )
  151.       )
  152.     )
  153.       (if (= dirSub "") (setq dirSub "0"))
  154.       )
  155.      ((= (strcase dirOp) "P")
  156.       (setq patternGetWhile 1)
  157.       (while patternGetWhile
  158.     (setq patternGet (getstring "\nEnter file search pattern using asterisk (*) as wildcard (do not include .dwg extention) <*>: "))
  159.         (setq badList (list "\" "/" ":" "." "?" """ "<" ">" "|"))
  160.         (if (strmemlst badList (list patternGet))
  161.       (progn
  162.         (princ "\nSelected characters not allowed. Please try again.")
  163.         (setq dirPat "*")
  164.         )
  165.       (progn
  166.         (setq dirPat patternGet)
  167.         (setq patternGetWhile nil)
  168.         )
  169.       )
  170.         (if (= dirPat "") (setq dirPat "*"))
  171.     )
  172.       )
  173.      ((= (strcase dirOp) "C")
  174.       (setq dirPat "*")
  175.       (setq dirget "none")
  176.       (setq dirSub "0")
  177.       (setq warpFactor nil)
  178.       (princ "\nDirectory settings removed. Only the current drawing will be affected.")
  179.       )
  180.      ((= (strcase dirOp) "F")
  181.       (filesShow)
  182.       )
  183.      ((= (strcase dirOp) "E")
  184.       (setq allDirsList (subdir dirGet dirSub))
  185.       (setq allFilesList (getfiles allDirsList dirPat))
  186.       
  187.       (if allFilesList
  188.     (progn
  189.       (princ "\nSettings accepted!")
  190.       (setq warpFactor 1)
  191.       (setq dirOpsWhile 1)
  192.       )
  193.     (progn
  194.       (initget 1 "Y N")
  195.       (setq lastchoice (getkword "\nSelected settings return a nil file list. Try again? [Y/N] <Y>: "))
  196.       (if (= (strcase lastchoice) "N")
  197.         (progn
  198.           (setq dirGet "none")
  199.           (setq dirPat "*")
  200.           (setq dirSub "0")
  201.           (setq warpFactor nil)
  202.           (setq dirOpsWhile 1)
  203.           (princ "\nDirectory settings removed. Only the current drawing will be affected.")
  204.           )
  205.         )
  206.       )
  207.     )
  208.       )
  209.      (t
  210.       )
  211.      )
  212.    );/while
  213. (princ)
  214. )
  215. (defun filesShow()
  216. (setq allDirsListShow (subdir dirGet dirSub))
  217. (setq allFilesListShow (getfiles allDirsListShow dirPat))
  218. (if allFilesListShow (princ allFilesListShow) (princ "\nNo files available with given settings."))
  219. (getstring "\nPress 'Enter' key to continue. ")
  220. )
回复

使用道具 举报

20

主题

344

帖子

325

银币

初露锋芒

Rank: 3Rank: 3Rank: 3

铜币
100
发表于 2022-7-6 00:53:21 | 显示全部楼层
第2部分,共2部分
 
我希望你觉得它有用^
 
[code];-开始收集要打印的布局选项卡的功能-;(defun printlayout();Start(setq printlayWhileStart 1)(setq printlayWhileEnd 1)(setq printTabList nil)(setq printTabListEngage nil)(setq specialList nil)(princ(strcat“\n此图形中有”(rtos(长度(布局列表))2 0)“布局选项卡”)(princ)(while(=printlayWhileStart 1)(setq printlayStart(getstring“\n选择开始布局编号或[This/Current/All]:”)(setq printtablelistengage(append printtablelistengage(list printlayStart))(cond((or(=printlayStart“t”)(=printlayStart“This”)(=printlayStart“This”)(setq printlayWhileStart 2)(setq printlayWhileEnd 2)(setq printlayEnd 0)(setq var1num 0)(foreach var1(layoutlist)(setq var1num(+1 var1num))(if(=var1(getvar“ctab”))(progn(setq printStart(-var1num 1))(setq printEnd(-var1num 1))(if(=(getvar“ctab”)“Model”)(progn(setq printlayWhileStart 1)(princ“Cannot plot Model tab”)))((或(=printlayStart“a”)(=printlayStart“all”)(=printlayStart“a”)(=printlayStart“all”)(setq printlayWhileStart 2)(setq printlayWhileEnd 2)(setq printlayEnd 0)(setq printlayEnd(-length(Get Layout List))1))((或(=printlayStart“c”)(=printlayStart“current”)(=printlayStart“current”)(=printlayStart“c”)(=printlayStart“current”)(setq printlayWhileStart 2)(setq var1num 0)(foreach var1(layoutlist)(setq var1num(+1 var1num))(if(=var1(getvar“ctab”)(progn(setq printStart(-var1num 1)))(if(=(getvar“ctab”)“Model”)(progn(setq printlayWhileStart 1)(princ“不能以Model tab开头”)))(>(atoi printlayStart)(length(layoutlist))(princ“\n开始布局选项卡不得大于总布局选项卡”)((/=(strlen printlayStart)(strlen(rtos(atoi printlayStart)2 0))(princ“\n格式输入”)(/=(atoi printlayStart)0)(setq printStart(-(atoi printlayStart)1))(setq printlayWhileStart 2))(t(princ(strcat printlayStart“不是一个选项。”));End(while(=printlayWhileEnd 1)(setq printlayEnd(getstring“\n选择结束布局编号或[End]:”)(setq printtablelistengage(append printtablelistengage(list printlayStart))(cond((or(=printlayEnd“E”)(=printlayEnd“E”))(setq printlayWhileEnd 2)(setq printEnd(-length(layoutlist))1))(=(atoi printlayEnd)0)(princ“输入/选项卡上不存在错误。”))(>printStart(atoi printlayEnd))(princ“端点在起点之前”)((=(nth(-atoi printlayEnd)1)(layoutlist))nil)(princ“选项卡号不存在”)(printlayEnd(setq printlayWhileEnd 2)(setq printlayEnd(-atoi printlayEnd)1))(t(princ(strcat printlayEnd“不是选项”))))(如果(非特殊列表)(progn(setq listVarA printStart)(而(
回复

使用道具 举报

114

主题

1万

帖子

1万

银币

中流砥柱

Rank: 25

铜币
543
发表于 2022-7-6 00:56:51 | 显示全部楼层
喜欢版本号。。。如果你知道我的意思的话,很好吃。。
回复

使用道具 举报

发表回复

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

本版积分规则

  • 微信公众平台

  • 扫描访问手机版

  • 点击图片下载手机App

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

GMT+8, 2025-3-10 21:04 , Processed in 0.447463 second(s), 70 queries .

© 2020-2025 乐筑天下

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