muck Posted October 26, 2010 Posted October 26, 2010 Using AutoCAD 2010. Is it possable to change the default directory for AutoCAD open command using Lisp or VBA? Thank you, Quote
jammie Posted October 29, 2010 Posted October 29, 2010 Hi For AutoCAD 2007 the initial directory is stored in the registry I am not sure if it still applies for 2010 but To read the open dialog directory (defun getDialog_OpenSavePath () (vl-registry-read (strcat "HKEY_CURRENT_USER\\" (vlax-product-key) "\\Profiles\\" (getvar 'cprofile) "\\Dialogs\\OpenSaveAnavDialogs\\" ) "InitialDirectory" ) ) To write to it (defun setDialog_OpenSavePat (<file> / reg-key dialogPath ) (if (vl-file-directory-p (setq dialogPath (vl-filename-directory <file>))) (progn (setq reg-key (strcat "HKEY_CURRENT_USER\\" (vlax-product-key) "\\Profiles\\" (getvar 'cprofile) "\\Dialogs\\OpenSaveAnavDialogs\\")) (vl-registry-write reg-key "InitialDirectory" dialogPath)) ) ) (getDialog_OpenSavePath) (setDialog_OpenSavePat (getvar 'dwgprefix)) Just be careful when reading/writing to registry as it is possible to corrupt parts of your computer Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.