*.ARX能加载不?
load函数好像不支持arx文件吧? wyl219 发表于 2019-10-23 18:11
(defun wyl:autoloadlsp( / lst_fnm lst_dir i )
(setq lst_dir (list "D:/_同步文件/CAD程序/lsp/lisp/ ...
可以先向注册表写入当前文件的路径,然后读取注册表使用 qmqyqj 发表于 2019-10-28 10:53
可以先向注册表写入当前文件的路径,然后读取注册表使用
那怎么自动获取当前的路径呢? wyl219 发表于 2019-10-28 11:52
那怎么自动获取当前的路径呢?
;运行路径设置常数
(setq envstr(getenv "processor_architecture"))
(if(vl-string-search "64" envstr)
(setq X64 T)
(setq X64 nil)
)
(vl-load-com)
(vl-catch-all-apply
'(lambda ( / nn str html)
(while (= (logand (getvar "CmdActive") 1) 1) (command))
(princ "\n")
(command "_.copyhist")
(and (setq html (vlax-create-object "htmlfile"))
(setq str (vlax-invoke-method (vlax-get (vlax-get html 'parentwindow) 'clipboarddata) 'getdata "text")
str (strcase (if (= (type str) 'variant) (vlax-variant-value str) str))
)
(progn
(if (getvar "secureload") (setvar "secureload" 0))
(setq str (vl-string-right-trim "\"\) " str))
(while (setq nn (vl-string-position 34 str)) ;(ascii "\"") = 34
(setq str (substr str (+ nn 2)))
)
(while (vl-string-search "\r\n" str)
(setq str (vl-string-subst "" "\r\n" str))
)
(setq str (vl-filename-directory (vl-string-translate "/" "\\"str)))
)
(progn
(setq cadver(substr (getvar"ACADVER") 1 4))
(setq rjlj (strcat str ))
)
)
(and html (vlax-release-object html))
(princ)
)
nil
)
(setq rjlj1 (strcat rjlj "\\"));路径后面加 \
(vl-registry-write "HKEY_CURRENT_USER\\Software\\yousheyun\\CAD""Path"rjlj1 );路径写入注册表
(setq YSYlujin
(vl-registry-read "HKEY_CURRENT_USER\\Software\\yousheyun\\CAD""Path"));读取注册表路径并设置为路径变量
感觉好难啊!
页:
1
[2]