Open UNCS folderpath in win explorer from toolpalette button

Open UNCS folderpath in win explorer from toolpalette button

Buzz0m
Collaborator Collaborator
1,067 Views
10 Replies
Message 1 of 11

Open UNCS folderpath in win explorer from toolpalette button

Buzz0m
Collaborator
Collaborator

Hi,

I know this subject has been extensively covered in various forum post but for some reason I can't get the different methods to work.

 

The kink is, that I would like to have a button in a tool palette to open a specific folder. I emphasize that this is a UNC network path, eg. a not mapped folder. It doesn't start with eg. "D:/" but it starts with "//".

 

I found a lisp by the wonderful LeeMac ( http://www.lee-mac.com/explore.html ) that does what I need but how would I add this to a toolpalette button? With a revised version of this code?
(load "//pathTo/LeeMacExplore.lsp");(LM:explore "\\\\companyDrive\\Folder")

 

Or maybe something simpler? At this point I feel that I need straight examples of code, since I have (in my opinion) tried to implement to solutions on the forums to no avail... =(

 

Any help is greatly appreciated!

0 Likes
Accepted solutions (1)
1,068 Views
10 Replies
Replies (10)
Message 2 of 11

ВeekeeCZ
Consultant
Consultant

This syntax works for me.

^C^CExplorer ("\\\\whateever\\data\\")

0 Likes
Message 3 of 11

Buzz0m
Collaborator
Collaborator

Thanks @ВeekeeCZ  for the swift reply!
Your suggestion is one of the syntaxes I tried but it only opens win explorer (in my case to the quick acces view) but does not navigate to the path I specified. In the console it seems that the command pauses after the first ' " ' -character. I'm running this from a tool palette button. Does this matter for the syntax?

0 Likes
Message 4 of 11

ВeekeeCZ
Consultant
Consultant

Ok, I see your point. 

I would go with Lee's solution then. Not sure where is the issue with Toolpallete. Just add any (maybe consider the look of its icon) command to your palette and change the command-string field to your macro/lisp.

0 Likes
Message 5 of 11

hak_vz
Advisor
Advisor

write path as 

\\\\servername\\share\\directory\\subdir\\filename.txt

Miljenko Hatlak

EESignature

Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.
0 Likes
Message 6 of 11

Buzz0m
Collaborator
Collaborator

I guess I'm forced to try to hard code the path into a lisp and then create different lisps for all the paths I want to open. Seems redundant to me, but I'm so frustrated with this I just might do it 😄

I can't get the syntax of my original post to work either (after the part where I load the lisp). It would be great if somebody was able to verify, that passing arguments to lisps via tool palette commands is possible or not. It seems to have the same problem as mentioned in this thread that the command pauses in the console...

0 Likes
Message 7 of 11

ВeekeeCZ
Consultant
Consultant
Accepted solution

OK, this worked for me.

 

I used appload/suite to load Lees-mod routine.

FIlepath with /

^C^C(lm:explore "//server/data/Projects/What space ever/")

 

Then this mod of Lee's routine

(defun LM:explore ( target / rtn shl )
  (setq target (vl-string-translate "/" "\\" target))
    (if (and (or (= 'int (type target)) (vl-file-directory-p target))
             (setq shl (vla-getinterfaceobject (vlax-get-acad-object) "shell.application"))
        )
        (progn
            (setq rtn (vl-catch-all-apply 'vlax-invoke (list shl 'explore target)))
            (vlax-release-object shl)
            (if (vl-catch-all-error-p rtn)
                (prompt (vl-catch-all-error-message rtn))
                t))))

 

Message 8 of 11

Buzz0m
Collaborator
Collaborator

A big thanks to @ВeekeeCZ !

 

I used this principle in my tool palette. Works like a charm! 😃

(load "//server/someFolder/LeeMacsLispThatWasModifiedInThisThread.lsp");(lm:explore "//server/someFolder/")

0 Likes
Message 9 of 11

Sea-Haven
Mentor
Mentor

Have you tried adding a server address to  support paths

 

 "\\\\SERVER\\CAD\\SUPPORT;"
  "\\\\SERVER\\CAD\\LISP;"
  "\\\\SERVER\\CAD\\FONTS;"

then should be able to use just a filename etc. 

0 Likes
Message 10 of 11

Buzz0m
Collaborator
Collaborator

Thanks for the tip @Sea-Haven ! I haven't tried what you suggested but I can see how it could work. Our company has quite a lot of SFSP atm so I'm reluctant to add functinality that searches through them all. That is what autocad would do if I didn't separately specify first to load the lisp into the current drawing, wouldn't it?

 

I'm preparing this simple tool for deployment and I don't want to rely on the users to have the lisp load or the right SFSPs set. That's why I've been adding the "(load...)" part into the toolpalette tools that require a lisp being loaded. If this is bad practice I'd love to hear of better solutions!

 

 

0 Likes
Message 11 of 11

Sea-Haven
Mentor
Mentor

You can add a lisp to always load on start up using appload, startup suite. 

 

Or you can make a "BUNDLE" this has built in options about loading what lisps on start up nice thing is make a zip of bundle and just unzip to correct directory in c:\program files..... Autocad does the rest. Others may comment about adding tool pallete to a bundle.

 

You can add all your server support paths using lisp, includes other options that you want set as well, a upgrade of cad just ran and all done. 

0 Likes