jim78b Posted November 15, 2021 Share Posted November 15, 2021 hello i want load a lisp from a custom path but with my code don't work why? i create a newcommand and paste in to the tool palette ^C^C^( load "C:\Users\Utente\Dropbox\Lavoro\backup\AUTOCAD\Lisp\PURGE shape purge.lsp") nothing happen Quote Link to comment Share on other sites More sharing options...
mhupp Posted November 15, 2021 Share Posted November 15, 2021 I think you need double \\ ^C^C^( load "C:\\Users\\Utente\\Dropbox\\Lavoro\\backup\\AUTOCAD\\Lisp\\PURGE shape purge.lsp") Also might want to change it to. ^C^C^(load (strcat (getenv "userprofile") "\\Dropbox\\Lavoro\\backup\\AUTOCAD\\Lisp\\PURGE shape purge.lsp")) This will allow other users to load this if Dropbox is installed in the same location. without having to edit the code for each user name. Quote Link to comment Share on other sites More sharing options...
jim78b Posted November 15, 2021 Author Share Posted November 15, 2021 sorry but not happen nothing, i want even launch the program after load lisp Quote Link to comment Share on other sites More sharing options...
mhupp Posted November 15, 2021 Share Posted November 15, 2021 sorry I am not understanding what your saying. Quote Link to comment Share on other sites More sharing options...
Steven P Posted November 15, 2021 Share Posted November 15, 2021 What does AutoCAD tell you when you try to run the command? For example if I paste it into the command line it tells me ";error: load failed:" which I would expect since the file path is not on my computer. Might give us a clue where it is all going wrong. Quote Link to comment Share on other sites More sharing options...
jim78b Posted November 15, 2021 Author Share Posted November 15, 2021 1 minute ago, Steven P said: What does AutoCAD tell you when you try to run the command? For example if I paste it into the command line it tells me ";error: load failed:" which I would expect since the file path is not on my computer. Might give us a clue where it is all going wrong. keep typing command: . nothing is happening Quote Link to comment Share on other sites More sharing options...
jim78b Posted November 15, 2021 Author Share Posted November 15, 2021 2 minutes ago, Steven P said: What does AutoCAD tell you when you try to run the command? For example if I paste it into the command line it tells me ";error: load failed:" which I would expect since the file path is not on my computer. Might give us a clue where it is all going wrong. Quote Link to comment Share on other sites More sharing options...
mhupp Posted November 15, 2021 Share Posted November 15, 2021 (edited) ^C^C^(load (strcat (getenv "userprofile") "\\Dropbox\\Lavoro\\backup\\AUTOCAD\\Lisp\\PURGE shape purge.lsp")) This only loads the lisp into AutoCAD. It doesn't run the lisp. you need to look at the start of the lisp for something like (defun C:RSHX () or what ever the command is. from there you can do two things. either type the command into the command prompt to run it. Or have this at the end of your lisp so when it loads it will automatically run itself. (C:RSHX) Example (defun C:test () (prompt "\nThis is a test") (princ) ) (C:test) Edited November 15, 2021 by mhupp Quote Link to comment Share on other sites More sharing options...
jim78b Posted November 15, 2021 Author Share Posted November 15, 2021 2 minutes ago, mhupp said: ^C^C^(load (strcat (getenv "userprofile") "\\Dropbox\\Lavoro\\backup\\AUTOCAD\\Lisp\\PURGE shape purge.lsp")) This only loads the lisp into AutoCAD. It doesn't run the lisp. you need to look at the start of the lisp for something like (defun C:RSHX () or what ever the command is. from there you can do two things. either type the command into the command prompt to run it. Or have this at the end of your lisp so when it loads it will automatically run itself. (C:RSHX) ok thanks , however only your code without launching command don't give me any message is right? Quote Link to comment Share on other sites More sharing options...
jim78b Posted November 15, 2021 Author Share Posted November 15, 2021 ^C^C^(load (strcat (getenv "userprofile") "\\Dropbox\\Lavoro\\backup\\AUTOCAD\\Lisp\\PURGE shape purge.lsp"))(C:RSHX) autocad don't give me any message Quote Link to comment Share on other sites More sharing options...
mhupp Posted November 15, 2021 Share Posted November 15, 2021 look over this http://www.lee-mac.com/runlisp.html 1 Quote Link to comment Share on other sites More sharing options...
Steven P Posted November 15, 2021 Share Posted November 15, 2021 I think mhupp might have confused you, but that's OK. Your original command ^C^C^(load (strcat (getenv "userprofile") "\\Dropbox\\Lavoro\\backup\\AUTOCAD\\Lisp\\PURGE shape purge.lsp")) loads into memory all the LISP routines saved within the file "PURGE shape purge.lsp". There might be one, there might be a few. Next step would be to open your file 'PURGE shape purge.lsp' and look through it (or do a 'find') for the start of each function, which will typically start with "(defun c:" until you find the function you want to run. Replace mhupps example (C:RSHX with the name of your function and not his example and try that. Th part after the 'c' is the name of the LISP function and you will need to use (c: +[LISP name] ) 1 Quote Link to comment Share on other sites More sharing options...
jim78b Posted November 15, 2021 Author Share Posted November 15, 2021 Ok sorry me for don't understand. But only your edit code in command line prompt don't give me any message of load lisp file Quote Link to comment Share on other sites More sharing options...
mhupp Posted November 15, 2021 Share Posted November 15, 2021 23 minutes ago, jim78b said: Ok sorry me for don't understand. But only your edit code in command line prompt don't give me any message of load lisp file Yes @Steven P probably didn't explain it properly. 1. ^C^C^(load (strcat (getenv "userprofile") "\\Dropbox\\Lavoro\\backup\\AUTOCAD\\Lisp\\PURGE shape purge.lsp")) only loads the lisp. 2. Loading a lisp by default doesn't produce a message by default 3. if you already have the lisp loaded you only need to run the lisp then and should either be typed in the command prompt or ^C^C _lispcommand if you want just upload your lisp file and Steven or I will fix it. 2 Quote Link to comment Share on other sites More sharing options...
jim78b Posted November 15, 2021 Author Share Posted November 15, 2021 (edited) yes i understand but every time i click on my tool palette command give me: Command: Command: Command: Command: Command: Command: Command: Command: Command: Command: Command: Edited November 15, 2021 by jim78b Quote Link to comment Share on other sites More sharing options...
Steven P Posted November 15, 2021 Share Posted November 15, 2021 OK, are you able to share your LISP routine, drag and drop "C:\Users\Utente\Dropbox\Lavoro\backup\AUTOCAD\Lisp\PURGE shape purge.lsp" using the 'drag files' option (bottom left of the message box here), then we can see what it contains and should be able to suggest what you need to do? To me it sounds like AutoCAD is doing what you are asking it to do, but need to ask it a slightly different question, we should be able to help you with that after seeing your LISP file 1 Quote Link to comment Share on other sites More sharing options...
jim78b Posted November 15, 2021 Author Share Posted November 15, 2021 (edited) MY LISP FILE WORK WELL IF I USE IT WITH AUTOLISP WINDOW, but i want use it when i want throught a command tool bar button, i think wrong type folder.thanks for patience ^C^C^(load (strcat (getenv "userprofile") "C:\\Users\\Utente\\Dropbox\\Lavoro\\backup\\AUTOCAD\\Lisp\\PURGE\\RSHX shape purge")) Edited November 15, 2021 by jim78b Quote Link to comment Share on other sites More sharing options...
jim78b Posted November 15, 2021 Author Share Posted November 15, 2021 hello i managed to make it work, thank you all from my heart! (LOAD "C:/Users/Utente/Dropbox/Lavoro/backup/AUTOCAD/Lisp/PURGE/RSHX.lsp");RSHX; many thanks 1 1 Quote Link to comment Share on other sites More sharing options...
Steven P Posted November 15, 2021 Share Posted November 15, 2021 Glad you worked it out, Quote Link to comment Share on other sites More sharing options...
jim78b Posted November 15, 2021 Author Share Posted November 15, 2021 Thanks for yours help .best regards 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.