Open Folder Location

Open Folder Location

Anonymous
Not applicable
6,427 Views
15 Replies
Message 1 of 16

Open Folder Location

Anonymous
Not applicable

Is there a way to create a lisp routine to open the drawing file folder in Windows Explorer?

 

I would like to be able to create an icon that will allow me to browse to the folder where the current (open) drawing is located. Our projects have a lengthy file path and it gets annoying drilling down to the folder any time we have files for correspondence to reference. \

 

Any help would be greatly appreciated.

 

Thanks.

0 Likes
Accepted solutions (2)
6,428 Views
15 Replies
Replies (15)
Message 2 of 16

Ranjit_Singh
Advisor
Advisor

One example

^C^C(command "._start" (getvar 'dwgprefix))
0 Likes
Message 3 of 16

Anonymous
Not applicable

It appears to run into some issues when a space is found. The drawing prefix is X:\Microvellum 7\Koehler_v043_4_Imperial\Factory Database\<job folder> but it takes me to X:\Microvellum... Our X:\ drive has multiple folders that begin with Microvellum, but it seems to ignore anything after a space.

0 Likes
Message 4 of 16

Ranjit_Singh
Advisor
Advisor
Accepted solution

Try

^C^C(command "._start"(strcat "explorer "  (getvar 'dwgprefix)))
Message 5 of 16

ВeekeeCZ
Consultant
Consultant

If you're using File Tabs, then the last item in shortcut menu is...

 

image.png

Message 6 of 16

pbejse
Mentor
Mentor
Accepted solution

@ВeekeeCZ wrote:

If you're using File Tabs, then the last item in shortcut menu is...

 

 


I did not know that Smiley Surprised nice.

 

You can use the lines below to open the folder as well as highlight the drawing file.

 

(startapp
            (strcat "explorer /select, "
                    (getvar "dwgprefix")
                    (getvar "dwgname")
                    ", /e"))


 

for toolbars

 

^C^C(startapp (strcat "explorer /select, " (getvar "dwgprefix") (getvar "dwgname") ", /e"))

 

Message 7 of 16

Anonymous
Not applicable

The file path is veritable and opens the .deg location is their a way to make it open to a static path in front of it. 

 

Example 

 

C:/Job Number/Drafting/Civil = ^C^C(startapp (strcat "explorer /select, " (getvar "dwgprefix") (getvar "dwgname") ", /e"))

 

I'll like it to direct me to a static folder called Drawing_control which is a static directory after the code

 

C:/Job Number/Drafting/Civil/drawing_control 

 

^C^C(startapp (strcat "explorer /select, " (getvar "dwgprefix") (getvar "dwgname") ",  + /drawing_control 

 

0 Likes
Message 8 of 16

cschnarr
Enthusiast
Enthusiast

I love it! Who needs to program a button when we already have one. Great suggestion for this question!

0 Likes
Message 9 of 16

kzD1219
Collaborator
Collaborator

@cschnarr wrote:

I love it! Who needs to program a button when we already have one. Great suggestion for this question!


I am a full on typer and barely use any of the toolbars/menus so having a command is much quicker.

 

Thanks for the tab right-click suggestion, I didn't know that was there either.

0 Likes
Message 10 of 16

kzD1219
Collaborator
Collaborator

@pbejse wrote:

@ВeekeeCZwrote:

If you're using File Tabs, then the last item in shortcut menu is...

 

 


I did not know that Smiley Surprised nice.

 

You can use the lines below to open the folder as well as highlight the drawing file.

 

(startapp
            (strcat "explorer /select, "
                    (getvar "dwgprefix")
                    (getvar "dwgname")
                    ", /e"))


 

for toolbars

 

^C^C(startapp (strcat "explorer /select, " (getvar "dwgprefix") (getvar "dwgname") ", /e"))

 


Awesome routine.  Do I just copy that line every time into the command line or is there a way to make that a lisp?  Sorry not too technical, just enough to be dangerous...lol

0 Likes
Message 11 of 16

ВeekeeCZ
Consultant
Consultant

Lisp command. HERE is what to do.

(defun c:FL () (startapp (strcat "explorer /select, " (getvar "dwgprefix") (getvar "dwgname") ", /e")) (princ))

 

 

Message 12 of 16

kzD1219
Collaborator
Collaborator

@ВeekeeCZ wrote:

Lisp command. HERE is what to do.

(defun c:FL () (startapp (strcat "explorer /select, " (getvar "dwgprefix") (getvar "dwgname") ", /e")) (princ))

 

 


YES!!!  Works great, thanks!  All great solutions!

0 Likes
Message 13 of 16

kzD1219
Collaborator
Collaborator

Now my mind is going elsewhere.  Since that was fairly quick and painless, any way to open up a shortcut file on my desktop through a command or start a specific website(s) that I use regularly.  Just thinking.  

0 Likes
Message 14 of 16

ВeekeeCZ
Consultant
Consultant

(defun c:google () (command "_.browser" "www.google.com") (princ))
(defun c:mymostfavouritefile () (startapp "explorer" "c:\\temp\\file.pdf") (princ))

Message 15 of 16

kzD1219
Collaborator
Collaborator

@ВeekeeCZ wrote:

(defun c:google () (command "_.browser" "www.google.com") (princ))
(defun c:mymostfavouritefile () (startapp "explorer" "c:\\temp\\file.pdf") (princ))


A HUGE thank you for making my life even easier!!  Now if I could only convince the rest of the staff to use those shortcuts.

0 Likes
Message 16 of 16

Sea-Haven
Mentor
Mentor

Understand getting others to use, anyway just put all of them into a lisp and it sounds like your using a server so save it on the server not local, go to each user and just do Appload yourcustomlisp to Start up Suite, then it will load on start up, if you add more shortcuts to this lisp and save on server, then next Cad open they will have new shortcuts.

 

My Autoload.lsp has 38 defuns and 35 Autoloads. Plus custom menu's.

0 Likes