Cadologist Posted August 2, 2011 Share Posted August 2, 2011 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. Quote Link to comment Share on other sites More sharing options...
Cadologist Posted August 2, 2011 Author Share Posted August 2, 2011 Sorry, not a toolbar button code, a TOOL PALETTE BUTTON CODE........ Quote Link to comment Share on other sites More sharing options...
Cadologist Posted August 2, 2011 Author Share Posted August 2, 2011 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//; Quote Link to comment Share on other sites More sharing options...
BlackBox Posted August 2, 2011 Share Posted August 2, 2011 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 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.