jamesfear Posted April 19, 2011 Share Posted April 19, 2011 I've been giving myself a headace trying to figure out if there is a way to rename the Tool Palettes File Location with a Lisp or a Macro; from; C:\Documents and Settings\____\Application Data\Autodesk\AutoCAD 2008\R17.1\enu\Support\ToolPalette to; C:\Documents and Settings\____\Application Data\Autodesk\AutoCAD 2008\R17.1\enu\Support\ToolPalette02 I know I can manually change it by simply renaming it (double left click or F2) but I need to do it once a week on twenty computers every week. Quote Link to comment Share on other sites More sharing options...
MSasu Posted April 19, 2011 Share Posted April 19, 2011 (edited) You can use this: (setvar "*_TOOLPALETTEPATH" (strcat "C:\\Documents and Settings\\" UserName "\\Application Data\\Autodesk\\AutoCAD 2008\\R17.1\\enu\\Support\\ToolPalette02")) Just change the UserName with whatever you need. Regards, Mircea Edited April 19, 2011 by MSasu formatted code Quote Link to comment Share on other sites More sharing options...
harrison-matt Posted April 20, 2011 Share Posted April 20, 2011 Jamesfear, This command (invoked by tp02 at the command line) will identify the current OS running, grab the user's login name and construct the path dependent on the os version, to be set to the system variable, *_toolpalettepath. The program then checks to see if the directory exists and if it does then sets the variable, otherwise tells you it doesn't exist. (defun c:tp02 (/) (vl-load-com) (setq windows (strcase (vl-registry-read "HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion" "ProductName" ) ) ) (setq loginname (getvar 'loginname)) (cond ((wcmatch windows "*XP*") (progn (setq path (strcat "C:\\Documents and Settings\\" loginname "\\Application Data\\Autodesk\\AutoCAD 2008\\R17.1\\enu\\Support\\ToolPalette" ) ) ) ) ((or (wcmatch windows "*VISTA*") (wcmatch windows "*7*")) (progn (setq path (strcat "C:\\Users\\" loginname "\\AppData\\Roaming\\Autodesk\\AutoCAD 2008\\R17.1\\enu\\Support\\ToolPalette" ) ) ) ) (T (princ "\nThis version of the Operating System is not compatible with your path selections!"))) (if (vl-file-directory-p path) (setvar '*_toolpalettepath (strcat path "02")) (princ "\nLocation of toolpalette directory does not exist:")) (princ)) Otherwise to shed light on the rest of the files tab: Here is an explanation: (vl-load-com) ;It is good practice to have this in your code when you are using vl, vla, vlr or vlax functions (setq Options_dialog (vla-get-preferences ;the vla function that grabs preferences (options) from (vlax-get-acad-object))) ;the Acad object (your open & active autocad session) (setq files (vla-get-files Options_dialog)) ;this will grab the "files tab" of the prefernces object (vlax-dump-object files T) ;by "dumping" the object you get all of the possible interactions ;you can use "(vla-get-********" much like getvar ;and you can use "vla-put-*******" much like setvar ;if you have no idea what setvar and getvar are you need to learn every system variable that Cad has to offer. hope that helps, hint: when working with visual lisp just dump everything to get the hang of it. Kind Regards, Matt Quote Link to comment Share on other sites More sharing options...
jamesfear Posted April 20, 2011 Author Share Posted April 20, 2011 Thanks for the help guys, really appreciate it Quote Link to comment Share on other sites More sharing options...
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.