Results 1 to 10 of 11

Thread: Folder Browser Dialog for LISP

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Past Vice President / AUGI Volunteer peter's Avatar
    Join Date
    2000-09
    Location
    Honolulu HI
    Posts
    1,109
    Login to Give a bone
    0

    Default Folder Browser Dialog for LISP

    Hey Group,

    One function that is exposed in the shell.application is browseforfolder.

    Code:
    ; LISP syntax (browseforfolder "Select Folder" "C:\\acad")
    (defun BrowseForFolder (strMessage 
                             strRootFolder 
                             / 
                             lstObjects 
                             objShellApp 
                             objFolder 
                             objParentFolder 
                             strPath
                            )
     (and
      (setq objShellApp (vla-getInterfaceObject 
                         (vlax-get-acad-object) 
                         "Shell.Application" 
                        )
      )  
      (setq lstObjects (list objShellApp))
      (setq objFolder   (vlax-invoke objShellApp
                                    'BrowseForFolder  
                                    0
                                    strMessage
                                    0
                                    strRootFolder
                       )
      )
      (setq lstObjects (cons objFolder lstObjects))
      (setq strTitle          (vlax-get    objFolder       "Title"))
      (setq objParentFolder   (vlax-get    objFolder       'ParentFolder))
      (setq lstObjects (cons objParentFolder lstObjects))
      (setq strPath (vlax-get (vlax-invoke objParentFolder "Parsename" strTitle) "Path"))
     )
     (mapcar 'vlax-release-object lstObjects)
     strPath
    )
    But it does not allow you to pre select a selectedfolder.

    .NET has a browsefolderdialog that gives you more options including the ability to selectfolder.

    See next post.
    Last edited by peter; 2014-02-11 at 07:10 AM.
    AutomateCAD

Similar Threads

  1. File Multi Selection Dialog (and Folder Select)
    By peter in forum Bridging the Gap: LISP -> .NET -> LISP
    Replies: 1
    Last Post: 2014-02-18, 04:46 PM
  2. 2013: New Folder from dialog
    By dgodfather in forum AutoCAD LT - General
    Replies: 8
    Last Post: 2013-01-16, 09:39 PM
  3. allow floating origin folder in the browser bar
    By Wish List System in forum Inventor Wish List
    Replies: 0
    Last Post: 2011-11-18, 10:05 AM
  4. Folder Dialog Option
    By bdthomas02 in forum VBA/COM Interop
    Replies: 3
    Last Post: 2008-07-22, 07:44 PM
  5. Open File Dialog Folder Addition
    By barathd in forum Revit Architecture - Tips & Tricks
    Replies: 0
    Last Post: 2005-02-07, 04:44 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
  •