Results 1 to 5 of 5

Thread: How to browse for a file using a dialog box?

  1. #1
    I could stop if I wanted to
    Join Date
    2003-11
    Posts
    450
    Login to Give a bone
    0

    Default How to browse for a file using a dialog box?

    I am writing a routine that reads in distances and bearings from text files. The user has to type in the filename and then the program reads the file and extracts the data. Instead of having the user type in the file, I would like have the user be able to browse to the file using a dialog box.

  2. #2
    I could stop if I wanted to
    Join Date
    2003-11
    Posts
    450
    Login to Give a bone
    0

    Default Re: How to browse for a file using a dialog box?

    I think I just found it. GETFILED

  3. #3
    I could stop if I wanted to kpblc2000's Avatar
    Join Date
    2006-09
    Posts
    212
    Login to Give a bone
    0

    Default Re: How to browse for a file using a dialog box?

    (getfiled) function requires to select a file. You can try to use this lisp (i don't remember who's an author):
    Code:
    (defun browsefolder (title / shlobj folder fldobj outval)
      ;; Getting folder name user selected
      ;; If user press Cancel or Esc, returns nil
      ;; Call parameters:
      ;;	title	info message
      ;; Call samples:
      ;; (browsefolder "Select a folder")
      (vl-load-com)
      (setq
        shlobj (vla-getinterfaceobject
                 (vlax-get-acad-object)
                 "Shell.Application"
                 ) ;_ end of vla-getInterfaceObject
        folder (vlax-invoke-method shlobj 'browseforfolder 0 title 0)
        ) ;_ end of setq
      (vlax-release-object shlobj)
      (if folder
        (progn
          (setq
            fldobj (vlax-get-property folder 'self)
            outval (vlax-get-property fldobj 'path)
            ) ;_ end of setq
          (vlax-release-object folder)
          (vlax-release-object fldobj)
          outval
          ) ;_ end of progn
        ) ;_ end of if
      ) ;_ end of defun

  4. #4
    I could stop if I wanted to
    Join Date
    2015-08
    Posts
    263
    Login to Give a bone
    0

    Default Re: How to browse for a file using a dialog box?

    Quote Originally Posted by kpblc2000
    (getfiled) function requires to select a file. You can try to use this lisp (i don't remember who's an author):
    Very useful one, thanks.

    Regards,
    Abdul Huck

  5. #5
    100 Club Mohmed Zuber's Avatar
    Join Date
    2005-08
    Location
    Bharuch in India
    Posts
    136
    Login to Give a bone
    0

    Default Re: How to browse for a file using a dialog box?

    The In-Session ATP164 will cover file handling in AutoLISP in Segment_3. File Read, Write & Append operations are illustrated through sample Road Profile program.

Similar Threads

  1. Replies: 7
    Last Post: 2013-11-16, 11:44 PM
  2. Browse Button
    By caddog71 in forum VBA/COM Interop
    Replies: 11
    Last Post: 2007-07-03, 08:34 PM
  3. Plot to File- Standard file navigation dialog box
    By mcharper in forum AutoCAD Plotting
    Replies: 7
    Last Post: 2006-05-10, 01:07 AM
  4. browse to open file dialog box is gone
    By aws.89861 in forum AutoCAD Map 3D - General
    Replies: 3
    Last Post: 2005-08-02, 06:30 PM
  5. Lost File/Open File/Save Dialog Box on Autocad 2000i
    By thegoffs.89856 in forum AutoCAD General
    Replies: 3
    Last Post: 2005-06-30, 09:05 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •