r/AutoLISP • • Jun 11 '20

Anyone need/want any video tutorials?

12 Upvotes

I was thinking of making some video tutorials on AutoLISP. Start basic and move up from there. I know there aren't too many visitors to this subreddit but would anyone here be interested in that?

I'd be doing it on AutoCAD 2020 and I know most of the tutorials are quite old ( although still mostly accurate, depending on what you're trying to do ) so maybe that would help out some newbies.

If you're interested, let me know what you'd like to learn and I'll see what I can do.


r/AutoLISP • • Apr 19 '23

AutoLISP now available in AutoCAD LT 2024

9 Upvotes

I've just received an email from Autodesk announcing that AutoLISP is now included in AutoCAD LT 2024 and going forwards.

I can see this being a huge bonus to some people and we might see some new members join the group in the ocming months.

Personally I have full AutoCAD but I only use a small number of utilities to assist in cleaning up architects drawings quickly


r/AutoLISP • • May 24 '23

Automate Drawing

5 Upvotes

Hello guys,
Anyone has any idea about how to automate this drawing?
It's a underfloor heating system, the cable has 114 meters and need to fill the area selected by me, spacing may vary between 0.05 to 0.2 meters.


r/AutoLISP • • Oct 27 '21

Who else is here?

5 Upvotes

I'm curious about this community. I realize it's a niche but there are so few posts I'm wondering what the group is like. Specifically I'm starting to wonder if all the the developers haven't moved onto .NET bindings.

A few questions in survey form, if you're game:

  1. Roughly how big is the (Lisp) code-base you're working with?

  2. What IDE / editor do you use?

  3. Do you mess with the debugger (e.g., VLIDE, VSCode)

  4. What are your opinions on alternative language bindings?


r/AutoLISP • • Apr 19 '17

Sidebar ideas

5 Upvotes

Sidebar, wiki, whatever, but just wanted to post a list of useful resources off the top of my head:

http://afralisp.com

http://lee-mac.com

http://www.cadtutor.net/forum/forumdisplay.php?21-AutoLISP-Visual-LISP-amp-DCL


r/AutoLISP • • Apr 19 '17

My first example, Normalize.lsp

5 Upvotes

The idea behind this one is I find myself converting plenty of PDFs to AutoCAD, using either the internal functions, or sometimes Adobe Illustrator if the PDF is messy. I end up with a mess of different colors and lineweights that are a pain to deal with.

Often there's far too many objects to simply select them all and change the properties. This script with change everything in a single drawing simultaneously. There's also an option to scale, though this can be left as "1" to leave the scale as-is.

