乐筑天下

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

[编程交流] 添加支持文件路径lisp

[复制链接]

107

主题

615

帖子

575

银币

中流砥柱

Rank: 25

铜币
521
发表于 2022-7-6 00:03:17 | 显示全部楼层
我想我修好了
 
  1. (defun c:setpaths()
  2. (vl-load-com)
  3. ; This sets a reference to the install path of your product
  4. (setq acadloc
  5.   (vl-registry-read
  6.      (strcat "HKEY_LOCAL_MACHINE\" (vlax-product-key))
  7.   "ACADLOCATION")
  8. ); This sets a reference to the files portion of the acad preferences
  9. (setq *files* (vla-get-files
  10.   (vla-get-preferences (vlax-get-acad-object))
  11. ))
  12. ; This builds the string of support file search paths
  13. (setq sfsp
  14.       (strcat
  15. (getvar "ROAMABLEROOTPREFIX") "SUPPORT;"
  16. acadloc "\\SUPPORT;"
  17. acadloc "\\HELP;"
  18. acadloc "\\EXPRESS;"
  19. acadloc "\\SUPPORT\\COLOR;"
  20. (getvar "LOCALROOTPREFIX") "SUPPORT;"
  21. "C:\\topocad;"
  22. "C:\\topocad\\lines;"
  23. "C:\\topocad\\trees;"
  24. "C:\\topocad\\symbols;"
  25. "C:\\topocad\\topohatch;"
  26.       )
  27. )
  28. ; This actually applies the above string to the current session of AutoCAD.
  29. (vla-put-SupportPath *files* sfsp)
  30. ; Here are some examples of setting other things
  31. ; Set the template directory
  32. ;(vla-put-TemplateDwgPath *files* "\\\\SERVER\\CAD\\TEMPLATE")
  33. ; Set the default template (QNEW) name
  34. (vla-put-QNewTemplateFile *files* "c:\\topocad\\topocad.dwt")
  35. ; Set the printer (PC3) support file path
  36. ;(vla-put-PrinterConfigPath *files* "\\\\SERVER\\CAD\\PLOTTERS")
  37. ; Release the object
  38. (vlax-release-object *files*)
  39.    (princ)
  40. )

 
有没有关于代码的建议
 
谢谢
回复

使用道具 举报

106

主题

1万

帖子

101

银币

顶梁支柱

Rank: 50Rank: 50

铜币
1299
发表于 2022-7-6 00:08:23 | 显示全部楼层
下面是一组配置文件选项中的许多内容,包括打印机等。请根据您的请求在代码中查找vla get SupportPath。
 
  1. ; resets the paths usefull for update versions of Autocad
  2. ; by Alan H 2011
  3. ; This sets a reference to the install path of your product
  4. ; the gets are their for info maybe other use
  5. ; use this to find other settings
  6. ;(vlax-dump-object (vla-get-files (vla-get-preferences (vlax-get-Acad-object))) T)
  7. (vl-load-com)
  8. ; make temp directory
  9. ;(vl-mkdir "c:\\AcadTEMP")
  10. (setq *files*  (vla-get-files  (vla-get-preferences (vlax-get-Acad-object))))
  11. ; savepath
  12. ;(vla-get-AutoSavepath *files*)
  13. (vla-put-AutoSavepath *files* "C:\\AcadTemp")
  14. ; custom icons
  15. ;(vla-get-CustomIconPath *files*))
  16. (vla-put-CustomIconPath *files* "P:\\Autodesk\\ICONS")
  17. ; custom menu
  18. ;(vla-get-Menufile *files*))
  19. ;(vla-put-Menufile  *files* "C:\\Users\\2013BIGAL")
  20. ; printers config
  21. ;(vla-get-PrinterConfigPath *files*)
  22. (vla-put-PrinterConfigPath *files* "P:\\AutoDESK\\Plotting\\Plot Styles 2011")
  23. ; printers style sheet
  24. ;(vla-get-PrinterStyleSheetPath *files*)
  25. (vla-put-PrinterStyleSheetPath *files* "P:\\AutoDESK\\Plotting\\Plot Styles")
  26. ; printer drv's
  27. ;(vla-get-PrinterDescPath *files*)
  28. (vla-put-PrinterDescPath *files* "P:\\AutoDESK\\Plotting\\Drv")
  29. ; print spooler
  30. ;(vla-get-PrintSpoolerPath *files*)
  31. (vla-put-PrintSpoolerPath *files* "C:\\AcadTemp\")
  32. ; template  path
  33. ;(vla-get-TemplateDwgPath *files*)
  34. (vla-put-TemplateDwgPath *files* "P:\\Autodesk\\c3d Templates")
  35. ; template location
  36. ;(vla-get-QnewTemplateFile *files*)
  37. (vla-put-QnewTemplateFile *files* "P:\\Autodesk\\c3d Templates\\BIGAL.dwt")
  38. ;make new support paths exist + new
  39. (setq paths (vla-get-SupportPath *files*))
  40. (setq BIGALpaths
  41. "P:\\autodesk\\supportfiles;
  42. P:\\autodesk\\lisp;
  43. P:\\autodesk\\fonts;
  44. P:\\autodesk\\hfs fonts;"
  45. )
  46. (setq newpath (strcat BIGALpaths paths))
  47. (vla-put-SupportPath *files* newpath)
  48. ; Tempdirectory
  49. ;(vla-get-TempFilePath *files*))
  50. (vla-put-TempFilePath *files* "C:\\AcadTemp\")
  51. ;   PlotLogFilePath = "C:\\Documents and Settings\\ah02490.BIGAL-AD\\local
  52. settings\\application data\\autodesk\\c3d 2011\\enu\"
  53. (vla-put-PlotLogFilePath *files* "C:\\AcadTemp\")
  54. ;   LogFilePath = "C:\\Documents and Settings\\ah02490.BIGAL-AD\\local
  55. settings\\application data\\autodesk\\c3d 2011\\enu\"
  56. (vla-put-LogFilePath *files* "C:\\AcadTemp\")
  57. ; xref temp path
  58. ;(vla-get-TempXrefPath *files*))
  59. (vla-put-TempXrefPath *files* "C:\\AcadTemp\")
  60. ; end use of *files*
  61. (vlax-release-object *files*)
  62. ; exit quitely
  63. (princ "All Done")
回复

使用道具 举报

40

主题

177

帖子

100

银币

后起之秀

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

铜币
248
发表于 2022-7-6 00:13:28 | 显示全部楼层
[code](defun gxl StrParse(Str Delimiter/SearchStr StringLen return n char nn)(setq SearchStr Str)(setq StringLen(strlen SearchStr)nn StringLen)(setq return'())(while(>StringLen 0)(setq n 1)(setq char(substr SearchStr 1 1))(while(and(/=char Delimiter)(
回复

使用道具 举报

发表回复

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

本版积分规则

  • 微信公众平台

  • 扫描访问手机版

  • 点击图片下载手机App

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

GMT+8, 2025-3-11 03:13 , Processed in 0.552763 second(s), 56 queries .

© 2020-2025 乐筑天下

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