加启动组-删启动组
本帖最后由 尘缘一生 于 2021-9-4 17:16 编辑[*];;是否在启动组中
[*];; 示例(addToStartupSuite "D:\\DT\\DTIImain.lsp")
[*](defun gps->appload-filepath (AppName / $skey i keyvalue numstartup svlst x)
[*](if (member (type appname) '(STR SYM))
[*] (progn
[*] (setq $skey
[*] (strcat "HKEY_CURRENT_USER\\"
[*] (vlax-product-key)
[*] "\\Profiles\\"
[*] (getvar "CPROFILE")
[*] "\\Dialogs\\Appload\\Startup"
[*] )
[*] )
[*] (setq NumStartup (vl-registry-read $skey "NumStartup"))
[*] (if (= (type NumStartup) 'STR)
[*] (progn
[*] (setqNumStartup (atoi NumStartup) i 1)
[*] (repeat NumStartup
[*] (if(setq keyvalue (vl-registry-read $skey (strcat (itoa i) "Startup")))
[*] (setq svlst (append svlst (list keyvalue)) i (1+ i))
[*] (setq i (1+ i))
[*] )
[*] )
[*] (if svlst
[*] (setq svlst (mapcar 'strcase svlst))
[*] )
[*] )
[*] )
[*] (member (strcase appname) svlst)
[*] )
[*])
[*])
[*];;在启动组加入----------------(一级)---------------
[*](defun addToStartupSuite (AppName / $akey $skey loadctrlnum numstartup)
[*](if (null (gps->appload-filepath AppName))
[*] (progn
[*] (setq
[*] $skey (strcat "HKEY_CURRENT_USER\\"
[*] (vlax-product-key)
[*] "\\Profiles\\"
[*] (getvar "CPROFILE")
[*] "\\Dialogs\\Appload\\Startup"
[*] )
[*] $akey (strcat "HKEY_CURRENT_USER\\"
[*] (vlax-product-key)
[*] "\\Applications\\AcadAppload"
[*] )
[*] )
[*] (setq NumStartup (vl-registry-read $skey "NumStartup"))
[*] (if NumStartup
[*] (progn
[*] (vl-registry-write $skey "NumStartup" (itoa (1+ (atoi NumStartup))))
[*] (vl-registry-write
[*] $skey
[*] (strcat (itoa (1+ (atoi NumStartup))) "Startup")
[*] AppName
[*] )
[*] )
[*] (progn
[*] (vl-registry-write $skey "NumStartup" "1")
[*] (vl-registry-write $skey "1Startup" AppName)
[*] )
[*] )
[*] ;;读取LoadCtrls的值,将这个值与2作“或”运算,再写回。这样可以保证AutoCAD启动时会加载Appload.arx模块。
[*] (setq loadctrlnum (vl-registry-read $akey "LOADCTRLS"))
[*] (if loadctrlnum
[*] (vl-registry-write $akey "LOADCTRLS" (Boole 7 loadctrlnum 2))
[*] (vl-registry-write $akey "LOADCTRLS" 15)
[*] )
[*] )
[*])
[*])
[*];;删除启动组-------------------(一级)----------------------
[*];;appname "d:\\abc.vlx" kmsg"abc"
[*](defun delStartupSuite (AppName kmsg / i $skey numstartup)
[*](if (gps->appload-filepath AppName)
[*] (progn
[*] (setq $skey (strcat "HKEY_CURRENT_USER\\" (vlax-product-key) "\\Profiles\\" (getvar "CPROFILE") "\\Dialogs\\Appload\\Startup"))
[*] (setq NumStartup (vl-registry-read $skey "NumStartup") i 0)
[*] (if (> (atoi NumStartup) 0)
[*] (while (< i (atoi NumStartup))
[*] (if (wcmatch (vl-registry-read $skey (strcat (itoa (setq i (1+ i))) "Startup")) (strcat "*" kmsg "*"))
[*] (progn
[*] (vl-registry-delete $skey (strcat (itoa i) "Startup")) ;;删除AppName 启动项
[*] (vl-registry-write $skey "NumStartup" (itoa (1- (atoi NumStartup)))) ;;启动项-1重写
[*] )
[*] )
[*] )
[*] (princ "\n 启动组里无有加载项目....")
[*] )
[*] )
[*])
[*])
本帖最后由 尘缘一生 于 2022-3-27 22:30 编辑
dami 发表于 2021-11-24 20:57
你好,想请教一下“;;appname "d:\\abc.vlx" kmsg"abc"”请问这一句在程序中怎么理解呢?我现在用的是w ...
是个解释,APPNAM就是启动程序的完整路径名吗
KMSG "ABC" 不是介绍的传入变量KMSG是个啥格式的举例
本帖最后由 尘缘一生 于 2021-9-4 17:16 编辑
you_boss 发表于 2021-9-4 14:42
怎么删除不了
删除启动组是我摸索写的,其他程序在晓东论坛得到的。。。我这里很完美,我是WIN7 64位,CAD版本2020。对于WIN10 64位,我没有测试。我把程序附件加上,你下载摸索下吧,那里修改修改。 你好,想请教一下“;;appname "d:\\abc.vlx" kmsg"abc"”请问这一句在程序中怎么理解呢?我现在用的是win10,想实现删去启动组的lsp文件 很有用,谢谢分享 怎么删除不了
谢谢分享,很有用 尘缘一生 发表于 2021-9-4 17:02
删除启动组是我摸索写的,其他程序在晓东论坛得到的。。。我这里很完美,我是WIN7 64位,CAD版本2020。对 ...
嗯,感谢你的回复,我再看看 注意:加载后,立刻关闭cad,再打开才可以! 请问楼主,怎样执行加载和卸载命令呢?
页:
[1]
2