标签:director 注册表 gis bst turn 文本 \n lease 系统
;;;name: BF-Catalog ;;;desc: 设置基础目录 ;;;arg: #xdlj:字符串 ;;;return: 成功:工具箱基础目录, 失败:输出警告提示 ;;;example: (BF-Catalog "04.工作小工具\\Notepad2.exe") ;;;example: (BF-Catalog "") -> "D:\\K01.惊惊盒子\\" (if (not BF-Catalog) (progn ;拖拉添加信任目录 (vl-catch-all-apply ;捕获错误 ‘(lambda (/ str nn str1 html) (while (= (logand (getvar "CmdActive") 1) 1)(command));结束已有命令 (princ "\n") ;字符串处理,得到完整路径: ;ACAD最后一句内容:"命令: (LOAD \"D:/桌面/新建文本文档.lsp\")" ;GCAD无法获取最后一句内容 (if (getvar "GCADVER");是浩辰 (progn ;是执行 (command "_.copyhist") (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)) ) (setq str (vl-string-right-trim " " str)) (while (vl-string-search "\r\n" str) (setq str (vl-string-subst "" "\r\n" str)) ) (while (setq nn (vl-string-search "(LOAD \"" str)) (setq str (substr str (+ nn 8))) ) (and (setq nn (vl-string-search "\")" str)) (setq str (substr str 1 (1+ nn))) ;file name ) (setq str (vl-filename-directory (vl-string-translate "/" "\\" str))) (and html (vlax-release-object html)) ) (progn ;acad也可以用_.copyhist的方法的,这里只是展示lastprompt的用法,但是浩辰无法用lastprompt (setq str1 (getvar "lastprompt") ;获得最后一行命令 nn (vl-string-search "(LOAD \"" str1);在字符串中搜索指定子串 ) (if nn (progn (setq str (substr str1 (+ nn 8)) ;去掉前面的 nn (vl-string-search "\")" str) ;在字符串中搜索指定子串 str (substr str 1 (1+ nn)) ;去掉文件名称 str (vl-filename-directory (vl-string-translate "/" "\\" str));转化 ) ) ) ) ) (if str (progn ;添加信任目录 (@add-Catalog str (list "" "02.小插件" "06.填充" "Fonts")) ;定义惊惊盒子基础目录 (eval (list ‘defun ‘BF-Catalog ‘(#xdlj)(list ‘strcat (strcat str "\\")‘#xdlj))) ) ) ) ) ) )
(if (getvar "GCADVER");浩辰 (progn (setq tmp_ver (substr (getvar "ACADVER") 1 4) tmp_str (cond ((= tmp_ver "19.0") "JJBoxGstarCad_2019.dll") (T nil) ) ) ) (progn ;acad加载 (setq tmp_ver (substr (getvar "ACADVER") 1 4) tmp_str (cond ((= tmp_ver "16.2") "JJBoxDeskCad_2006.dll") ((= tmp_ver "17.0") "JJBoxDeskCad_2007.dll") ((= tmp_ver "17.1") "JJBoxDeskCad_2008.dll") ((= tmp_ver "17.2") "JJBoxDeskCad_2009.dll") ((= tmp_ver "18.0") "JJBoxDeskCad_2010.dll") ((= tmp_ver "18.1") "JJBoxDeskCad_2011.dll") ((= tmp_ver "18.2") "JJBoxDeskCad_2012.dll") ((= tmp_ver "19.0") "JJBoxDeskCad_2013.dll") ((= tmp_ver "19.1") "JJBoxDeskCad_2014.dll") ((= tmp_ver "20.0") "JJBoxDeskCad_2015.dll") ((= tmp_ver "20.1") "JJBoxDeskCad_2016.dll") ((= tmp_ver "21.0") "JJBoxDeskCad_2017.dll") ((= tmp_ver "22.0") "JJBoxDeskCad_2018.dll") ((= tmp_ver "23.0") "JJBoxDeskCad_2019.dll") (T nil) ) ) ) )
var copys = Registry.CurrentUser.OpenSubKey(@"Software\\Gstarsoft\\GstarCAD\\R19\\zh-CN\\"); var b = copys.GetValueNames(); foreach (var item in b) { string sz = copys.GetValue(item).ToString(); sz = sz.Remove(sz.IndexOf(‘\0‘)); Console.WriteLine(sz); }
标签:director 注册表 gis bst turn 文本 \n lease 系统
原文地址:https://www.cnblogs.com/JJBox/p/10209549.html