BIGAL Posted December 7, 2023 Share Posted December 7, 2023 (edited) When you run cad it creates a lot of temporary files, these being saved in a directory that you can reset. The type of files are SV$ BAK DWL DCL and so on. You may be horrified how much stuff is in there. You will find the files by Options, Files, Temporary prefix (Bricscad) similar Acad. When running dcl's if you crash program a lot of ~00123.dcl will be created. So this will identify how many files you have, dont tick the boxes on, go have a look at the location. Move/copy anything you think you need else tick the file type box and they will be removed. ; clean up temp directory.. (defun cleanuptemp ( / files1 files2 files3 files4 files5 files6 files7 lst7 x val ans) (setq *files* (vla-get-files (vla-get-preferences (vlax-get-Acad-object)))) (setq pre (vla-get-TempFilePath *files*)) (alert (strcat "Your temp directory is " pre)) (setq lst7 '()) (setq files1 (vl-directory-files pre "*.BAK")) (if (= files1 nil) (setq lst7 (cons "0 BAK's " lst7)) (setq lst7 (cons (strcat (rtos (length files1) 2 0) " BAK's ") lst7)) ) (setq files2 (vl-directory-files pre "*.sv$")) (if (= files2 nil) (setq lst7 (cons "0 SV$'s " lst7)) (setq lst7 (cons (strcat (rtos (length files2) 2 0) " SV$'s " ) lst7)) ) (setq files3 (vl-directory-files pre "*.dwl*")) (if (= files3 nil) (setq lst7 (cons "0 DWL's " lst7)) (setq lst7 (cons (strcat (rtos (length files3) 2 0) " DWL's ") lst7)) ) (setq files4 (vl-directory-files pre "*.AC$")) (if (= files4 nil) (setq lst7 (cons "0 ac$'s " lst7)) (setq lst7 (cons (strcat (rtos (length files4) 2 0) " AC$'s " ) lst7)) ) (setq files5 (vl-directory-files pre "*.log")) (if (= files5 nil) (setq lst7 (cons "0 Logfile's" lst7)) (setq lst7 (cons (strcat (rtos (length files5) 2 0) " Logfile's ") lst7)) ) (setq files6 (vl-directory-files pre "~*.dcl")) (if (= files6 nil) (setq lst7 (cons "0 Temp DCL's " lst7)) (setq lst7 (cons (strcat (rtos (length files6) 2 0)" Temp DCL's " ) lst7)) ) (setq files7 (vl-directory-files pre "*.dmp")) (if (= files7 nil) (setq lst7 (cons "0 DMP's " lst7)) (setq lst7 (cons (strcat (rtos (length files7) 2 0)" DMP's " ) lst7)) ) (setq lst7 (reverse lst7)) (if (not AH:Toggs)(load "Multiple toggles.lsp")) (setq lst7 (cons "Pick to delete " lst7)) (setq ans (reverse (ah:toggs lst7))) (setq x 1) (foreach val ans (if (= val "1") (progn (foreach filename (eval (read (strcat "files" (rtos x 2 0)))) (vl-file-delete (strcat pre filename)) (princ (strcat "\n" filename)) ) ) ) (setq x (1+ x)) ) (princ) ) (cleanuptemp) Multi toggles.lsp Edited December 7, 2023 by BIGAL added image 2 1 Quote Link to comment Share on other sites More sharing options...
Steven P Posted December 7, 2023 Share Posted December 7, 2023 (edited) Slight typo maybe? In files 4: (setq lst7 (cons (strcat str (rtos (length files4) 2 0) " AC$'s " ) lst7)) should be (setq lst7 (cons (strcat (rtos (length files4) 2 0) " AC$'s " ) lst7)) without the 'str' .. my PC was cleaned out 10 days ago and I only have 50 temp files created since then Edited December 7, 2023 by Steven P Quote Link to comment Share on other sites More sharing options...
SLW210 Posted December 7, 2023 Share Posted December 7, 2023 Nice and easy. I only had 3 files, I keep mine cleaned out. 1 Quote Link to comment Share on other sites More sharing options...
Steven P Posted December 7, 2023 Share Posted December 7, 2023 Yes, I've added this to my Utilities LISPs, handy to have. Quote Link to comment Share on other sites More sharing options...
ronjonp Posted December 7, 2023 Share Posted December 7, 2023 @Steven P FWIW deleting AC$ from the temp folder may have a negative effect on XREF demand loading if working remotely ( like through a VPN ). Having the local copy greatly effects how fast XREF's are loaded. Some variables to reference XLOADPATH, DEMANDLOAD, XLOADCTL 1 Quote Link to comment Share on other sites More sharing options...
BIGAL Posted December 7, 2023 Author Share Posted December 7, 2023 Typo fixed thanks Steven P. 1 Quote Link to comment Share on other sites More sharing options...
asos2000 Posted December 11, 2023 Share Posted December 11, 2023 Thanks for good utility. I believe it will be better with these options. Quote Link to comment Share on other sites More sharing options...
BIGAL Posted December 11, 2023 Author Share Posted December 11, 2023 Thanks for the suggestion it uses my library function for the toggles dcl so that part can be used in any code, yes could add a select all as the return result is a list of ("1" "0" "1" "1" "1" "1") so could do check for "select all" button is on. Not sure about "unselect" will check Cancel is working properly. As the buttons are toggles if you click again they turn off. You could make the changes pretty easy. You can use (set_tile "tb1" "1") and so on, so the default buttons are turned on then just press OK. A all "on" would use (set_tile keynum "1") in multi toggles.lsp 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.