TheSwamp

Code Red => AutoLISP (Vanilla / Visual) => Topic started by: Kerry on May 30, 2010, 10:55:29 PM

Title: Do you lose code when AutoCAD crashes ??
Post by: Kerry on May 30, 2010, 10:55:29 PM
Do you lose code (because you forgot to save it) when AutoCAD crashes ??


Here's a fix.

Make a NEW Project from the VLIDE.
Call it whatever takes your fancy.
Add the source file(s) that you are working on to the project.

Whenever you want to reload the code to test changes ONLY Select the 'Load Source Files' button on the Project dialog.
You will be prompted to save if the file has not been saved.

Title: Re: Do you lose code when AutoCAD crashes ??
Post by: Kerry on May 30, 2010, 11:48:41 PM


and while I'm thinking about Development,
a couple of things to play with file pathing ...
Code: [Select]
;|
(setq DevPaths   (list "K:\\kdubpro2010;"
                       "K:\\kdubpro2010\\source\\pipefittings;"
                 )
)

(AddDevPath DevPaths)

(RemoveDevPath DevPaths)

|;

;;
;; Prefix AutoCAD's Support File Search Path
;; with development folder names.
;; KerryBrown@theSwamp
;;

(defun AddDevPath (DevPaths / IAcadPreferencesFiles pathsString)
  (vl-load-com)
  (setq IAcadPreferencesFiles (vla-get-files
                                (vla-get-preferences (vlax-get-acad-object))
                              )
        pathsString           (vla-get-supportpath IAcadPreferencesFiles)
  )
  (vla-put-supportpath IAcadPreferencesFiles
                       (strcat (apply 'strcat DevPaths) pathsString)
  )
  (princ)
)

;;
;; Remove development folder names
;; from AutoCAD's Support File Search Path.
;; KerryBrown@theSwamp
;;
(defun RemoveDevPath (DevPaths / IAcadPreferencesFiles pathsString DevPaths)
  (vl-load-com)
  (setq IAcadPreferencesFiles (vla-get-files
                                (vla-get-preferences (vlax-get-acad-object))
                              )
        pathsString           (vla-get-supportpath IAcadPreferencesFiles)
  )
  (foreach path DevPaths
    (setq pathsString (vl-string-subst "" path pathsString))
  )
  (vla-put-supportpath IAcadPreferencesFiles pathsString)
  (princ)
)