lamensterms Posted February 24, 2014 Share Posted February 24, 2014 Hey guys, I'm sure this has been asked multiple times in the past, but I'm having a peculiar issue with what I though would be a very simple operation. I'm trying to create a bunch of "directory" links to a range of different folders (on my local machine and on the network). I had previously set this us using LISP, but now I would rather incorporate into a CUIX file without the need for a LISP routine. So... I've tried a range of combinations with various ways to trying to get the explorer windows to open to the correct location, unfortunately I have now forgotten what macro I started with. Right now... ^C^C(startapp "explorer" "t:") ... Will open T Drive fine. But... ^C^C(startapp "explorer" "t:/1068") ... Will open "C:\Users\user_10\Documents" Just wondering if someone could please set me straight on where I am going wrong. Thanks a lot for any help. Quote Link to comment Share on other sites More sharing options...
lamensterms Posted February 24, 2014 Author Share Posted February 24, 2014 Hi MSasu, Thanks for the reply. I have read that backslash ( \ ) will 'pause' the command/macro - waiting for user input. This does seem to be the case when attempting to run your code from a menu or toolbar button. Is this normal behaviour? Thanks again. Quote Link to comment Share on other sites More sharing options...
MSasu Posted February 24, 2014 Share Posted February 24, 2014 Lamensterms, meantime I had removed my answer since noticed (late) that you were looking to use that statement into a menu macro and not a routine. Sorry for inconvenience! Quote Link to comment Share on other sites More sharing options...
MSasu Posted February 24, 2014 Share Posted February 24, 2014 Seems that this will work: ^C^C_START T:/1068; Quote Link to comment Share on other sites More sharing options...
lamensterms Posted February 24, 2014 Author Share Posted February 24, 2014 Hi again MSasu, Thanks for that, it does work - but only for directory paths without any spaces. Do you have alternative code which will work for directories which include spaces? Thanks again. Quote Link to comment Share on other sites More sharing options...
MSasu Posted February 24, 2014 Share Posted February 24, 2014 Maybe define your own function and place it into start-up? (defun OpenFolderPath( thePath / ) (setq thePath (vl-string-translate "/" "\\" thePath)) (if (vl-file-directory-p thePath) (startapp "Explorer" thePath) (alert (strcat "Path " thePath " isn't available!")) ) (princ) ) After call it into your button's macro: ^C^C^P(if (member (type OpenFolderPath) '(USUBR SUBR)) (OpenFolderPath "T:/My Folder Name With Spaces") (alert "Tool not available!"));^P Quote Link to comment Share on other sites More sharing options...
JGA Posted February 24, 2014 Share Posted February 24, 2014 Lee Ambrosius http://www.hyperpics.com had a lisp programme - Browse to file, which works well. Quote Link to comment Share on other sites More sharing options...
MSasu Posted February 24, 2014 Share Posted February 24, 2014 JGA, there is also the GETFILED built-in function, but I'm not sure how this will help for OP's case (open an Explorer window for a given path). Quote Link to comment Share on other sites More sharing options...
lamensterms Posted February 24, 2014 Author Share Posted February 24, 2014 Hi guys, Thanks a lot for the tips. Mircea, I was thinking something along the lines of calling a universal 'open explorer' LISP and simply altering the directory for each macro call. The code you have submitted is quite a bit more advanced than I had in mind, but thank you very much for providing it and I look forward to testing it out tomorrow. Thanks again. Quote Link to comment Share on other sites More sharing options...
BIGAL Posted February 25, 2014 Share Posted February 25, 2014 The same question was posted elsewhere today but the answer you want (startapp "explorer /select, P:\autodesk\lisp") Quote Link to comment Share on other sites More sharing options...
lamensterms Posted February 25, 2014 Author Share Posted February 25, 2014 Hi again Mircea, Just wanted to let you know that your routine and macro work great. Thanks again for all your help. Quote Link to comment Share on other sites More sharing options...
BIGAL Posted February 25, 2014 Share Posted February 25, 2014 The other for anyone interested http://www.cadtutor.net/forum/showthread.php?84692-Launching-Directory-Opus-layout-using-macro-or-LISP Quote Link to comment Share on other sites More sharing options...
MSasu Posted February 25, 2014 Share Posted February 25, 2014 Hi again Mircea, Just wanted to let you know that your routine and macro work great. Thanks again for all your help. Glad I could help; you're entirely welcome! Quote Link to comment Share on other sites More sharing options...
lamensterms Posted February 25, 2014 Author Share Posted February 25, 2014 Thanks BigAl, I've got a few different plans for menus on the stove at the moment. Finally getting my act together with the MNU stuff as well. Thanks again everyone. 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.