Specify directory

Discussion in 'AutoCAD' started by iwafb, Oct 5, 2004.

  1. iwafb

    iwafb Guest

    Hi all,

    I am trying to access a function similar to McNeals (dos_getdir). The reason I want to do this is because I am trying to write a set up file which at this stage does not have enough information about the location of the doslib2004.arx. Does anybody know if there is an alternative in lisp?

    Thanks
    Dart
     
    iwafb, Oct 5, 2004
    #1
  2. (getfiled ....

    reason I want to do this is because I am trying to write a set up file which
    at this stage does not have enough information about the location of the
    doslib2004.arx. Does anybody know if there is an alternative in lisp?
     
    Alan Henderson @ A'cad Solutions, Oct 5, 2004
    #2
  3. ; Example: (ALE_BrowseForFolder "Select drawings folder")
    ;
    ; Original BrowseForFolder by Tony Tanzillo
    ;
    (defun ALE_BrowseForFolder (PrmStr / ShlObj Folder FldObj OutVal)
    (vl-load-com)
    (setq
    ShlObj (vla-getInterfaceObject (vlax-get-acad-object)
    "Shell.Application")
    Folder (vlax-invoke-method ShlObj 'BrowseForFolder 0 PrmStr 0)
    )
    (vlax-release-object ShlObj)
    (if Folder
    (progn
    (setq
    FldObj (vlax-get-property Folder 'Self)
    OutVal (vlax-get-property FldObj 'Path)
    )
    (vlax-release-object Folder)
    (vlax-release-object FldObj)
    OutVal
    )
    )
    )



    --

    Marc'Antonio Alessi
    http://xoomer.virgilio.it/alessi
    (strcat "NOT a " (substr (ver) 8 4) " guru.")

    --
     
    Marc'Antonio Alessi, Oct 5, 2004
    #3
  4. Interesting !
    It works !
    What have I to do to set the initial default folder ?
    For istance I want that the BrowseForFolder dialog shows the "c:\window\"
    folder as default . . .

    Ciao Marc'Antonio.
    Bravo
    Domenico
     
    Domenico Maria Pisano, Oct 5, 2004
    #4
  5. iwafb

    iwafb Guest

    Marc,

    That is exactly what I was after. Good work!

    Dart
     
    iwafb, Oct 6, 2004
    #5
  6. Marc'Antonio Alessi, Oct 6, 2004
    #6
  7. The same question I did to Tony, see original thread:

    martedì 10 agosto 2004 15.06
    "Directory select with only lisp"

    ....I have found that I can can have a string prompt (see below),
    is it possible to have a starting path also (like DOS_Getdir)?...


    --

    Marc'Antonio Alessi
    http://xoomer.virgilio.it/alessi
    (strcat "NOT a " (substr (ver) 8 4) " guru.")

    --
     
    Marc'Antonio Alessi, Oct 6, 2004
    #7
  8. Yes you can.

    FWIW, learn to use/translate the documentation for the
    given API. In this case, you can go to MSDN Online
    (http://msdn.microsoft.com) and simply look up the
    BrowseForFolder method.
     
    Tony Tanzillo, Oct 6, 2004
    #8
  9. Thanks.
     
    Marc'Antonio Alessi, Oct 6, 2004
    #9
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.