;LEGACYFINDFILE
; Provides legacy findfile behaviour without the need of setting LEGACYCODESEARCH = 1
; Searches in the following order:
; - If a folder path is included with the filename, searches just there.
; - Current drawing folder.
; - Start-In folder. This is the folder that the progam has been launched from
; - Installation folder. Folder that application has been installed in.
; - Folders listed on search path, normal findfile behaviour
(defun legacyfindfile
(fn
/ startin dwgfolder installkey installfolder return
) (setq dwgfolder
(getvar 'DWGPREFIX
)) ; current drawing folder ; Retrieve the Installation folder from registry. BricsCAD returns the "\\" AutoCAD doesn't
(setq installkey
(if (= (getvar 'PROGRAM
) "BRICSCAD") "InstallDir" "acadlocation")) ; reg key is application specific ; GIVEN FOLDER
; If the filename includes the path or starts with "."
)
; CURRENT DRAWING FOLDER
; If the drawing has been saved, then search the current dwgfolder for the file
return
)
; START-IN FOLDER
; Search the start-in folder for the file.
; This step may not be necessary as normal findfile searches here in anycase.
; However, this does insure that it follows legacy search order
return
)
; INSTALL FOLDER
; Search the installation folder for the cad application
; again not necessary as normal findile searches here too
return
)
; SEARCH PATH
; Use standard findfile behavior to search the support file search path
)
return
)