Repository navigation
dos_getfilenav
Displays an AutoCAD-style file selection dialog box.
(dos_getfilenav title default ext flags)
title
A string specifying the dialog box label.
default
A default file name to use; can be a null string ("").
ext
The default file name extension. If ext is passed as a null string (""), it defaults to * (all file types).
flags
An integer value (a bit-coded field) that controls the behavior of the dialog box. To set more than one condition at a time, add the values together.
| Value | Description | Details |
|---|---|---|
| 1 (bit 0) | Indicates a request to create a new file. | If bit 0 is not set (open) and bit 2 is not set, only the default extension (or none) is accepted. If no extension is entered, the default extension is used. If the user enters any extension other than the default, an "Invalid file name" message box is displayed and the user is required to try again or cancel. If bit 0 is set (create) and bit 2 is not set, the default extension is added if it is not entered as part of the file name. Note If an extension other than the default is entered, the default extension is still appended and the file name will have multiple extensions. For example, if the user enters test.dwg and the default extension is .txt, then the file name returned will be test.dwg.txt. If the default extension is used, another copy of the extension is not appended. For example, if the default extension is .txt and the user enters test.txt, then test.txt is returned. If bit 0 is not set (open) and bit 2 is set, any extension (or none) is accepted. If no extension is entered, the default is not used; the file name is used as is. If bit 0 is set (create) and bit 2 is set, then any file name is accepted (with or without an extension) as entered |
| 2 (bit 1) | Not used | Bit 1 is unused and reserved. |
| 4 (bit 2) | Enables the user to enter an arbitrary file name extension | Controls the use of file name extensions. If bit 2 is set, any extension (or none) may be used. If bit 2 is not set, this function accepts only the extension specified in the ext argument and appends this extension to the file name if the user doesn't enter it in the File edit box. (See the discussion of bit 0 for information on the results of various combinations of bit 0 and bit 2 settings.) |
| 8 (bit 3) | Performs a library search for the file name entered | If this bit is set and bit 0 is not set, this function performs a library search for the file name entered. If it finds the file and its directory in the library search path, it strips the path name and returns only the name of the file. (It doesn't strip the path name if it finds a file of the same name but in a different directory.) If bit 3 is not set, this function returns the entire file name, including the path name. Set bit 3 if you are using the dialog box to open an existing file whose name you want to save in the drawing (or other database) and which you will search for later by calling (FindFile). |
| 16 (bit 4) | Interprets the second argument to this function as a path or directory name, and not a file name | If this bit is set (or if the default argument ends with a path delimiter, such as "/acad/support/"), the path is interpreted as a path name only, and this function assumes that there is no default file name. It displays the path in the Directory text line, leaves the File edit box blank, and disables the Default button. |
| 32 (bit 5) | Inhibits display of the alert box, which warns that a file exists when a new file of the same name is opened | If this bit is set and bit 0 is set (which means the file exists), the alert box to warn the user that the file exists is not displayed, even though the file exists. |
| 64 (bit 6) | Do not transfer remote file when user specifies a URL | If this bit is set and the user types a URL, no transfer takes place and the URL is returned as is. |
| 128 (bit 7) | Do not allow URLs at all | If this bit is set and the user types a URL, an error status and no filename are returned to the caller. Note This bit overrides the "No transfer" bit (bit 6). |
| 256 (bit 8) | Force the initial directory to be the one specified | If this bit is set, the initial directory is forced to be the second argument. If it is not set, the initial directory is retrieved from the Windows registry and is the last directory browsed when this dialog was last used. If this is the first time used and this bit is not set, the initial directory is the current directory. |
| 512 (bit 9) | Do not enable FTP sites | If this bit is set, the FTP sites item is not present and cannot be browsed. |
| 1024 (bit 10) | Do not enable shell namespace extension items | If this bit is set, no shell namespace extension items are visible or can be browsed. No shell namespace extension buttons are present in the places list. |
| 2048 (bit 11) | Navigation-only folders; allow selection of a folder only | If this bit is set, the dialog displays only folders and allows the selection of a folder only. |
| 4096 (bit 12) | Allow multiple selection | If this bit is set, the dialog allows the selection of multiple files (not honored with bit 11). |
If flag bits 11 (2048) and 12 (4096) are not specified, then the qualified path to the selected file is returned. This is similar to dos_getfiled.
If flag bit 11 (2048) is specified, then the qualified path to the selected folder is returned. This is similar to dos_getdir.
If flag bit 12 (4096) is specified, then a list of selected filenames is returned. This is similar to dos_getfilem. Note, the first element of the list is the qualified path to the selected folder.
nil on cancel or on error.
Command: (dos_getfilenav "Select Lisp Files" "C:\\Program Files\\AutoCAD 2007\\Support\\" "lsp" 8)
"C:\\Program Files\\AutoCAD 2006\\Support\\3d.lsp"
Command: (dos_getfilenav "Select Lisp Files" "C:\\Program Files\\AutoCAD 2007\\Support\\" "lsp" 4104)
("C:\\Program Files\\AutoCAD 2007\\Support\\" "3darray.lsp" "3d.lsp")