RLispLearner Posted March 2, 2022 Share Posted March 2, 2022 (edited) My LISP routines are on the Google Share Drive at my work. I have buttons in my custom ribbon that calls my routines using a mapped drive letter URL link. URL Link example in my custom Macro: Goal: Trying to share this with the other CAD users in the office. Problem: Various CAD Users have different mapped drive letters (Ex: H:\ or S:\ instead of G:\). Trying to avoid going around and manually changing the drive letter to match their mapping every time I updated the CUIX file (since path would be overwritten). Would like to use the universal Google Share Drive web based link (by selecting the file and choose "get link" in Google Drive and copy the link). The Swap: Current URL Mapping in my Macro example (if image above not showing): ^C^C(load "G:\shardrive\CAD_Department\CAD_menu\LISP\My_routine.lsp");My_routine; Example of swapping with the Google Share Drive link (not working): ^C^C(load "https://drive.google.com/file/d/0BlU92IihdhhcnRlcl9mWxl/view?usp=sharing&resourcekey=0-0VxGZXU_D8YjtjgjzQZnQ");My_routine; Another method I tried ^C^C(command-s "_browser" "https://drive.google.com/file/d/0BlU92IihdhhcnRlcl9mWxl/view?usp=sharing&resourcekey=0-0VxGZXU_D8YjtjgjzQZnQ/") Anyone know the proper syntax for the macro? Thanks in advance! Edited March 2, 2022 by RLispLearner Quote Link to comment Share on other sites More sharing options...
BIGAL Posted March 2, 2022 Share Posted March 2, 2022 (edited) You could do a check for, Various CAD Users have different mapped drive letters (Ex: H:\ or S:\ instead of G:\) use getfile My_routine.lsp do in a cond (cond (( G: yes load (( H: yes load (( S: yes load ) Make sure your load is working 1st manually for the various drives. Edited March 2, 2022 by BIGAL Quote Link to comment Share on other sites More sharing options...
RLispLearner Posted March 3, 2022 Author Share Posted March 3, 2022 Thanks BigAl. I think sticking with a mapped URL path with a drive letter is preferable to trying the Share Drive web based link so I appreciate your suggestion! For what to put in the macro line, is this close to what you are suggesting (using "getfiled" and a "conditional" statement)? ^C^C (getfiled (cond ((= G: yes (load "G:\shardrive\CAD_Department\CAD_menu\LISP\My_routine.lsp");My_routine;) ((= H: yes (load "H:\shardrive\CAD_Department\CAD_menu\LISP\My_routine.lsp");My_routine;) ((= S: yes (load "S:\shardrive\CAD_Department\CAD_menu\LISP\My_routine.lsp");My_routine;) );end Cond );end getfiled I put together this IF statement just to see if its in the ballpark as well: ^C^C (getfiled (if (Progn ((/= G: nil (load "G:\shardrive\CAD_Department\CAD_menu\LISP\My_routine.lsp");My_routine;) ((/= H: nil (load "H:\shardrive\CAD_Department\CAD_menu\LISP\My_routine.lsp");My_routine;) ((/= S: nil (load "S:\shardrive\CAD_Department\CAD_menu\LISP\My_routine.lsp");My_routine;) );end progn );end if );end getfiled Hopefully I'm not wildly off on all the syntax. Thanks again for the great suggestion…! 1 Quote Link to comment Share on other sites More sharing options...
BIGAL Posted March 3, 2022 Share Posted March 3, 2022 Thinking a bit more I don't use cloud drives, if each user has the support path set. ; must have support path set, Options Files Support files search path (setq fileexist (findfile "My_routine.lsp")) (if (= fileexist nil) (alert "my_routine.lsp not found on G: H: or S: \nCheck your support path settings") (load "My_routine.lsp") ) The search path set ie "G:\shardrive\CAD_Department\CAD_menu\LISP\ can be H: S: etc then findfile will return either T or nil 1 Quote Link to comment Share on other sites More sharing options...
RLispLearner Posted March 5, 2022 Author Share Posted March 5, 2022 Thanks BigAl! I will try it out... 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.