Learn AutoLISP for AutoCAD productivity
What is AutoLISP?
AutoLISP is a programming language designed specifically for use with the full version of AutoCAD (i.e. it does not work with AutoCAD LT). AutoLISP is one of a number of Application Programming Interfaces (APIs) built into AutoCAD but it is probably the easiest to use and therefore the most productive for the beginner. If you'd like to learn how to use AutoLISP to improve productivity, you're in the right place.
AfraLISP will help you get to grips with AutoLISP as quickly and easily as possible using some great tutorials for beginners. But the site also contains many intermediate and advanced AutoLISP tutorials to take you much further than the basics. In addition, AfraLISP provides DCL Tutorials (Dialog Control Language), Visual LISP tutorials, VBA Tutorials and AutoCAD customization tutorials in case you'd like to take your AutoLISP and AutoCAD programming to the next level.
Beginners Start Here
Popularity: 45.8 visits/day | Last visit: 1 hour ago
Popularity: 32.8 visits/day | Last visit: 1 hour ago
Popularity: 23.3 visits/day | Last visit: 1 hour ago
Popularity: 18.8 visits/day | Last visit: 1 hour ago
Popularity: 20.5 visits/day | Last visit: 3 hours ago
Popularity: 56.9 visits/day | Last visit: <1 minute ago
Popularity: 4.6 visits/day | Last visit: 5 hours ago
Popularity: 6.8 visits/day | Last visit: 10 hours ago
Popularity: 11.2 visits/day | Last visit: 46 mins ago
Popularity: 7.1 visits/day | Last visit: 16 hours ago
Popularity: 9.8 visits/day | Last visit: 6 hours ago
Popularity: 4.4 visits/day | Last visit: 15 hours ago
Tip of the Day
These four lines will give you the extreme four values in a points list, where PointList is a list of 2D or 3D points (like a list of pline vertex points) :
(setq X1 (apply 'min (mapcar 'car PointList))) ; The smallest 'X' value (setq Y1 (apply 'min (mapcar 'cadr PointList))) ; The smallest 'Y' value (setq X2 (apply 'max (mapcar 'car PointList))) ; The largest 'X' value (setq Y2 (apply 'max (mapcar 'cadr PointList))) ; The largest 'Y' value
Then assemble like :
(setq LowerLeft (List X1 Y1)) (setq LowerRight (List X2 Y1)) (setq UpperRight (List X2 Y2)) (setq UpperLeft (List X1 Y2))
(setq CPWin (list (List X1 Y1) (list X2 Y1) (list X2 Y2) (list X1 Y2))) ;A list of 4 points, can be passed to a 'ssget' function
I use the trick in finding an extents boundary around the objects I am working with, or performing a zoom window around the work area.
Missed a Tip?
Did you miss yesterday's tip? Maybe you forgot to drop by or maybe you didn't visit over the weekend. If so, you can now see all the tips published during the past week.