Jump to content

Open specific folder in explorer


jt6572

Recommended Posts

Did you get the other part to work ? Wwe are using it all the time now just type D2016123 and "2016 projects\2016123\design" opens up in explorer. Expanded it also to recognise our archived drive which is based on project year also so just do a check for year

Link to comment
Share on other sites

  • Replies 28
  • Created
  • Last Reply

Top Posters In This Topic

  • jt6572

    15

  • BIGAL

    9

  • ronjonp

    2

  • mostafa badran

    1

Top Posters In This Topic

Posted Images

Did you get the other part to work ? Wwe are using it all the time now just type D2016123 and "2016 projects\2016123\design" opens up in explorer. Expanded it also to recognise our archived drive which is based on project year also so just do a check for year

 

hey Big Al!

firstly, thank you so much for all your help these last couple of months. the job i have had i have found that if i werent a little assertive i wouldnt learn anything around here, so it has been very much appreciated. wont tell you where i work, but i will say that someone coming in and making changes is about 14 years overdue... everyone just doing their own thing, never progressing.

secondly, i got really busy and sneakily had a quick go at it yesterday, but as i posted i am quite lost; i am a lisp neophite and admit it! far better to know your limitations than to wreak irreparable damage!

i am hoping to have a little time this afternoon (last day of work) but there is always engineers, so no telling if i will be able to get to it long enough.

Link to comment
Share on other sites

  • 10 months later...
:oops: ha ha... thanks very much Roy!

 

(any closer it would've bitten me?!) :lol:

 

Okay, somewhere along the line i lost the exact coding to make this work!

 

i have

(defun c:cd ()  
  (startapp "explorer" (getvar "dwgprefix"))
 ) 

 

to open the current drawing's directory, but cant remember how to get it to open the folder "PDF" that has...pdfs.

does the folder that contains the pdfs have to be below the current drawing's folder for this to work btw? what if i am working in Drawings\Sketches, and the pdfs are held in Drawings\PDF?

Link to comment
Share on other sites

If the pdfs are below its easy thats how we have them set up, at different level needs more pulling apart the dwgprefix and changing it.

 

(strcat (getvar "dwgprefix") "pdf\\")

Link to comment
Share on other sites

If the pdfs are below its easy thats how we have them set up, at different level needs more pulling apart the dwgprefix and changing it.

 

(strcat (getvar "dwgprefix") "pdf\\")

 

 

 

Big Al! Hope Geelong is treating you well. :)

 

 

I usually will always have the PDF folder below the drawings; will do that for the sketches I am on at the moment too.

 

 

I have this:

 

 

(defun c:pdf ()

(strcat (getvar 'dwgprefix) "PDF")

)

 

 

and I get the filepath in the command line history temp pop up, but it doesn't open the folder in explorer - which is what I am after.

 

 

thanks for the help. :)

Link to comment
Share on other sites

Try this:

(defun _opendirectory (path / sa)
 (if (and (eq 'str (type path))
   (findfile (vl-string-right-trim "\\" path))
   (setq sa (vlax-create-object "Shell.Application"))
     )
   (progn (vlax-invoke sa 'explore path) (vlax-release-object sa))
 )
 (princ)
)
(_opendirectory (strcat (getvar 'dwgprefix) "PDF"))

 

Or with the previous code:

(defun c:pdf nil (startapp "explorer" (strcat (getvar 'dwgprefix) "PDF")) (princ))

Link to comment
Share on other sites

Try this:

(defun _opendirectory (path / sa)
 (if (and (eq 'str (type path))
   (findfile (vl-string-right-trim "\\" path))
   (setq sa (vlax-create-object "Shell.Application"))
     )
   (progn (vlax-invoke sa 'explore path) (vlax-release-object sa))
 )
 (princ)
)
(_opendirectory (strcat (getvar 'dwgprefix) "PDF"))

 

Or with the previous code:

(defun c:pdf nil (startapp "explorer" (strcat (getvar 'dwgprefix) "PDF")) (princ))

 

 

That's perfect. :)

thanks very much.

Link to comment
Share on other sites

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