Browse for directory again

Discussion in 'AutoCAD' started by Gary J. Orr, Apr 6, 2004.

  1. Gary J. Orr

    Gary J. Orr Guest

    I have spent the past hour searching the help files and the news groups but
    still don't have a clean answer (i.e. does not rely on plug-ins or add-ons
    such as dos_lib or Express Tools):

    The question is:
    In AutoCAD 2004 how do you access the "Browse for Folder" dialog box that
    AutoCAD uses when (for example) browsing for a search path?

    Your help will be appreciated.

    --
    Gary J. Orr
    CADD Administrator
    (218) 279-2421


    LHB, Inc
    21 West Superior Street, Suite 500
    Duluth, Mn 55802
    (218) 727-8446
    www.LHBcorp.com
     
    Gary J. Orr, Apr 6, 2004
    #1
  2. Gary J. Orr

    Rudy Tovar Guest

    This has been posted already several times.

    But since you're having problem solving this, here's an example.

    (defun ALE_GetFolder ( / DirPat)
    (and
    (setq DirPat
    (getfiled
    "Browse for folder"
    "Open a folder and click on SAVE" " " 1
    )
    )
    (setq DirPat (substr DirPat 1 (- (strlen DirPat) 4)))
    )
    DirPat
    )

    ;Adjust the flag value.

    --

    AUTODESK
    Authorized Developer
    www.Cadentity.com
    MASi
     
    Rudy Tovar, Apr 6, 2004
    #2
  3. Gary J. Orr

    Kevin P Guest

    I'm not sure.
    You know that could have been a nice thing to add in 2005. There haven't
    been any LISP additions to 2004 or 2005 that are substantial or usefull.
    Don't they realize there are still a boatload of people still using
    AutoLISP? I mean that is the reason their package got so popular in the
    first place.

    Even VBA is a pain in the but to do something like this.

    Oh well...
     
    Kevin P, Apr 7, 2004
    #3
  4. Sounds to me like you might be talking about the "getfiled" function, e.g.
    ^C^C-INSERT (getfiled "Select Drawing to Insert" "F:/" "dwg" 0)
    calls up a browse dialog box open to the root directory of drive F: to look
    for a drawing to insert.

    Or, there's the tilde (~) in response to a command-line prompt, e.g.
    -INSERT ~
    brings up a browse dialog box.

    But maybe that's not what you're asking for.

    Kent Cooper, AIA

    ...
     
    Kent Cooper, AIA, Apr 7, 2004
    #4
  5. Gary J. Orr

    Gary J. Orr Guest

    Rudy,
    I have seen this solution posted, but it isn't the solution that I'm asking
    for.
    This solution (I thing even originated by you?) relies on the user actually
    READING the dialog box. Unfortunately most of the issues that I end up
    resolving is the intermittent user not having read an instruction or options
    on a command line.

    There is a directory browser in the Express Tools suite (acet-ui-pickdir),
    but due to some ET installment glitches in our multi-platform/multiuser
    environment I can't rely on them being loaded. If I could extract it as a
    stand-alone *.lsp then load it if absent that would work.

    AutoCAD has a "Browse for Folder" dialog, I'm asking how to access it.

    Thank you for your response

    --
    Gary J. Orr
    CADD Administrator
    (218) 279-2421


    LHB, Inc
    21 West Superior Street, Suite 500
    Duluth, Mn 55802
    (218) 727-8446
    www.LHBcorp.com
     
    Gary J. Orr, Apr 7, 2004
    #5
  6. I've been trying to figure this out, but I guess I just don't understand
    what you're trying to do. In what way is it different from what AutoLisp's
    "getfiled" function does for you? Under what circumstances does a dialog
    box called "Browse for Folder" appear? I couldn't find it -- for example,
    in the first case I could think of off-hand where you might actually be
    looking for a folder, rather than a file, the dialog box that comes up when
    you pick "Browse" in the Xref Manager is called "Select new path." Is the
    one you refer to, wherever it is, any different from the regular file dialog
    box? If so, in what way?

    With "getfiled" you can have the dialog box that comes up titled any way you
    want (that's one of the terms in the function format), so you could force it
    to give you a file dialog box titled "Browse for Folder" like this example,
    if you want it within an button or pop or screen-menu Insert item:

    ^C^C-INSERT (getfiled "Browse for Folder"
    "<filepath-of-wherever-you-want-it-to-start,-remembering-to-use-forward-slas
    hes>" "dwg" 0)

    (Check out help for different things you can do with the last two terms.)
    Could it be that some custom routine, using language like this, is the
    source of this dialog box, and that in fact it's just a regular old file
    dialog box, but with a custom title?

    The "getfiled" function is supposed to work with any command asking for a
    file name or location, I think. Quoting from the AutoLisp Reference:

    "You can use this dialog box to browse through different drives and
    directories, select an existing file, or specify the name of a new file."

    Is what you're trying to do different from any of those choices (considering
    that "folders" and "directories" are the same thing)? Does your "Browse for
    Folder" dialog box do something that's not covered under "...browse
    through...directories" here?

    Kent Cooper, AIA

    ...
     
    Kent Cooper, AIA, Apr 7, 2004
    #6
  7. Gary J. Orr

    Gary J. Orr Guest

    The short answer to your questions is Yes, it is a different dialog box. And
    Yes, I'm very familiar with the (getfiled) function, I use it all of the
    time. To see specific examples of two of the available "Browse for Folder"
    dialog boxes:
    From my last post
    <snip>
    There is a directory browser in the Express Tools suite (acet-ui-pickdir)
    <snip>
    To see this one (with Express Tools loaded) type the following at the
    command line:
    (acet-ui-pickdir)

    To see the one built into AutoCAD (from my original post):
    <snip>
    (for example) browsing for a search path?
    <snip>
    Here is a step by step for this example:
    Type OPTIONS at the command line:
    Select the FILES tab:
    Expand the SUPPORT FILE SEARCH PATH item:
    Select any of the path statements or hit the ADD Button:
    hit the BROWSE... Button:

    There's even another one in the Dos_lib suite floating around, but again,
    I'm looking for the built in one to prevent dependancy upon add-ons and
    plug-ins.

    Thanx again

    --
    Gary J. Orr
    CADD Administrator
    (218) 279-2421


    LHB, Inc
    21 West Superior Street, Suite 500
    Duluth, Mn 55802
    (218) 727-8446
    www.LHBcorp.com
     
    Gary J. Orr, Apr 7, 2004
    #7
  8. Gary J. Orr

    liftedaxis Guest

    Gary,

    Autocad also has a really nice dialog box with which to select linetypes, but we can't fire it from AutoLISP.
    if you write your application in ARX, your can use the fancy folder selection dialog box. if you use autolisp, you are constrained by certain factors.
    i would suggest tackling your issue of ET installation "weirdness". one possible fix would be something like:
    (if (not (member "ACET-UI-PICKDIR" (atoms-family 1))) (command "expresstools"))
    or leverage a standard profile across all workstations.

    --Jeremiah
     
    liftedaxis, Apr 7, 2004
    #8
  9. Gary J. Orr

    Gary J. Orr Guest

    Unfortunately the ARX is beyond me, I'm a dedicated lisper with just enough
    knowledge of VB/VBA and Windows scripting to be dangerous.

    <snip>
    leverage a standard profile across all workstations.
    <snip>
    If only <very big sigh>. One of the mandated charters in our firm is
    supporting individual user customization. And, to be perfectly honest, I
    believe in that as well. I'm a supporter of anything that increases
    production levels. But that is a sidebar that I'd rather not follow.

    Anyway, I intend to tackle the install issue if I can't access the default
    AutoCAD version of the utility.
    You don't by any chance happen to know if the Express Tools "Browse for
    Folder" was ever a standalone function or if it could be extracted to make
    one?

    Thanx much for your time,

    --
    Gary J. Orr
    CADD Administrator
    (218) 279-2421


    LHB, Inc
    21 West Superior Street, Suite 500
    Duluth, Mn 55802
    (218) 727-8446
    www.LHBcorp.com
    but we can't fire it from AutoLISP.
    selection dialog box. if you use autolisp, you are constrained by certain
    factors.
    possible fix would be something like:
     
    Gary J. Orr, Apr 7, 2004
    #9
  10. Gary J. Orr

    chemlab Guest

    using the getfiled dialog would require a file to exist in the dir
    much like the xref browse for path button. from there you
    would have to strip out the file name like one of the posts
    above mention (i believe it was rudy). the browse button in
    the config is done in VBA i think, i tried to figure out how to
    call it in lsp at one point and gave up after finding out about
    the ACET-UI-PICKDIR feature, it uses the same dialog box.

    the one in the dos_lib has an added feature with the create
    folder button, but i see no way of turning the button off when
    it isn't needed.

    i would agree with the post above in taking the time to make
    ET work on your machines, there are other good features to
    use in your programs.
     
    chemlab, Apr 7, 2004
    #10
  11. Gary J. Orr

    Gary J. Orr Guest

    Louis,
    Thank you for your utilities. They are definately up to the task, however
    since they require installation (for registration of the dll's) I will
    probably skip this option. Since we have the express tools (or at least for
    this release) I'll work on verifying and/or reinstalling them (if required).

    Again, Thanx for your solution and I recommend either this or dos_lib for
    anyone that wants to install add-ons.

    --
    Gary J. Orr
    CADD Administrator
    (218) 279-2421


    LHB, Inc
    21 West Superior Street, Suite 500
    Duluth, Mn 55802
    (218) 727-8446
    www.LHBcorp.com
     
    Gary J. Orr, Apr 7, 2004
    #11
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.