Jump to content

Recommended Posts

Posted

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

  • Like 1
Posted (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. 

 

image.png.c9d9e7212dd06fd03ed02a2aa15ce1e0.png

 

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 by BIGAL
Posted

@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.

Posted

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

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...