ScribbleJ Posted January 12, 2012 Posted January 12, 2012 Here is a routine that will open Windows Explorer from within AutoCad to the current directory you are working in and to your Auto Save directory. I do not take credit for this and I do not know who the author is. I just wanted to share this because I find it very useful. Enjoy ;========= Explorer to Current Directory (Defun C:ECD () (Setvar "Cmdecho" 0) (Command "Shell" (Strcat "Explorer /n," ;Explorer, New Window, (add /e to use Explorer View) (Chr 34) ;Quote marks (Getvar "dwgprefix") ;Current drive and folder (Chr 34) ;Quote marks ) ;Close Strcat ) ;Close Command (Princ) ) ;Close Defun on C:ECD ;========= Explorer to AutoSave Directory (Defun C:EASD () (Setvar "Cmdecho" 0) (Command "Shell" (Strcat "Explorer /n," ;Explorer, New Window, (add /e to use Explorer View) (Chr 34) ;Quote marks (getvar "savefilepath") ;Current drive and folder (Chr 34) ;Quote marks ) ;Close Strcat ) ;Close Command (Princ) ) ;Close Defun on C:EASD Quote
Lee Mac Posted January 12, 2012 Posted January 12, 2012 Thanks for sharing Calvin This is what I use: http://lee-mac.com/open.html Opens files / folders / specialfolders Quote
ScribbleJ Posted January 12, 2012 Author Posted January 12, 2012 Lee thanks for sharing as well. In my efforts to learn LISP it is good to see how others approach similar objectives. I like the one I posted simply because it is a three letter keyin to open the folder I'm currently working in. I try to shortcut my efforts as much as possible. I repeat so many things in my work that I find one less character typed or one less mouse click really helps me out tremendously especially if I am doing it repetitiously to produce results. So being able to type in 'ECD' at the command line is a quick method for me to open up explorer to the files I'm working on. I don't normally access files via explorer because we use Sheet Set Manager here and it is a standard for the company to help us manage projects as well as field reference bubbles within plan, profiles and details. I guess my point in all of that is that I look for the quickest and most efficient way to perform a task. Cheers Quote
alanjt Posted January 12, 2012 Posted January 12, 2012 I've had this in my startup for years: (defun c:DIRR (/) (STARTAPP "EXPLORER" (GETVAR "DWGPREFIX")) (princ)) Quote
Lee Mac Posted January 12, 2012 Posted January 12, 2012 On the same theme, I believe there was a request at the Swamp at while back where the user wanted to have a program that would open a set of files relevant to the project that they were working on; for example, if the user were working with the same files on a daily basis, they could open AutoCAD (or add AutoCAD to Windows Startup), then just click on a button and all the files relevant to the project would open (the names of these could be stored in a small Text file). Just an idea, and not too difficult to create Quote
alanjt Posted January 12, 2012 Posted January 12, 2012 On the same theme, I believe there was a request at the Swamp at while back where the user wanted to have a program that would open a set of files relevant to the project that they were working on; for example, if the user were working with the same files on a daily basis, they could open AutoCAD (or add AutoCAD to Windows Startup), then just click on a button and all the files relevant to the project would open (the names of these could be stored in a small Text file). Just an idea, and not too difficult to create I remember that thread. Did anything ever come of it? Wouldn't be terrible difficult to code. Quote
Lee Mac Posted January 12, 2012 Posted January 12, 2012 I remember that thread. Did anything ever come of it? Wouldn't be terrible difficult to code. Can't remember and cba to search for it - I think I posted some sample code but didn't take it too far. Quote
pBe Posted January 13, 2012 Posted January 13, 2012 (if (= (getvar 'dwgtitled) 1) (startapp (strcat "explorer /select, " (getvar "dwgprefix") (getvar "dwgname") ", /e")) ) The file highlighted 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.