OpenDCL Forums

OpenDCL => Runtime/AutoLISP => Topic started by: macuma on February 15, 2010, 08:26:26 AM

Title: Retrieve file name from a File Explorer box
Post by: macuma on February 15, 2010, 08:26:26 AM
I have a text button on Form 2 which successfully opens a File Explorer dialog box Form 3.

On selecting a file or creating a new file how do I set the variable dat_loc to the file name? It is currently returning nil.

Does clicking Open on the dialog box carry out a close function?

(defun c:dat_Form2_TextButton3_OnClicked (/)
  (dcl_Form_Show dat_Form3)
);defun


(defun c:dat_Form3_OnClose (/)
  (setq dat_loc (dcl_FileExplorer_GetFileName dat_Form3))
);defun
Title: Re: Retrieve file name from a File Explorer box
Post by: owenwengerd on February 15, 2010, 08:33:25 AM
Try:
(setq dat_loc (dcl_Form_Show dat_Form3))
Title: Re: Retrieve file name from a File Explorer box
Post by: macuma on February 15, 2010, 08:48:43 AM
Thank you for the quick response, but that did not work.
Title: Re: Retrieve file name from a File Explorer box
Post by: owenwengerd on February 15, 2010, 09:37:26 AM
What exactly didn't work?
Title: Re: Retrieve file name from a File Explorer box
Post by: macuma on February 15, 2010, 09:48:09 AM
dat_loc is still set to nil even though file selected.
Title: Re: Retrieve file name from a File Explorer box
Post by: owenwengerd on February 15, 2010, 10:38:25 AM
Can you provide a simple test project that demonstrates the problem?
Title: Re: Retrieve file name from a File Explorer box
Post by: macuma on February 16, 2010, 05:24:50 AM
Files as requested.
Title: Re: Retrieve file name from a File Explorer box
Post by: owenwengerd on February 16, 2010, 09:24:52 AM
I've attached a corrected .lsp file that is working fine for me.  Hopefully this will get you going again.
Title: Re: Retrieve file name from a File Explorer box
Post by: macuma on February 17, 2010, 03:50:49 AM
Excellent! That did the trick.

Thanks for your help.