加载lsp同时将lsp文件所在路径添加至cad搜索支持目录

;;lyy 支持appload加载、命令行(load "xx")加载和直接拖曳加载

(vl-load-com)
(defun set_path (/ str n1 n2)
(while (/= 0 (getvar "cmdactive")) (command))
(princ "\n")
(setq str (getvar "lastprompt"))
(if (wcmatch (strcase str) "*(LOAD \"*")
    (setq n1 (vl-string-search "(LOAD \"" str)
          n2 (vl-string-search "\")" str)
          str (substr str (+ n1 8) (- n2 n1 7))
    )
    (setq str
      (vl-registry-read "HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\ComDlg32\\OpenSaveMRU\\*"
        (substr (vl-registry-read "HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\ComDlg32\\OpenSaveMRU\\*" "MRUList") 1 1)
      )
    )
)
(setenv "ACAD" (strcat (getenv "ACAD") ";" (vl-filename-directory str)))
)
(set_path)
(setq set_path nil)
 

转载至:http://www.cadzj.com/n/30434.html

此条目发表在CAD技巧分类目录。将固定链接加入收藏夹。

发表评论