CivilTechSource Posted January 20 Posted January 20 Hi All, just wanted to thank everyone again for helping me so far in my lisp journey! As a token, I worked on a VS Code extension for AutoCAD snippets. This so it can allow users to type in quickly common functions the use all the time (e.g. search layer if dont exist create layer and so on). So far I have added the comment section. Happy to receive feedback and suggestions. Thank you https://marketplace.visualstudio.com/items?itemName=CivilTechSource.autocad-lisp-snippets 1 Quote
BIGAL Posted January 20 Posted January 20 (edited) @CivilTechSource Like you, It is a good idea to have a library of functions that you use all the time, in my Excel lisp there are 41 defuns so just copy and paste the ones I want to use, same with my Multi lisps for dcl's. often set them to write a dcl and then convert that file to dcl lisp code, like 3 lines of code to make a dcl. I have a VLAX lsp open all the time in my Notepad++ so again copy paste a function. I have a lot of lisp's saved as a function name eg Sort.lsp has various sort methods in it. I use windows "Findstr" a lot in a bat file so can look through an entire lisp directory for a keyword, identifies lisp files with that key word and copy and paste what I want out of existing code. You can in a lisp load an entire other lisp program and continue and use functions in that new lisp, I mention it as you could have little tiny lisp's like your "make layer.lsp" and just load when required. eg (if (not ah:butts)(load "Multi radio Buttons.lsp")) so you could have a few load lisp's at start of code saving lots of copying and pasting. Interested what others do. Edited January 20 by BIGAL Quote
CivilTechSource Posted January 20 Author Posted January 20 @BIGAL this is exactly what I want to achieve! I want to make it more accessible to people to learn how to write lisps. My plan is to start with basic functions, like getpoint and getdistance, if statements, prompts and so on. If you have suggestions on what more I can add please feel free. Quote
Steven P Posted January 20 Posted January 20 I have some snippets saved away in different files - open, copy and paste as I need them. Others I have some files with many functions, such as text where I'll save the common functions and refer to them. For example a simple text selection (entsel, check it is text, message if not and reselect, return the text) or an entmod to update a text string... all in the same file but referenced by many functions in it. However I keep meaning to save away little functions to answer questions on the forum that get asked time and time again such as PDF plotting and batch LISPs 1 Quote
BIGAL Posted January 20 Posted January 20 Another very useful is "Entmake functions.lsp", it has various entmake functions in it. Maybe make a word doc etc of your functions describing what they do. We had a "how to directory" with lots of help files. Was thinking about doing macros in Notepad++ run ents, run ss, ssl for layer, ssi for insert and so on. This is a common one. (repeat (setq x (sslength ss)) (setq obj (vlax-ename->vla-object (ssname ss (setq x (- x 1))))) ) Posted this before. Lisp files Apr 2024.docx 1 Quote
CivilTechSource Posted 1 hour ago Author Posted 1 hour ago My intention was to make lisp more accessible by having some functions already set up and allow user to play with it. Since its open source - I am hoping people with contribute but I am slightly doubtful if people will be encourage to contribute since github is not a thing civil engineers are used to. 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.