Jump to content

Recommended Posts

Posted

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

Posted

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 :beer:

Posted

I've had this in my startup for years:

 

(defun c:DIRR (/) (STARTAPP "EXPLORER" (GETVAR "DWGPREFIX")) (princ))

Posted

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 :)

Posted
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.

Posted
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.

Posted

 
(if (= (getvar 'dwgtitled) 1)
     (startapp
           (strcat "explorer /select, "
                   (getvar "dwgprefix")
                   (getvar "dwgname")
                   ", /e"))
     )

 

The file highlighted

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...