ReinierMeyer Posted November 9, 2009 Share Posted November 9, 2009 Does anybody know what the command is to set the Auto save file location using a lisp routine like the following sets the Template path, (vla-put-TemplateDwgPath *files* "\\\\Server\\Data\\Cad_Programs\\Autocad\\Drawing Templates") I need to set the Autosave file location. Please Help!!!! Quote Link to comment Share on other sites More sharing options...
MarcoW Posted November 9, 2009 Share Posted November 9, 2009 Do you happen to be dutch? ; MarcoW 09-11-2009 ; ; first create the function ; and localise the variables used (defun c:asf ( / asfloc oldloc) ; then set some variables that will be used (setq asfloc (getstring T "\nPlease enter the automatic Save File Location as desired: ") oldloc (getvar "savefilepath") ); end of setq ; put the new path into the systemvariable (setvar "savefilepath" asfloc) ; show the old location once more, you might want to write down its location for you never know if you want it back (alert (strcat "The old path was: " oldloc)) ; clean exit (princ) ; end of defun ) Just wrote it but I guess it works. Someone might help you along getting the right folder by selecting it in a dialog box. Quote Link to comment Share on other sites More sharing options...
ReinierMeyer Posted November 9, 2009 Author Share Posted November 9, 2009 Thanks . Nope not Dutch, Afrikaans from South Africa simlilar to Dutch. Quote Link to comment Share on other sites More sharing options...
Tekenmeester Posted November 9, 2009 Share Posted November 9, 2009 Is this not what you are looking for? It is in options under the files tab. Quote Link to comment Share on other sites More sharing options...
alanjt Posted November 10, 2009 Share Posted November 10, 2009 I wrote this a while back to run on new machines for complete setup. Obviously, you will have to make changes to the specifics, but it will have what you are looking for. (defun c:CES-Setup (/ #Files #Layout #Flag) (vl-load-com) (and (not (vl-catch-all-error-p (vl-catch-all-apply '(lambda () (setq #Files (vla-get-files (vla-get-preferences (vlax-get-acad-object)) ) ;_ vla-get-files #Layout (vla-get-activelayout (vla-get-activedocument (vlax-get-acad-object)) ) ;_ vla-get-activelayout ) ;_ setq ;; ********************* ;; ** AutoSave Path ** ;; ********************* (mapcar 'vl-mkdir (list "c:\\TEMP" "c:\\TEMP\\ACAD")) (vla-put-autosavepath #Files "c:\\TEMP\\ACAD") ;; *************************** ;; ** Printer Config Path ** ;; *************************** (vla-put-PrinterConfigPath #Files "s:\\cadd standards\\Plotters" ) ;_ vla-put-PrinterConfigPath (vla-refreshplotdeviceinfo #Layout) ;; *********************** ;; ** Plotstyles Path ** ;; *********************** (vla-put-printerstylesheetpath #Files "s:\\cadd standards\\Plotstyles" ) ;_ vla-put-printerstylesheetpath (vla-refreshplotdeviceinfo #Layout) ;; ********************* ;; ** Template Path ** ;; ********************* (vla-put-TemplateDwgPath #Files "s:\\cadd standards\\Template" ) ;_ vla-put-TemplateDwgPath ;; ********************* ;; ** QNew Template ** ;; ********************* (vla-put-QNewTemplateFile #Files "s:\\cadd standards\\Template\\CES_Template.dwt" ) ;_ vla-put-QNewTemplateFile ;; ********************* ;; ** Support Paths ** ;; ********************* (vla-put-supportpath #Files (strcat ";s:\\cadd standards\\startup" ";s:\\cadd standards\\lisp" ";s:\\cadd standards\\linetypes" ";s:\\cadd standards\\fonts" ";s:\\cadd standards\\ces layers" ";" (vla-get-supportpath #Files) ) ;_ strcat ) ;_ vla-put-supportpath ;; *************************** ;; ** Tool Palettes Paths ** ;; *************************** (vla-put-ToolPalettePath #Files (strcat "S:\\CADD Standards\\Toolpalette\\Palettes;" (vla-get-ToolPalettePath #Files) ) ;_ strcat ) ;_ vla-put-ToolPalettePath ) ;_ lambda ) ;_ vl-catch-all-apply ) ;_ vl-catch-all-error-p ) ;_ not (alert (strcat "AutoCAD has been setup for Capital Engineering & Surveying, Inc. Standards.\n\n" " Please restart AutoCAD." ) ;_ strcat ) ;_ alert ) ;_ and (princ) ) ;_ defun (alert "Type: \"CES-SETUP\" to run setup.") (princ) Quote Link to comment Share on other sites More sharing options...
MonkeyTurnip Posted January 8, 2014 Share Posted January 8, 2014 I wrote this a while back to run on new machines for complete setup.Obviously, you will have to make changes to the specifics, but it will have what you are looking for. (defun c:CES-Setup (/ #Files #Layout #Flag) (vl-load-com) (and (not (vl-catch-all-error-p (vl-catch-all-apply '(lambda () (setq #Files (vla-get-files (vla-get-preferences (vlax-get-acad-object)) ) ;_ vla-get-files #Layout (vla-get-activelayout (vla-get-activedocument (vlax-get-acad-object)) ) ;_ vla-get-activelayout ) ;_ setq ;; ********************* ;; ** AutoSave Path ** ;; ********************* (mapcar 'vl-mkdir (list "c:\\TEMP" "c:\\TEMP\\ACAD")) (vla-put-autosavepath #Files "c:\\TEMP\\ACAD") ;; *************************** ;; ** Printer Config Path ** ;; *************************** (vla-put-PrinterConfigPath #Files "s:\\cadd standards\\Plotters" ) ;_ vla-put-PrinterConfigPath (vla-refreshplotdeviceinfo #Layout) ;; *********************** ;; ** Plotstyles Path ** ;; *********************** (vla-put-printerstylesheetpath #Files "s:\\cadd standards\\Plotstyles" ) ;_ vla-put-printerstylesheetpath (vla-refreshplotdeviceinfo #Layout) ;; ********************* ;; ** Template Path ** ;; ********************* (vla-put-TemplateDwgPath #Files "s:\\cadd standards\\Template" ) ;_ vla-put-TemplateDwgPath ;; ********************* ;; ** QNew Template ** ;; ********************* (vla-put-QNewTemplateFile #Files "s:\\cadd standards\\Template\\CES_Template.dwt" ) ;_ vla-put-QNewTemplateFile ;; ********************* ;; ** Support Paths ** ;; ********************* (vla-put-supportpath #Files (strcat ";s:\\cadd standards\\startup" ";s:\\cadd standards\\lisp" ";s:\\cadd standards\\linetypes" ";s:\\cadd standards\\fonts" ";s:\\cadd standards\\ces layers" ";" (vla-get-supportpath #Files) ) ;_ strcat ) ;_ vla-put-supportpath ;; *************************** ;; ** Tool Palettes Paths ** ;; *************************** (vla-put-ToolPalettePath #Files (strcat "S:\\CADD Standards\\Toolpalette\\Palettes;" (vla-get-ToolPalettePath #Files) ) ;_ strcat ) ;_ vla-put-ToolPalettePath ) ;_ lambda ) ;_ vl-catch-all-apply ) ;_ vl-catch-all-error-p ) ;_ not (alert (strcat "AutoCAD has been setup for Capital Engineering & Surveying, Inc. Standards.\n\n" " Please restart AutoCAD." ) ;_ strcat ) ;_ alert ) ;_ and (princ) ) ;_ defun (alert "Type: \"CES-SETUP\" to run setup.") (princ) bit of a thread bump, I have tried the code I have quoted and it does nothing... i'm using AutoCAD2013 full, I have copied the full code into an open lisp box, saved it as CES-SETUP loaded it like I have many other LISP's and a warning box appears saying "type CES-SETUP to run" I do that and nothing, the command line shows no error, but just moves on like something happened. and just says command: in options, nothing has changed. I have also amended all the paths to suit my setup and still nothing... what am I doing wrong? Quote Link to comment Share on other sites More sharing options...
ReMark Posted January 8, 2014 Share Posted January 8, 2014 Did you make any changes to the code as recommend by alanjt? Quote Link to comment Share on other sites More sharing options...
MonkeyTurnip Posted January 8, 2014 Share Posted January 8, 2014 Did you make any changes to the code as recommend by alanjt? yes, here is my modified code. I also tried he code exactly, to see what would happen, and nothing happened with both codes (defun c:setup (/ #Files #Layout #Flag) (vl-load-com) (and (not (vl-catch-all-error-p (vl-catch-all-apply '(lambda () (setq #Files (vla-get-files (vla-get-preferences (vlax-get-acad-object)) ) ;_ vla-get-files #Layout (vla-get-activelayout (vla-get-activedocument (vlax-get-acad-object)) ) ;_ vla-get-activelayout ) ;_ setq ;; ********************* ;; ** AutoSave Path ** ;; ********************* (mapcar 'vl-mkdir (list "c:\\TEMP" "c:\\TEMP\\ACAD")) (vla-put-autosavepath #Files "c:\\TEMP\\ACAD") ;; *************************** ;; ** Printer Config Path ** ;; *************************** (vla-put-PrinterConfigPath #Files "c:\\AutoCAD Setup\\Plotter files" ) ;_ vla-put-PrinterConfigPath (vla-refreshplotdeviceinfo #Layout) ;; *********************** ;; ** Plotstyles Path ** ;; *********************** (vla-put-printerstylesheetpath #Filesls "c:\\AutoCAD Setup\\Plot Styles" ) ;_ vla-put-printerstylesheetpath (vla-refreshplotdeviceinfo #Layout) ;; ********************* ;; ** Template Path ** ;; ********************* (vla-put-TemplateDwgPath #Files "c:\\AutoCAD Setup\\Template" ) ;_ vla-put-TemplateDwgPath ;; ********************* ;; ** QNew Template ** ;; ********************* (vla-put-QNewTemplateFile #Files "=c:\\AutoCAD Setup\\Template\\PROJECT TEMPLATE.dwt" ) ;_ vla-put-QNewTemplateFile ;; ********************* ;; ** Support Paths ** ;; ********************* (vla-put-supportpath #Files (strcat ";c:\\AutoCAD Setup\\Startup" ";c:\\AutoCAD Setup\\lisp" ";c:\\AutoCAD Setup\\Line Types" ";c:\\AutoCAD Setup\\Fonts" ";c:\\AutoCAD Setup\\Layers" ";c:\\AutoCAD Setup\\Hatch Patterns" ";" (vla-get-supportpath #Files) ) ;_ strcat ) ;_ vla-put-supportpath ;; *************************** ;; ** Tool Palettes Paths ** ;; *************************** (vla-put-ToolPalettePath #Files (strcat "c:\\AutoCAD Setup\\CAD_Blocks\\;" (vla-get-ToolPalettePath #Files) ) ;_ strcat ) ;_ vla-put-ToolPalettePath ) ;_ lambda ) ;_ vl-catch-all-apply ) ;_ vl-catch-all-error-p ) ;_ not (alert (strcat "AutoCAD has been setup Standards.\n\n" " Please restart AutoCAD." ) ;_ strcat ) ;_ alert ) ;_ and (princ) ) ;defun (alert "Type: \"SETUP\" to run setup.") (princ) Quote Link to comment Share on other sites More sharing options...
ReMark Posted January 8, 2014 Share Posted January 8, 2014 You're interested in the entire code not just the portion that specifies the AutoSave file location? Quote Link to comment Share on other sites More sharing options...
MonkeyTurnip Posted January 8, 2014 Share Posted January 8, 2014 You're interested in the entire code not just the portion that specifies the AutoSave file location? Yes the full code, i want it as a first setup for new machines, so i can just run the LISP Quote Link to comment Share on other sites More sharing options...
alanjt Posted January 8, 2014 Share Posted January 8, 2014 Man, this is an old thread. I'm sure this is a stupid question, but the paths being specified valid paths? If you are not receiving the final popup window, then an error is being thrown. I would step through the code in vlide and see where it errors. That should give you a better idea of what/where to make your correction(s). Quote Link to comment Share on other sites More sharing options...
MonkeyTurnip Posted January 8, 2014 Share Posted January 8, 2014 All paths are correct, i'll check tomorrow and do a step through Quote Link to comment Share on other sites More sharing options...
alanjt Posted January 8, 2014 Share Posted January 8, 2014 All paths are correct, i'll check tomorrow and do a step through Keep us posted. I'm happy to assist where I can. Quote Link to comment Share on other sites More sharing options...
MonkeyTurnip Posted January 8, 2014 Share Posted January 8, 2014 Keep us posted. I'm happy to assist where I can. cool, thanks:D Quote Link to comment Share on other sites More sharing options...
MonkeyTurnip Posted January 9, 2014 Share Posted January 9, 2014 Right, went over the code with a fine tooth comb, and found 2 spelling mistakes, one of the #files was #filesls and templates folder was not plural. a couple of more folder tweaks and its sorted. but it works!! one think though, how do I delete a standard folder path, as I want to remove from the support path, path I no longer need, like Fonts etc. its no biggie Quote Link to comment Share on other sites More sharing options...
MonkeyTurnip Posted January 9, 2014 Share Posted January 9, 2014 it now works, trying to work out how to delete paths still, but I have added in a "hide system printers" variable, so it only shows the printers in plotter files folder. ;; *************************** ;; ** Printer Config Path ** ;; *************************** (vla-put-PrinterConfigPath #Files "c:\\AutoCAD Setup\\Plotter files" ) ;_ vla-put-PrinterConfigPath ;;************************ ;;**Hide System Printers** ;;************************ (setenv "HideSystemPrinters" "1") (vla-refreshplotdeviceinfo #Layout) Quote Link to comment Share on other sites More sharing options...
Spaj Posted January 9, 2014 Share Posted January 9, 2014 Hi it now works, trying to work out how to delete paths still, but I have added in a "hide system printers" variable, so it only shows the printers in plotter files folder. Head over to Lee Mac's excellent website to the page http://www.lee-mac.com/addremovesupportpaths.html for some pointers/code... Quote Link to comment Share on other sites More sharing options...
Spaj Posted January 9, 2014 Share Posted January 9, 2014 Nope not Dutch, Afrikaans from South Africa simlilar to Dutch. Waar in ZA?, land of the e-Toll? I'm in Durb's 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.