漫长的白天,短暂的夜晚,所以只有时间再多讲一个睡前小故事
https://jtbworld.com/autolisp-visual-lisp
- ; This is how you can do a PGP file reinitialization (reload)awing template file used by QNEW
- ;;; (ax:GetQnewPath)
- (defun ax:GetQnewPath (/ prof key)
- (setq prof (vla-get-ActiveProfile (vla-get-profiles (vla-get-preferences (vlax-get-Acad-Object)))))
- (setq key (strcat "HKEY_CURRENT_USER\" (vlax-product-key) "\\Profiles\" prof "\\General"))
- (vl-registry-read key "QnewTemplate")
- )
- ;;; Set the drawing template file used by QNEW
- ;;; This writes it to the registry but is later dismissed and overwritten by AutoCAD
- ;;; (ax:SetQnewPath "M:\\CAD\\ACADISO.DWT")
- (defun ax:SetQnewPath (QnewPath / prof key)
- (setq prof (vla-get-ActiveProfile (vla-get-profiles (vla-get-preferences (vlax-get-Acad-Object)))))
- (setq key (strcat "HKEY_CURRENT_USER\" (vlax-product-key) "\\Profiles\" prof "\\General"))
- (vl-registry-write key "QnewTemplate" QnewPath)
- )
- ;; Gets current template
- (getenv "QnewTemplate")
- "c:\\my files\\templates\\qnew.dwt"
- and
- ;; Sets a different template
- (setenv "QnewTemplate" "")
|