JimJames Posted October 12, 2022 Posted October 12, 2022 (edited) Hi everyone, this is my first post on this site, long time AutoCAD user, somewhat new to LISP. I was wondering if there was a step by step LISP guide, because so far I have found nothing and I have googled every combination I can think of. To get specific, I have found LISP scripts shared, all serving different purposes but nowhere can I see how to bring that information into AutoCAD. These are the steps I can take so far: copy the lines of script into a .txt file save the .txt as a .lsp file use "Appload" in acad to bring the script in This is where I get stuck. I have no idea how to run the routines once there. There is no command listed in the scripts themselves, there are no errors after using Appload. There are no tutorials on this pinned anywhere. Too many tutorials simply end it at the point where I get stuck. To get even more specific, I am trying to use this https://www.cadtutor.net/forum/showthread.php?80180-Deleting-Hatch-from-Blocks&p=542769&viewfull=1#post542769 I have found nothing that says what you need to do to actually make the LISP routine do stuff. Please help me understand, even a link to a guide. Most posts here are just shared scripts and lines and I have no idea how to apply any of them. Edited October 12, 2022 by JimJames changed "google" to "googled" Quote
Jonathan Handojo Posted October 12, 2022 Posted October 12, 2022 (edited) All the steps you've carried out to APPLOAD are correct. AutoLISP routines are indeed saved in a file with the .lsp extension. Depending on the nature of the contents of the script, the behavior after the APPLOAD command is invoked will vary. The last thing you need to do is invoke the command into the command line. In AutoLISP, whenever you define a function using DEFUN, any name given to the function that prefixes with "c:" are the types of functions that you can call through the command line. In your example script, the function has been assigned the name "c:test". This means that, once you've loaded your LISP routine, you can begin by invoking "TEST" from the command line to execute the function. Whether the command is successful or not is a different story. Here's a more detailed explanation in this link. Edited October 12, 2022 by Jonathan Handojo 2 1 Quote
JimJames Posted October 13, 2022 Author Posted October 13, 2022 14 hours ago, Jonathan Handojo said: All the steps you've carried out to APPLOAD are correct. AutoLISP routines are indeed saved in a file with the .lsp extension. Depending on the nature of the contents of the script, the behavior after the APPLOAD command is invoked will vary. The last thing you need to do is invoke the command into the command line. In AutoLISP, whenever you define a function using DEFUN, any name given to the function that prefixes with "c:" are the types of functions that you can call through the command line. In your example script, the function has been assigned the name "c:test". This means that, once you've loaded your LISP routine, you can begin by invoking "TEST" from the command line to execute the function. Whether the command is successful or not is a different story. Here's a more detailed explanation in this link. Thank you, that's a great resource! Quote
BIGAL Posted October 14, 2022 Posted October 14, 2022 Another is drag and drop a lisp from explorer. But I would recommend if your serious look at a custom pop menu with all your lisps in it and load when required. Quote
Jonathan Handojo Posted October 14, 2022 Posted October 14, 2022 36 minutes ago, BIGAL said: Another is drag and drop a lisp from explorer. But I would recommend if your serious look at a custom pop menu with all your lisps in it and load when required. How did you do this? I think I'd like to find out and implement it to my workplace. I know a thing or two about using the CUI to make custom ribbons that invokes LISP commands and overriding keyboard shortcuts to the one I want to use, but what's this one? Quote
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.