可能是这样(完全未经测试):
- (defun UserStartup (/ ProfileLoad #Choice)
- (vl-load-com)
- (defun ProfileLoad (#ProfileName / #Profiles)
- (setq
- #Profiles
- (vla-get-profiles (vla-get-preferences (vlax-get-acad-object)))
- ) ;_ setq
- (or (eq #ProfileName (vla-get-activeprofile #Profiles))
- (not (vl-catch-all-error-p
- (vl-catch-all-apply
- 'vla-put-activeprofile
- (list #Profiles #ProfileName)
- ) ;_ vl-catch-all-apply
- ) ;_ vl-catch-all-error-p
- ) ;_ not
- ) ;_ or
- ) ;_ defun
- (initget 0 "Randolph Boss Dismiss")
- (and (setq #Choice
- (getkword
- "\nUser customization options to load [Randolph/Boss] <Dismiss>: "
- ) ;_ getkword
- ) ;_ setq
- (cond
- ((eq #Choice "Randolph")
- ;; do stuff
- (ProfileLoad "Randolph")
- (and (findfile "Randolph.lsp") (load "Randolph.lsp"))
- )
- ((eq #Choice "Boss")
- ;; do stuff
- (ProfileLoad "Boss")
- )
- ) ;_ cond
- ) ;_ and
- (princ)
- ) ;_ defun
这将在启动时提示您选择一个用户(您或您的老板),或者干脆退出并继续加载。根据用户选择,它将执行特定任务。我还编写了一个加载活动配置文件的小子程序。
我不会给你打电话。lsp文件acad。lsp,因为你不想让它为你的老板自动加载,或者只是把它放在一个不支持的目录中,只需要在例程的加载部分指定完整的位置。 |