cadman6735 Posted September 2, 2010 Posted September 2, 2010 I am going to post this question in two places, one under CAD Management and one under the Lisp forum, since there are only two people watching CAD Managment and 46 watchin Lisp forum. Sorry in advance for the double post. I would like to add a shorcut on the Places List. (the list on the lefthand side when the file seach dialog box is open during open, save or import etc...) In a deployment or lisp routine to automate it. Is this posible to access the Places List to automate a shortcut to a desired path location? Thanks Quote
JohnM Posted September 3, 2010 Posted September 3, 2010 Just so you know where it is In the registry go here: HKEY_CURRENT_USER/Software/autodsek/Acad//ACAD xxx-xxx/Profiles Select a profile then go to Dialogs then go to AllAnavDialogs This is where the places list info is stored. Issues I found where that if a key set is blank then the next one added will not display Also when I deleted a path from the dialog box it was not deleted in the registry The code below needs error trapping and to be adapted to your needs This was done on windows XP Pro in AutoCAD 2004 I’m not sure how newer operating systems registries are laid out I ASSUME NO RESPONSIBILITY FOR ERRORS OR PROBLEMS WITH YOUR REGISTRY USE THIS AT YOU OWN RISK!!!!!!!!! ;;;call pllst using 2 arguments aug1 is the path to the location you want ;;; aug2 is the diaplay name that wiil show in the dialog box ;example: (pllst "C:\Program Files" "Program Files") ;;;NOTE: THIS NEEDS ALOT OF ERROR TRAPPING AND IT WILL WRITE TO THE REGISTRY ;;; THERE ARE STILL THINGS THAT CAN GO WRONG AND ANYTIME YOU PLAY IN THE REGISRTY ;;; YOU SHOULD BE VERY CAREFULL ;;; USE THIS AT YOU OWN RISK!!!!!!!!!!!!!!!!! (defun pllst (aug1 aug2 / prlst regkey nxtnum key1 key2 key3 ret1 ret2 ret3) (setq prlst (getprolst));_call to get profile list (setq regkey (strcat "HKEY_CURRENT_USER\\" (vlax-product-key) "[url="file://profiles//"]\\Profiles\\[/url]" (nth 0 prlst);_THIS NEES TO BE CHANGED TO SUIT YOUR NEEDS AS WRITTEN IT WILL ONLY GET THE 1ST PROFILE "[url="file://dialogs//AllAnavDialogs"]\\Dialogs\\AllAnavDialogs[/url]" ) );_setq gets the path to the reg key ;;;_ this will get the next number to be added to the places list (setq nxtnum (1+ (atoi (vl-string-left-trim "PlacesOrder" (nth 2 (vl-registry-descendents regkey "*" );_reg des list all keys );_nth );_str trim );_atoi );_1+ );_setq (setq key1 (strcat "PlacesOrder" (itoa nxtnum)));_first key name (setq key2 (strcat "PlacesOrder" (itoa nxtnum)"Display"));_second key nake (setq key3 (strcat "PlacesOrder" (itoa nxtnum)"Ext"));_third key name (setq ret1(vl-registry-write regkey key1 aug1));_write key with path (setq ret2(vl-registry-write regkey key2 aug2));_write key with display name (setq ret3(vl-registry-write regkey key3 ));_write exit key wit no value );_defun ;;; GET A LIST OF PROFILES (defun getprolst(/ prolst) (vla-getallprofilenames (vla-get-profiles (vla-get-preferences (vlax-get-acad-object) ) ) 'prolst ) (vlax-safearray->list prolst) );_defun Quote
cadman6735 Posted September 3, 2010 Author Posted September 3, 2010 John thank you for your time and effort. I must say I think this one is over my head and a bit on the risky (scary) side for an amiture such as myself. I will take this and study it but for now I will go to each machine and set the short-cut by hand. I didn't expect to do registry changes. This is defently something I would like to use on future projects. Thanks again Quote
JohnM Posted September 3, 2010 Posted September 3, 2010 Your welcome, When writing to the registry you really have to get a grasp on what is happing there and try to figure out all the ways it could go wrong then write a really tight code to address all the issues, and if you want to be a good programmer you should that that approach with all your codes. Good luck 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.