nataca Posted April 8, 2011 Posted April 8, 2011 How to open and close a Folder by visual lisp? I have a Path (ex:"D:\\PROJECTS\2010\") Quote
pBe Posted April 8, 2011 Posted April 8, 2011 How to open and close a Folder by visual lisp?I have a Path (ex:"D:\\PROJECTS\2010\") One way is (defun openw (fldr) (startapp "explorer" fldr) ) (openw "D:\\PROJECTS\2010") Quote
nataca Posted April 8, 2011 Author Posted April 8, 2011 (edited) Thanks. Lee helped me (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)) ) But I still can't Close a Folder Edited July 31, 2012 by SLW210 Tags! Quote
Ace Posted April 12, 2011 Posted April 12, 2011 (edited) this may help ;;;CADALYST 10/06 Tip2158: Directory.lsp Directory (c) Mark Newman ;;; Created by Mark Newman : June 2002 ;;; ;; ---- ;; ---- (DEFUN C:DIRECTORY (/) (STARTAPP "EXPLORER" (GETVAR "DWGPREFIX")) (PRINC) ) ;; ---- ;; ---- Edited July 31, 2012 by SLW210 Tags! Quote
Bill Tillman Posted July 31, 2012 Posted July 31, 2012 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: ^C^C^P(startapp "Explorer T:") 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. Quote
Bill Tillman Posted July 31, 2012 Posted July 31, 2012 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? Quote
Lee Mac Posted July 31, 2012 Posted July 31, 2012 BTW - are you getting to see any of the Olympic Games over there? I certainly am! Some fantastic talent on show, absolutely enthralling to watch Quote
Bill Tillman Posted July 31, 2012 Posted July 31, 2012 Especially the Netherlands Women's Field Hockey team. Hubba hubba! To complete this here is what I ended up doing: (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)) ) Works pretty good. Thanks again. Quote
Lee Mac Posted July 31, 2012 Posted July 31, 2012 Indeed, or the beach volleyball! Alternatively, consider: (defun c:open4chk ( / f ) (if (setq f (getfiled "" "T:/" "dwg" 16)) (startapp "explorer" f) ) (princ) ) Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.