Registered forum members do not see this ad.
How to open and close a Folder by visual lisp?
I have a Path (ex:"D:\\PROJECTS\2010\")
Thanks.
Lee helped me
But I still can't Close a FolderCode:(defun Explore ( Directory / Shell result ) (setq Shell (vla-getInterfaceObject (vlax-get-acad-object) "Shell.Application")) (setq result (vl-catch-all-apply 'vlax-invoke (list Shell 'Explore Directory))) (vlax-release-object Shell) (not (vl-catch-all-error-p result)) )![]()
Last edited by SLW210; 31st Jul 2012 at 09:00 pm. Reason: Tags!
this may help
Code:;;;CADALYST 10/06 Tip2158: Directory.lsp Directory (c) Mark Newman ;;; Created by Mark Newman : June 2002 ;;; ;; ---- ;; ---- (DEFUN C:DIRECTORY (/) (STARTAPP "EXPLORER" (GETVAR "DWGPREFIX")) (PRINC) ) ;; ---- ;; ----
Last edited by SLW210; 31st Jul 2012 at 08:59 pm. Reason: Tags!
I have needed a way for our users to open files in a specific folder. Not the last one accessed or the folder where the particular open file originated. Trying to use the Open command did not work so I used "startapp" like this to open Explorer in the T:\ drive which is mapped to a server location:
This works but I'd like to have only the *.dwg file appear in the list and adding \*.dwg to the above command has no affect on it.Code:^C^C^P(startapp "Explorer T:")
It's deja vu, all over again.
Code:(getfiled "" "T:\\" "dwg" 16)
Lee Mac Programming
With Mathematics there is the possibility of perfect rigour, so why settle for less?
Just another Swamper
Lee,
Thanks. I had to double check my syntax, but that is working. Thanks again.
BTW - are you getting to see any of the Olympic Games over there?
It's deja vu, all over again.
Lee Mac Programming
With Mathematics there is the possibility of perfect rigour, so why settle for less?
Just another Swamper
Especially the Netherlands Women's Field Hockey team. Hubba hubba!
To complete this here is what I ended up doing:
Works pretty good. Thanks again.Code:(defun c:open4chk (/ fname) (vl-load-com) (setq fname (getfiled "" "T:/" "dwg" 16)) (vla-activate (vla-open (vla-get-documents (vlax-get-acad-object)) fname)) )
It's deja vu, all over again.
Registered forum members do not see this ad.
Indeed, or the beach volleyball!
Alternatively, consider:
Code:(defun c:open4chk ( / f ) (if (setq f (getfiled "" "T:/" "dwg" 16)) (startapp "explorer" f) ) (princ) )
Lee Mac Programming
With Mathematics there is the possibility of perfect rigour, so why settle for less?
Just another Swamper
Bookmarks