Another method of loading auto lisp file to AutoCAD
Write all the autolisp functions to a separate text file and save it by the name of acad.lsp. Now go to AutoCAD and follow the path:
Tools>options>files>support file search path >click the add button
And give the location of the file acad.lsp. Now next time onward whenever you will start AutoCAD the acad.lsp will be automatically loaded to AutoCAD and you can use the functions written in that.
Locating files: There are two ways one can locate a file using autolisp:
Findfile: This option will search for the file which is in the current autocad search path, if full path of the file is not specified.
Syntax: (findfile “filename")
Example: (findfile "ACAD2000.LSP")
Will return "C:\\Program Files\\ACAD2000\\support\\ACAD2000.LSP"
Getfiled: This option will create a popup window foe selecting the required file.
Syntax: (getfiled “pop up window title" “default file location path" “default file extension" Flag)
If default file location path is specified then the pop up window will open with this path. This field can be NULL.
If you specify the default file extension then you will be able to select only that type of file, if it is NULL then any types of file could be selected.
One can further customize the pop up window by setting the flag value to 1,4,3 and 8 or any combinations of these numbers.