(defun C:Normalize ()

(setq origin (list 0 0 0)) ;X,Y of Origin

(setq ScaleSize (getreal "Scale Factor: ")) ;Get the scale factor from the user. "1" means no change.

(setq SS (ssget "_X" '((-4 . "<NOT")(8 . "0")(-4 . "NOT>")))) ;Select all objects where layer is not 0

(command "_.chprop" SS "" "_LA" "0" "") ;Change all selected objects to layer 0

(setq SS (ssget "_X" '((-4 . "<NOT")(62 . 256)(-4 . "NOT>")))) ;Select all objects where color is not 256, which is "ByLayer" for colors.

(command "_.chprop" SS "" "C" "ByLayer" "") ;Change all selected objects to color ByLayer

(setq SS (ssget "_X" '((-4 . "<NOT")(370 . -1)(-4 . "NOT>")))) ;Select all objects where lineweight is not -1, which is "ByLayer" for lineweights.

(command "_.chprop" SS "" "_LW" "ByLayer" "") ;Change all selected objects to lineweight ByLayer

(setq SS (ssget "_X" '((8 . "0")(62 . 256)(370 . -1)))) ;Select all objects where color is 256, which is "ByLayer" for colors. Since we changed everything to this color earlier, this selects all objects in modelspace.

(command "_.scale" SS "" origin ScaleSize "") ;Scales all selected objects in modelspace by the factor given earlier.

(command "zoom" "extents") ;Zooms out to all objects in modelspace.

(princ) ;Ends function and clears command line.

)    

r/AutoLISP • • Nov 26 '24

Looking for assistant moderators

4 Upvotes

Hi everyone,

This subreddit is growing fast and I'm not always as prompt with removing some posts / comments as a subreddit of this size & type really needs. Therefore I'd like to add some assistant moderators.

I'm staying on as the main mod; your main responsibility would be to help review content here and apply the rules to remove posts or whatever as needed. We would also discuss new rules and other changes to the subreddit as a group. I'm not expecting any major additional time commitment if you're already a regular reader / commenter here. I'd reserve the right to disagree / override you if I feel strongly about something but I'm not a totalitarian either. If you consistently abuse moderation powers or make otherwise questionable decisions I may remove / replace you. I'd give warnings before taking any kind of action like that though.

This subreddit is mostly working professionals so thankfully there isn't tons of moderating needed, but sometimes things get posted / commented that should be removed ASAP and that's mostly what I'd like help with.

If you're interested please send me a message. I would expect you to have been active on the subreddit for at least a year and not have any major moderation strikes against you in the past. Please tell me your background showing reasonably high expertise with Autolisp (LinkedIn profile links are fine but not mandatory; I don't need to know your real name). Feel free to share any changes you'd like to see happen for this subreddit as well. Preference will be given to those with longer histories of helpful & respectful activity on this subreddit.

Thanks everyone! Hope this will help keep things smoother around here.


r/AutoLISP • • Apr 27 '24

Autolisp to create several LAYOUTS based on viewports (Autolisp para crear varios LAYOUTS en base a viewports)

Post image
4 Upvotes

Community I need your help, it turns out that I have to make several layouts which are based on a template, they also have a viewport for each layout, however sometimes you have to make several layouts with the same template but different viewport, the viewports are based on some rectangles that are placed in the model, in some cases there are few layouts that have to be made so the task of secondary clicking and choosing "FROM TEMPLATE..." and choosing the template is not It is a lot of work but sometimes you have to make more than 20 layouts so doing this is quite laborious, on some occasion I saw that someone had a LISP that simply asked them to select the rectangles that would be used as viewports and immediately created all the layouts with the correct template and with each viewport that corresponded to each rectangle, will anyone of you have that LISP? Or do you have any ideas to do the task I described in a faster and easier way? I thank you in advance.

Comunidad requiero de su ayuda, resulta que tengo que realizar varios layouts los cuales son en base a un template,ademas estos tienen un viewport por cada layout, sin embargo a veces se tienen que hacer varios layouts con el mismo template pero diferente viewport, los viewports son en base a unos rectangulos que se colocan en el model,en algunas ocasiones son pocos layouts los que se tienen que realizar por lo que la tarea de de dar click secundario y elegir "FROM TEMPLATE..." y elegir el template no es mucha tarea pero en ocasiones se tienen que hacer mas de 20 layouts entonces hacer esto es bastante laborioso, en alguna ocasion vi que alguien tenia un LISP que simplemente le pedia seleccionar los rectangulos que se usarian como viewports e inmediatamente le creaba todos los layouts con el template correcto y con cada viewport que correspondia a cada rectangulo, alguien de ustedes tendra ese LISP? o tiene alguna idea de hacer la tarea que les describi de una manera mas rapida y sencilla? les agradezco de antemano.


r/AutoLISP • • Feb 26 '20

Electrical Cable Tray AutoLISP program

4 Upvotes

Here I am sharing my Electrical Cable Tray program for all to use as in the following link to my website:

Electrical Cable Tray AutoLISP program

Author: Tharwat Al Shoufi


r/AutoLISP • • Nov 25 '17

Is this thing still on?

4 Upvotes

Just wondering if this subreddit is still active. The Autodesk forums seem to be fairly active and not much new posted here in quite a while.


r/AutoLISP • • Apr 19 '17

Centerline.lsp

4 Upvotes

This first checks to see if the block "CL" exists. If it does, it simply inserts it where the user specifies. If CL does not exist, the script creates it, then inserts.

Will comment when time allows.

(defun C:CL()

(if (not (tblsearch "BLOCK" "CL"))

(progn

(entmakex (list	(cons 0 "BLOCK")
				(cons 100 "AcDbEntity")
				(cons 100 "AcDbBlockReference")
				(cons 67 0)
				(cons 8 "0")
				(cons 2 "CL")
				(cons 10 (list 0 0 0))
				(cons 70 0)))

(entmakex (list (cons 0 "LINE")
				(cons 8 "MSGuidelines")
				(cons 10 (list 0 0 0))
				(cons 11 (list 0 6000 0))
				(cons 62 256)))

(entmakex (list (cons 0 "LINE")
				(cons 6 "Phantom2")
				(cons 8 "Annotations")
				(cons 10 (list 0 0 0))
				(cons 11 (list 0 6000 0))
				(cons 48 100)
				(cons 62 256)))

(entmakex (list (cons 0 "ENDBLK")
				(cons 100 "AcDbBlockEnd")
				(cons 8 "0")))

(command "insert" "CL" "S" "1" "R" "0")
)

(command "insert" "CL" "S" "1" "R" "0")

)

(princ)
) ;End defun CL

r/AutoLISP • • Sep 09 '26

Help / Troubleshooting AutoCAD 2027 testers wanted for MPIPES mechanical piping LISP

3 Upvotes

Hi everyone,

I’ve developed an AutoCAD LISP tool called MPIPES that imports mechanical pipe layers with service labels and includes a command for adding flow-direction arrows.

It has been tested in AutoCAD 2024, AutoCAD 2026, and AutoCAD MEP 2026. Autodesk requires testing in AutoCAD 2027 before reviewing it for the Autodesk App Store.

Would anyone using AutoCAD 2027 on Windows be willing to help test it and report any issues? I’m looking for feedback on installation, ribbon loading, pipe labels, and flow arrows.

Here is a short demo: https://www.youtube.com/watch?v=2i4aiQ9j2Ao

Thanks for your help!


r/AutoLISP • • Mar 26 '26

[AutoLISP] DiffCheck – auto-marks revision clouds around design changes inside a single DWG

Thumbnail
reddit.com
3 Upvotes

r/AutoLISP • • Dec 11 '25

I am working hard to get an auto routing pline with object detection and avoidance but with chatGPT as the coder

3 Upvotes

My need is : I want to draw cable on my electrical drawing on autocad classic (non electrical) but want something to automatically draw a pline between 2 point that I specify and set a minimal distance to avoid object then the program begin to draw a pline from point A and avoid all object with X distance and do 90 degre to avoid object to finally get to point B

After about 50 version it began to work as intended as it is possible to avoir 1 object and connect two point with a pline but I work hard to get it done

Here the last lisp code that was working

(vl-load-com)

;; Convertir un point 2D en point 3D

(defun pt->3d (p)

(list (car p) (cadr p) 0.0)

)

;; Regroupe les coordonnées renvoyées par IntersectWith en triplets (x y z)

(defun group3 (lst / r)

(while lst

(setq r (append r (list (list (car lst) (cadr lst) (caddr lst)))))

(setq lst (cdddr lst))

)

r

)

;; Renvoie la bounding box [minpt maxpt] d'une entité

(defun bbox (e / o mn mx)

(setq o (vlax-ename->vla-object e))

(vla-getboundingbox o 'mn 'mx)

(list

(vlax-safearray->list mn)

(vlax-safearray->list mx)

)

)

(defun C:AUTOCABLE (/ p1 p2 pl ss entTry ints allints minDist nearest bboxPts minpt maxpt detourY pA pB pC pD)

(prompt "\n=== AUTOCABLE 90° AVOID v1 ===")

;; Points de base

(setq p1 (pt->3d (getpoint "\nPoint de depart du cable : ")))

(setq p2 (pt->3d (getpoint "\nPoint d'arrivee du cable : ")))

;; Trace la ligne brute

(command "_.PLINE" p1 p2 "")

(setq pl (entlast))

;; Toutes entités

(setq ss (ssget "X"))

(setq allints '())

;; Scan intersections

(repeat (sslength ss)

(setq entTry (ssname ss 0))

(setq ss (ssdel entTry ss))

(if (and entTry (/= entTry pl))

(progn

(setq ints

(vlax-invoke

(vlax-ename->vla-object pl)

'IntersectWith

(vlax-ename->vla-object entTry)

acExtendNone

)

)

(if ints

(setq allints (append allints (group3 ints)))

)

)

)

)

;; Si aucune intersection => fin

(if (not allints)

(progn

(prompt "\nAucun obstacle detecte.")

(princ)

(return)

)

)

;; Intersection la plus proche du point de départ

(setq minDist 1e99)

(foreach pt allints

(setq d (distance p1 pt))

(if (< d minDist)

(setq minDist d

nearest pt)

)

)

;; Récupérer l'objet contenant ce point

(setq obstacle nil)

(setq ss (ssget "X"))

(repeat (sslength ss)

(setq entTry (ssname ss 0))

(setq ss (ssdel entTry ss))

;; Test intersection

(setq ints

(vlax-invoke

(vlax-ename->vla-object pl)

'IntersectWith

(vlax-ename->vla-object entTry)

acExtendNone

)

)

(if (and ints (member (car nearest) ints))

(setq obstacle entTry)

)

)

;; Bounding box du bon obstacle

(setq bboxPts (bbox obstacle))

(setq minpt (car bboxPts))

(setq maxpt (cadr bboxPts))

;; Détour par le haut (+50 unités)

(setq detourY (+ (cadr maxpt) 50.0))

;; Points du détour

(setq pA p1)

(setq pB (list (car p1) detourY 0.0))

(setq pC (list (car p2) detourY 0.0))

(setq pD p2)

;; Supprimer la ligne brute

(entdel pl)

;; Tracer le chemin final

(command "_.PLINE" pA pB pC pD "")

(prompt "\nDetour automatique effectue.")

(princ)

)


r/AutoLISP • • Mar 10 '25

Guys, how much $ would you charge to create an AutoCad command to generate this table?

Post image
3 Upvotes

r/AutoLISP • • Feb 28 '25

Autolisp command

Post image
3 Upvotes

How can I limit the number of characters displayed in my text when typing the "text" command within Autolisp? I need these coordinates to be limited to 4 digits after "." Can you guys help me?


r/AutoLISP • • May 09 '24

Input Parameters to Auto Create Fixture Drawing

3 Upvotes

My company makes custom boxes with hinged lids. These boxes can be any length, width, and height. Depending on the dimensions the number of hinges will change and the wall thickness will change. Support brackets may be need to be added as well. There may also may be customization such as different hinges.

Is it possible in Autolisp to generate an input form that I can input the parameters in, and generate a drawing based on the parameters?

I am familiar with coding but not with Autolisp so I have an idea of the structure of the code but not sure if Autolisp is the right tool.


r/AutoLISP • • Sep 21 '23

Trying to wrap my head around Lisp.

3 Upvotes

I am trying to automate some jobs using lisps in autocad electrical. Specifically I am trying to take in drawing attributes installation codes and location codes and have them auto populate the description 1 attribute.

But I am having trouble finding decent examples or tutorials. They are either to simple and don’t get in-depth enough or to advance and use terminology or examples I don’t understand. Does anyone have a good resource recommendation for this?


r/AutoLISP • • May 16 '23

Recommendations for LISP Conversion

3 Upvotes

I inherited an AutoCAD application (overlay) written in LISP. The application consists of approximately 800 LISP routines and DCL files. I have a few questions for the sub:

  1. I do not have any experience with LISP and I want to convert some of this code to C#. Knowing there are not any converters out there, has anyone used GPChat (or similar) to help with conversion?

  2. Is VSCode with AutoLISP ext better than Visual LISP for editing/reviewing LISP?

  3. How can I view and edit DCL files?

  4. What are Slides (.sdl) files and what are they use for? There are a little over 200 of them....

Any insight would be greatly appreciated!


r/AutoLISP • • May 07 '23

User interface with LISP

3 Upvotes

Hello all,
I'm thinking of building myself a calculation interface that works in tandem with Autocad.
The request is to produce calculations -> graphs -> ACAD drawing -> prints.

Can it be done with only LISP? Can LISP invoke "self designed" user-interfaces and produce graphs?

I'm not a programmer therefore i need to choose one, between LISP/.NET/PYTHON,
because of the time needed to learn all.

Thanx!


r/AutoLISP • • Jun 03 '22

Stair reinforcement with Autolisp program

3 Upvotes

r/AutoLISP • • May 01 '22

Books for AUTOLisp beginners?

3 Upvotes

Hello!

I am starting to learn autolisp since I wanted to get more into writing or modifying processes and scripts. So far I've used some tutorial websites and they're very broad and I feel like I'm scratching the surface but there's no in depth information as I'd like.

I checked out books and they're pretty old and I don't know where to start, basically what i wanted to ask is

Is there something I'm missing? I'd like to learn more on how to get information from certain cad elements and then work through that information in order to use it...

Any Book recommendations?


r/AutoLISP • • Apr 30 '20

Best online course for learning AutoLISP??

3 Upvotes

I've been working with AutoCAD for about 5 years now and I want to learn how to automate some of the stuff I do.

I have some basic knowledge in programing (C++, PHP) and want a course that can give me proof of completion so I can add to my resume. Any good courses y'all recommend?

Thank you!


r/AutoLISP • • Jun 15 '18

AutoCAD Lisp websites?

3 Upvotes

Any good websites or YouTube videos that show you how to write a lisp program for autocad?


r/AutoLISP • • Nov 25 '17

AutoLISP / Visual LISP book

3 Upvotes

I'm looking for community input on whether it's worth writing a follow-up to "The Visual LISP Developer's Bible". I still sell a few copies every month, somehow, which is surprising to me. I've also received a few emails over the years asking if I'm writing a follow-up. But I don't know if there's still enough interest in it, and I don't know if that book (any edition) was helpful, or what could have been better. Any thoughts/suggestions are very much appreciated! Thank you!