Getfiled dialogbox current cursor position not in File type text box

Hi

I have problem in Getfiled dialog box its default cursor position in not positioned in File type text box, In AutoCAD works perfect, any changes my be required?

Code:

(if (setq fn (getfiled "Create New data file"
(cond ((getenv "LastPath"))
((getvar 'dwgprefix))
)
"txt"
1
)
)
(progn (setenv "LastPath" fn)
(setq path fn)
(setq file (VL-FILENAME-BASE path))
(setq dir (VL-FILENAME-DIRECTORY path))
(setq ext (VL-FILENAME-EXTENSION path))
);Progn
)

Comments

  • Hello.

    In my testing, the script worked fine.

    Maybe, it would help to first check whether the environment variable "LastPath" exists.

    Note that LastPath points to a file and 'Dwgprefix points to a folder.

    If LastPath is not defined, there is no file to place the cursor on.