- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
We've put together a LISP to apply new customisation to existing user CAD profiles. Below is an extract.
The script works great, except for one part...
The goal is to set the new default path for Acaddoc.lsp within the Support paths.
The Script does the job and i've even written the values to the registry for good measure.
; Set ACAD Variables
(vla-put-supportpath
#Files
(strcat ";"
"C:\\_STAU_C\\ACAD\\Setup\\LISP;"
"C:\\_STAU_C\\ACAD\\Setup\\Fonts;"
";"
(vla-get-supportpath #Files)
) ;_ strcat
)
; Set Registry for good measure ?
(vl-registry-read (strcat "HKEY_CURRENT_USER\\" (vlax-product-key) "\\Profiles\\" (getvar 'cprofile) "\\General") "ACAD")
(setq supportpath1 (vl-registry-read (strcat "HKEY_CURRENT_USER\\" (vlax-product-key)
"\\Profiles\\" (getvar 'cprofile) "\\General") "ACAD"))
(cond ((wcmatch supportpath1 "~*C:\\_STAU_C\\ACAD\\Setup\\LISP*")
(vl-registry-write (strcat "HKEY_CURRENT_USER\\" (vlax-product-key) "\\Profiles\\" (getvar 'cprofile) "\\General")
"ACAD" (strcat "C:\\_STAU_C\\ACAD\\Setup\\LISP;" supportpath1)
)))
The issue i'm having is some users will already have a support path with ACADDOC.lsp within their profile. So the approach was to add new paths to the top of the Support path list with vla-put-supportpath.
However, regardless of where the new path is placed in the list (top/bottom/middle), Autocad will not read the new directory unless you manually open the options menu and physically change something and click Apply.
After doing so, all the settings are properly applied.
No amount of restarts fixes this.
How can I force the options to refresh or apply from AutoLSP without manually doing so.
Solved! Go to Solution.