Jump to content

Toolbar Button Code: Windows Explorer to Server Folder


Cadologist

Recommended Posts

I am trying to find the code that will allow me to add a button to a tool palette that will open up a new session of 'Windows Explorer' to a specific folder.

 

I am not talking about opening up the folder for the current drawing, what I want is to give the CAD users in my office a quick shortcut to accessing our standard CAD data (blocks, linetypes, everything company standard for CAD) on our server, via 'Windows Explorer".

 

Tried everything, can't seen to get it to work, any ideas?

 

Folder path I want to open is S:\CAD\ (S: drive is a common pathing for all employees, ie: our office drive and the CAD is a main folder).

 

The coding has to be 'one line', tried a bunch of stuff, double slashes, etc and still nothing.

 

I want this specifically to be utilized via a button on a tool palette, not looking for other options like desktop shortcuts and all that.

 

Thanks in advance, any help would be appreciated.

Link to comment
Share on other sites

Wow, so after a couple hours, I post this message only to find the solution a few minutes later, go figure......

 

 

^C^C_Start S://cad//;

Link to comment
Share on other sites

FWIW - It's been a long time since I've made macros; going from memory....

 

In the CUI Editor add a Command (I'm using FOO for this example):

 

^C^C^P(if (not [color=red]FOO[/color])(load "[color=red]FOO[/color]"));[color=red]FOO[/color];

 

Then Right Click your Tool Palette, and select Customize Commands...

 

Navigate to your Command (FOO), and drag it to the Tool Palette. Hit OK.

 

Then save this code to FOO.LSP file (or use Notepad, and save with .LSP extension):

 

 
(defun c:[color=red]FOO[/color] ()
 (princ "\rEXPLORE CAD FOLDER ")
 (startapp (strcat "explorer /n,/e,S:\\cad\\"))
 (princ))

 

Note - I know this works find for keyboard shortcuts, revise as needed.

 

HTH

 

BTW - My other car is a Tardis. :lol: LoL

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