{"id":10781,"date":"2020-09-22T07:00:00","date_gmt":"2020-09-22T14:00:00","guid":{"rendered":"https:\/\/www.autodesk.com/blogs\/autocad\/?p=10781"},"modified":"2020-10-20T10:40:18","modified_gmt":"2020-10-20T17:40:18","slug":"autolisp-to-automate-your-tasks-part-1-beginner","status":"publish","type":"post","link":"https:\/\/www.autodesk.com/blogs\/autocad\/autolisp-to-automate-your-tasks-part-1-beginner\/","title":{"rendered":"AutoLISP to Automate Your Tasks: Part 1 &#8211; Beginner"},"content":{"rendered":"\n<p>I\u2019ll admit it. I just love AutoLISP, and I consider it my \u201chome\u201d language.<\/p>\n\n\n\n<p>But I also understand that my love of the language isn\u2019t universal. You may not consider yourself a programmer, or it might just be intimidating. It really doesn\u2019t have to be, and even with just minimal knowledge, you can still accomplish a lot.<\/p>\n\n\n\n<p>This <a rel=\"noreferrer noopener\" href=\"https:\/\/www.autodesk.com/blogs\/autocad\/tag\/autolisp-to-automate-your-tasks\/\" target=\"_blank\">three-part series<\/a> will help you become aware of the kinds of things you can do with AutoLISP at three levels of expertise: Beginner, <a rel=\"noreferrer noopener\" href=\"https:\/\/www.autodesk.com/blogs\/autocad\/autolisp-to-automate-your-tasks-part-2-intermediate\/\" target=\"_blank\">Intermediate<\/a>, and <a href=\"https:\/\/www.autodesk.com/blogs\/autocad\/autolisp-to-automate-your-tasks-part-3-advanced\/\" target=\"_blank\" rel=\"noreferrer noopener\">Advanced<\/a>. Right now, we\u2019ll start at the very beginning.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" class=\"wp-block-heading\" id=\"what-a-beginner-should-know\">What a Beginner Should Know<\/h2>\n\n\n\n<p>I think it\u2019s important for any AutoLISP user to know what it is. LISP stands for <span style=\"text-decoration: underline\">LIS<\/span>t <span style=\"text-decoration: underline\">P<\/span>rocessing. That\u2019s your first clue. Everything in the language is a list in some form. You\u2019ll need to know about them, whether they\u2019re defined as a LIST, a CONS, a DOTTED PAIR, or an S-EXPRESSION (or just EXPRESSION for short).<\/p>\n\n\n\n<p>Of course, there are various data types you\u2019ll need to be familiar with. AutoLISP considers a LIST or a CONS as a data type. Others include STRINGS, REAL numbers, and INTEGERS.<\/p>\n\n\n\n<p><em><u>Note<\/u>: One of the reasons AutoLISP is so easy for non-programmers (people like us) is that you don\u2019t have to manage data types and memory allocation like other languages. There\u2019s no need to compile your code either. In fact, the interpreter is built into AutoCAD, so you can run expressions right from the Command Line.<\/em><\/p>\n\n\n\n<p>As for basic Terminology and Syntax, you should know that items within a list are ATOMS. The functions that AutoLISP uses are called\u2026FUNCTIONS\u2014that\u2019s easy! And FUNCTIONS sometimes require ARGUMENTS. Those are the ATOMS that follow the Function call in the expression.<\/p>\n\n\n\n<p>Syntax can be defined as the rules that any kind of language uses. The basic rules of AutoLISP are that everything is contained within a set of parentheses. Next, is that the function is always the first item (or ATOM) in a list.<\/p>\n\n\n\n<p>(functionName argument1 argument2 \u2026)<\/p>\n\n\n\n<p><em><u>Note<\/u>: It\u2019s important to note here that every Expression returns a value. That\u2019s an important point, as it sets AutoLISP apart from other languages that are considered \u201cProcedural\u201d languages. In the simplest terms, those languages execute a line of code, move on to the next, and so forth until complete. Without going into a dissertation on \u201cFunctional\u201d languages, just remember that while we may tend to use AutoLISP in a procedural manner within a CAD program, it is much more powerful than that.<\/em><\/p>\n\n\n\n<p>You should be aware that expressions can be nested, and that you evaluate them from the inside out.<\/p>\n\n\n\n<p>(functionName argument1 (functionName argument1 argument2) argument3 \u2026)<\/p>\n\n\n\n<p>A beginner should be aware of internal AutoLISP functions, especially DEFUN and SETQ. Others may include:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>AutoLISP specific functions: COMMAND, GETVAR, SETVAR<\/li><li>AutoLISP specific \u201cGET\u2026\u201d functions: GETSTRING, GETREAL, etc.<\/li><li>Basic list manipulation functions: LIST, CONS, CAR, CDR, NTH<\/li><li>Basic conditional functions: IF, COND<\/li><li>Equality functions: = \/= &lt; &gt; EQ EQUAL<\/li><li>Math Functions: + &#8211; \/ etc.<\/li><\/ul>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"642\" src=\"https:\/\/www.autodesk.com/blogs\/autocad\/wp-content\/uploads\/sites\/35\/2020\/09\/AutoCAD-AutoLISP-1024x642.jpeg\" alt=\"AutoCAD AutoLISP beginner\" class=\"wp-image-10782\" srcset=\"https:\/\/www.autodesk.com/blogs\/autocad\/wp-content\/uploads\/sites\/35\/2020\/09\/AutoCAD-AutoLISP-1024x642.jpeg 1024w, https:\/\/www.autodesk.com/blogs\/autocad\/wp-content\/uploads\/sites\/35\/2020\/09\/AutoCAD-AutoLISP-300x188.jpeg 300w, https:\/\/www.autodesk.com/blogs\/autocad\/wp-content\/uploads\/sites\/35\/2020\/09\/AutoCAD-AutoLISP-768x481.jpeg 768w, https:\/\/www.autodesk.com/blogs\/autocad\/wp-content\/uploads\/sites\/35\/2020\/09\/AutoCAD-AutoLISP-1536x963.jpeg 1536w, https:\/\/www.autodesk.com/blogs\/autocad\/wp-content\/uploads\/sites\/35\/2020\/09\/AutoCAD-AutoLISP-2048x1284.jpeg 2048w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>What else should a beginner know? You should know how to load external AutoLISP files (LOAD, APPLOAD, Drag and Drop), and how to identify the Function name needed to run them at the Command Line.<\/p>\n\n\n\n<p>Finally, you should know how to get help. Whether via AutoCAD\u2019s own <a rel=\"noreferrer noopener\" href=\"http:\/\/help.autodesk.com\/view\/ACD\/2021\/ENU\/?guid=GUID-16DC15FC-5329-492E-B66A-401D49CF971F\" target=\"_blank\">Help<\/a> system or various sites and <a href=\"https:\/\/forums.augi.com\/forumdisplay.php?91-AutoLISP\" target=\"_blank\" rel=\"noreferrer noopener\">forums<\/a> on the internet and <a href=\"https:\/\/forums.autodesk.com\/t5\/visual-lisp-autolisp-and-general\/bd-p\/130\" target=\"_blank\" rel=\"noreferrer noopener\">Autodesk Knowledge Network<\/a>, don\u2019t hesitate to reach out. There\u2019s some 35 years of experience and code out there, and someone is always willing to help.<\/p>\n\n\n\n<p>That may appear to be a lot of stuff to know, but a little goes a long way with AutoLISP. Which leads us to the next section\u2026<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" class=\"wp-block-heading\" id=\"ways-a-beginner-can-use-autolisp-to-automate-tasks\">Ways a Beginner Can Use AutoLISP To Automate Tasks  <\/h2>\n\n\n\n<p>With just a basic level of AutoLISP knowledge, you should be able to do the following things.<\/p>\n\n\n\n<p>Control your AutoCAD environment. Make sure your OSNAP settings are always set the way you like them by using (setvar \u201cOSMODE\u201d 679). 679 equates to the <a rel=\"noreferrer noopener\" href=\"https:\/\/knowledge.autodesk.com\/support\/autocad\/learn-explore\/caas\/CloudHelp\/cloudhelp\/2021\/ENU\/AutoCAD-Core\/files\/GUID-DD9B3216-A533-4D47-95D8-7585F738FD75-htm.html\" target=\"_blank\">running osnaps<\/a> I like. Not sure what your favorites add up to? Use (getvar \u201cOSMODE\u201d). No longer do you need to open the Object Snap dialog and check and uncheck boxes. You\u2019ve just automated it! Almost any environment variable you can think of can be set this way.<\/p>\n\n\n\n<p>You can create your own keyboard short commands. You probably are aware of the limitations of the Command Aliases found in the <a href=\"https:\/\/knowledge.autodesk.com\/support\/autocad-lt\/learn-explore\/caas\/CloudHelp\/cloudhelp\/2020\/ENU\/AutoCAD-LT\/files\/GUID-D4CACED6-DFBA-43C3-BC42-8D980AB3AE75-htm.html\" target=\"_blank\" rel=\"noreferrer noopener\">ACAD.pgp<\/a> file. You can alias the command name, but you can\u2019t include any options.<\/p>\n\n\n\n<p>For example, Z is for Zoom. But you still have to enter E to get Extents. With just a little AutoLISP knowledge a beginner should be able write their own custom ZE command:<\/p>\n\n\n\n<p>(defun c:ze ()<br>(command &#8220;zoom&#8221; &#8220;e&#8221;)<br>(princ)<br>)<\/p>\n\n\n\n<p>Do you find yourself using Move Previous often? Automate it!<\/p>\n\n\n\n<p>(defun c:mp ()<br>(command &#8220;move&#8221; &#8220;p&#8221;)<br>(princ)<br>)<\/p>\n\n\n\n<p>We\u2019re always talking about keeping your <a rel=\"noreferrer noopener\" href=\"https:\/\/www.autodesk.com/blogs\/autocad\/three-quick-ways-to-clean-up-an-autocad-drawing-tuesday-tips-with-brandon\/\" target=\"_blank\">drawings clean<\/a>. <a href=\"https:\/\/knowledge.autodesk.com\/support\/autocad\/learn-explore\/caas\/CloudHelp\/cloudhelp\/2020\/ENU\/AutoCAD-Core\/files\/GUID-D68BA47B-A79D-4F58-9715-0569CC24BCEF-htm.html\" target=\"_blank\" rel=\"noreferrer noopener\">Purge<\/a> and <a rel=\"noreferrer noopener\" href=\"https:\/\/knowledge.autodesk.com\/support\/autocad\/learn-explore\/caas\/CloudHelp\/cloudhelp\/2021\/ENU\/AutoCAD-Core\/files\/GUID-62DDB935-61B1-49DA-8238-3EF1CC45259B-htm.html?st=audit\" target=\"_blank\">Audit<\/a>, we tell you. Get rid of unused <a rel=\"noreferrer noopener\" href=\"https:\/\/knowledge.autodesk.com\/support\/autocad\/learn-explore\/caas\/simplecontent\/content\/improving-autocad-performance-scalelists-regapps.html?st=regapps\" target=\"_blank\">REGAPPS<\/a>, and also run <a rel=\"noreferrer noopener\" href=\"https:\/\/knowledge.autodesk.com\/support\/autocad\/learn-explore\/caas\/CloudHelp\/cloudhelp\/2021\/ENU\/AutoCAD-Core\/files\/GUID-0916FE53-F816-4C40-AA5E-5E8CBFD7F73F-htm.html?st=overkill\" target=\"_blank\">Overkill<\/a>. Why not use your new AutoLISP knowledge to automate this sequence? You should have all the tools you need to write something like the following:<\/p>\n\n\n\n<p>(defun c:cleaner ()<br>(command &#8220;audit&#8221; &#8220;Y&#8221;)<br>(command &#8220;-purge&#8221; &#8220;a&#8221; &#8220;<em>&#8221; &#8220;n&#8221;) (command &#8220;-purge&#8221; &#8220;r&#8221; &#8220;<\/em>&#8221; &#8220;n&#8221;)<br>(command &#8220;-overkill&#8221; &#8220;all&#8221; &#8220;&#8221; &#8220;&#8221;)<br>(princ)<br>)<\/p>\n\n\n\n<p><em><u>Note<\/u>: Two things from the above code. The call to (princ) at the end suppresses the functions returned value of nil on the command line. Also, the dash in front of the Purge and Overkill command calls suppresses the command\u2019s dialog box and uses the command line version instead. Lots of other commands do this. Experiment\u2026make or set your layers with -Layer. Just follow the prompts on the command line, and you\u2019re on your way.<\/em><\/p>\n\n\n\n<p>The last two examples make new commands. SSA sets the <a href=\"https:\/\/knowledge.autodesk.com\/support\/autocad\/learn-explore\/caas\/CloudHelp\/cloudhelp\/2021\/ENU\/AutoCAD-Core\/files\/GUID-7C4EAEAE-3738-4E51-AC9B-B16B5A2CDB3B-htm.html?st=snapang\" target=\"_blank\" rel=\"noreferrer noopener\">SNAPANG<\/a> variable based on a selected line. Below it, SS0 resets it to zero. On the right, TOGGLEDITOR changes <a href=\"https:\/\/knowledge.autodesk.com\/support\/autocad\/learn-explore\/caas\/CloudHelp\/cloudhelp\/2021\/ENU\/AutoCAD-Core\/files\/GUID-C7CF957C-3A44-4667-8ABE-22CAFDF99145-htm.html?st=mtexted\" target=\"_blank\" rel=\"noreferrer noopener\">MTEXTED<\/a> from the internal editor to Notepad, and back again.<\/p>\n\n\n\n<p>I presented these as an image to force you to type them, should you want. Copy and paste is handy, but you have to be able to type them as well. Also, don\u2019t use MS Word, as it adds special formatting. Notepad works fine.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"388\" src=\"https:\/\/www.autodesk.com/blogs\/autocad\/wp-content\/uploads\/sites\/35\/2020\/09\/UPDATED-Lisp-Beginners_1-1024x388.png\" alt=\"AutoCAD AutoLISP in Notepad\" class=\"wp-image-10785\" srcset=\"https:\/\/www.autodesk.com/blogs\/autocad\/wp-content\/uploads\/sites\/35\/2020\/09\/UPDATED-Lisp-Beginners_1-1024x388.png 1024w, https:\/\/www.autodesk.com/blogs\/autocad\/wp-content\/uploads\/sites\/35\/2020\/09\/UPDATED-Lisp-Beginners_1-300x114.png 300w, https:\/\/www.autodesk.com/blogs\/autocad\/wp-content\/uploads\/sites\/35\/2020\/09\/UPDATED-Lisp-Beginners_1-768x291.png 768w, https:\/\/www.autodesk.com/blogs\/autocad\/wp-content\/uploads\/sites\/35\/2020\/09\/UPDATED-Lisp-Beginners_1.png 1072w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>Finally, an AutoLISP beginner should know how to add their custom command to their menu. Make your own <a rel=\"noreferrer noopener\" href=\"https:\/\/knowledge.autodesk.com\/support\/autocad\/learn-explore\/caas\/sfdcarticles\/sfdcarticles\/Adding-action-macros-to-toolbar-or-ribbon-tab.html?st=add%20ribbon%20tab\" target=\"_blank\">Ribbon tab and panel<\/a> or add it to an old-fashioned toolbar button for easy access.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" class=\"wp-block-heading\" id=\"final-thoughts\">Final Thoughts<\/h2>\n\n\n\n<p>In <a href=\"https:\/\/www.autodesk.com/blogs\/autocad\/autolisp-to-automate-your-tasks-part-2-intermediate\/\" target=\"_blank\" rel=\"noreferrer noopener\">part two<\/a> of our <a href=\"https:\/\/www.autodesk.com/blogs\/autocad\/tag\/autolisp-to-automate-your-tasks\/\" target=\"_blank\" rel=\"noreferrer noopener\">series<\/a>, I\u2019ll discuss some of the AutoLISP functionality you\u2019ll need to know to become what I would call an Intermediate level, and what kinds of things you can do with those skills.<\/p>\n\n\n\n<p>And finally, to quote my original AutoLISP <a rel=\"noreferrer noopener\" href=\"https:\/\/www.cadalyst.com\/cadalyst-author\/bill-kramer-55\" target=\"_blank\">mentor<\/a> from way back in the day, \u201cuntil next time, keep on programmin\u2019.\u201d<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I\u2019ll admit it. I just love AutoLISP, and I consider it my \u201chome\u201d language. But I also understand that my love of the language isn\u2019t universal. You may not consider yourself a programmer, or it might just be intimidating. It really doesn\u2019t have to be, and even with just minimal knowledge, you can still accomplish [&hellip;]<\/p>\n","protected":false},"author":329,"featured_media":10787,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"inline_featured_image":false,"footnotes":""},"categories":[893],"tags":[6961,386,7332,852,1018,501],"class_list":["post-10781","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-learning","tag-audit","tag-autolisp","tag-autolisp-to-automate-your-tasks","tag-mtext","tag-purge","tag-ribbon","dhig-theme--light"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v27.3 (Yoast SEO v27.3) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>AutoLISP to Automate Your Tasks: Part 1 - Beginner | AutoCAD Blog | Autodesk<\/title>\n<meta name=\"description\" content=\"Learn the fundamentals of AutoCAD AutoLISP and how to immediately start automating tasks to save time with code examples.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.autodesk.com/blogs\/autocad\/autolisp-to-automate-your-tasks-part-1-beginner\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"AutoLISP to Automate Your Tasks: Part 1 - Beginner\" \/>\n<meta property=\"og:description\" content=\"Learn the fundamentals of AutoCAD AutoLISP and how to immediately start automating tasks to save time with code examples.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.autodesk.com/blogs\/autocad\/autolisp-to-automate-your-tasks-part-1-beginner\/\" \/>\n<meta property=\"og:site_name\" content=\"AutoCAD Blog\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/autocad\" \/>\n<meta property=\"article:published_time\" content=\"2020-09-22T14:00:00+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2020-10-20T17:40:18+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/i0.wp.com\/blogs.autodesk.com\/autocad\/wp-content\/uploads\/sites\/35\/2020\/09\/AutoCAD-AutoLISP-Beginner-Feature-1536x830-1-scaled.jpg?fit=2560%2C1399&ssl=1\" \/>\n\t<meta property=\"og:image:width\" content=\"2560\" \/>\n\t<meta property=\"og:image:height\" content=\"1399\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Frank Mayfield\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@heathercs3ez\" \/>\n<meta name=\"twitter:site\" content=\"@autocad\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Frank Mayfield\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"6 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.autodesk.com/blogs\\\/autocad\\\/autolisp-to-automate-your-tasks-part-1-beginner\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.autodesk.com/blogs\\\/autocad\\\/autolisp-to-automate-your-tasks-part-1-beginner\\\/\"},\"author\":{\"name\":\"Frank Mayfield\",\"@id\":\"https:\\\/\\\/www.autodesk.com/blogs\\\/autocad\\\/#\\\/schema\\\/person\\\/fbfe7079a52f7aa618a72c29f6398de6\"},\"headline\":\"AutoLISP to Automate Your Tasks: Part 1 &#8211; Beginner\",\"datePublished\":\"2020-09-22T14:00:00+00:00\",\"dateModified\":\"2020-10-20T17:40:18+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.autodesk.com/blogs\\\/autocad\\\/autolisp-to-automate-your-tasks-part-1-beginner\\\/\"},\"wordCount\":1140,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/www.autodesk.com/blogs\\\/autocad\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/www.autodesk.com/blogs\\\/autocad\\\/autolisp-to-automate-your-tasks-part-1-beginner\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.autodesk.com/blogs\\\/autocad\\\/wp-content\\\/uploads\\\/sites\\\/35\\\/2020\\\/09\\\/AutoCAD-AutoLISP-Beginner-Feature-1536x830-1-scaled.jpg\",\"keywords\":[\"Audit\",\"AutoLISP\",\"AutoLISP to Automate Your Tasks\",\"Mtext\",\"Purge\",\"Ribbon\"],\"articleSection\":[\"Learning\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.autodesk.com/blogs\\\/autocad\\\/autolisp-to-automate-your-tasks-part-1-beginner\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.autodesk.com/blogs\\\/autocad\\\/autolisp-to-automate-your-tasks-part-1-beginner\\\/\",\"url\":\"https:\\\/\\\/www.autodesk.com/blogs\\\/autocad\\\/autolisp-to-automate-your-tasks-part-1-beginner\\\/\",\"name\":\"AutoLISP to Automate Your Tasks: Part 1 - Beginner | AutoCAD Blog | Autodesk\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.autodesk.com/blogs\\\/autocad\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.autodesk.com/blogs\\\/autocad\\\/autolisp-to-automate-your-tasks-part-1-beginner\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.autodesk.com/blogs\\\/autocad\\\/autolisp-to-automate-your-tasks-part-1-beginner\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.autodesk.com/blogs\\\/autocad\\\/wp-content\\\/uploads\\\/sites\\\/35\\\/2020\\\/09\\\/AutoCAD-AutoLISP-Beginner-Feature-1536x830-1-scaled.jpg\",\"datePublished\":\"2020-09-22T14:00:00+00:00\",\"dateModified\":\"2020-10-20T17:40:18+00:00\",\"description\":\"Learn the fundamentals of AutoCAD AutoLISP and how to immediately start automating tasks to save time with code examples.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.autodesk.com/blogs\\\/autocad\\\/autolisp-to-automate-your-tasks-part-1-beginner\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.autodesk.com/blogs\\\/autocad\\\/autolisp-to-automate-your-tasks-part-1-beginner\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.autodesk.com/blogs\\\/autocad\\\/autolisp-to-automate-your-tasks-part-1-beginner\\\/#primaryimage\",\"url\":\"https:\\\/\\\/www.autodesk.com/blogs\\\/autocad\\\/wp-content\\\/uploads\\\/sites\\\/35\\\/2020\\\/09\\\/AutoCAD-AutoLISP-Beginner-Feature-1536x830-1-scaled.jpg\",\"contentUrl\":\"https:\\\/\\\/www.autodesk.com/blogs\\\/autocad\\\/wp-content\\\/uploads\\\/sites\\\/35\\\/2020\\\/09\\\/AutoCAD-AutoLISP-Beginner-Feature-1536x830-1-scaled.jpg\",\"width\":2560,\"height\":1399,\"caption\":\"Electric passenger train drives at high speed among urban landscape\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.autodesk.com/blogs\\\/autocad\\\/autolisp-to-automate-your-tasks-part-1-beginner\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u30db\u30fc\u30e0\",\"item\":\"https:\\\/\\\/www.autodesk.com/blogs\\\/autocad\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Learning\",\"item\":\"https:\\\/\\\/www.autodesk.com/blogs\\\/autocad\\\/learning\\\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"AutoLISP to Automate Your Tasks: Part 1 &#8211; Beginner\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.autodesk.com/blogs\\\/autocad\\\/#website\",\"url\":\"https:\\\/\\\/www.autodesk.com/blogs\\\/autocad\\\/\",\"name\":\"AutoCAD Blog\",\"description\":\"Your home for all things AutoCAD\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.autodesk.com/blogs\\\/autocad\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.autodesk.com/blogs\\\/autocad\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.autodesk.com/blogs\\\/autocad\\\/#organization\",\"name\":\"Autodesk, Inc.\",\"url\":\"https:\\\/\\\/www.autodesk.com/blogs\\\/autocad\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.autodesk.com/blogs\\\/autocad\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/www.autodesk.com/blogs\\\/autocad\\\/wp-content\\\/uploads\\\/sites\\\/35\\\/2022\\\/06\\\/16\\\/autodesk-autocad-small_social-400.png\",\"contentUrl\":\"https:\\\/\\\/www.autodesk.com/blogs\\\/autocad\\\/wp-content\\\/uploads\\\/sites\\\/35\\\/2022\\\/06\\\/16\\\/autodesk-autocad-small_social-400.png\",\"width\":400,\"height\":400,\"caption\":\"Autodesk, Inc.\"},\"image\":{\"@id\":\"https:\\\/\\\/www.autodesk.com/blogs\\\/autocad\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/autocad\",\"https:\\\/\\\/x.com\\\/autocad\"]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.autodesk.com/blogs\\\/autocad\\\/#\\\/schema\\\/person\\\/fbfe7079a52f7aa618a72c29f6398de6\",\"name\":\"Frank Mayfield\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.autodesk.com/blogs\\\/autocad\\\/wp-content\\\/uploads\\\/sites\\\/35\\\/2020\\\/04\\\/frank-Headshot-Brick-Cropped_vfbt8t-150x150.png\",\"url\":\"https:\\\/\\\/www.autodesk.com/blogs\\\/autocad\\\/wp-content\\\/uploads\\\/sites\\\/35\\\/2020\\\/04\\\/frank-Headshot-Brick-Cropped_vfbt8t-150x150.png\",\"contentUrl\":\"https:\\\/\\\/www.autodesk.com/blogs\\\/autocad\\\/wp-content\\\/uploads\\\/sites\\\/35\\\/2020\\\/04\\\/frank-Headshot-Brick-Cropped_vfbt8t-150x150.png\",\"caption\":\"Frank Mayfield\"},\"description\":\"Frank has worked in various design and CAD Management roles with AutoCAD and Autodesk software since 1986 (v2.62). He is currently a Design Technology Consultant in Tulsa, OK. He also serves as Vice President on the AUGI Board of Directors and is a member of numerous Autodesk user panels. As a top-rated mentor for trial users of AutoCAD 2018 and AutoCAD LT 2018, he has provided live, real-time guidance and support for over 2,500 new users in more than 50 countries worldwide. He currently serves on the AUGI Board of Directors and is a member of numerous Autodesk user panels.\",\"sameAs\":[\"https:\\\/\\\/x.com\\\/heathercs3ez\"],\"url\":\"https:\\\/\\\/www.autodesk.com/blogs\\\/autocad\\\/author\\\/frankmayfield\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"AutoLISP to Automate Your Tasks: Part 1 - Beginner | AutoCAD Blog | Autodesk","description":"Learn the fundamentals of AutoCAD AutoLISP and how to immediately start automating tasks to save time with code examples.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.autodesk.com/blogs\/autocad\/autolisp-to-automate-your-tasks-part-1-beginner\/","og_locale":"en_US","og_type":"article","og_title":"AutoLISP to Automate Your Tasks: Part 1 - Beginner","og_description":"Learn the fundamentals of AutoCAD AutoLISP and how to immediately start automating tasks to save time with code examples.","og_url":"https:\/\/www.autodesk.com/blogs\/autocad\/autolisp-to-automate-your-tasks-part-1-beginner\/","og_site_name":"AutoCAD Blog","article_publisher":"https:\/\/www.facebook.com\/autocad","article_published_time":"2020-09-22T14:00:00+00:00","article_modified_time":"2020-10-20T17:40:18+00:00","og_image":[{"width":2560,"height":1399,"url":"https:\/\/i0.wp.com\/blogs.autodesk.com\/autocad\/wp-content\/uploads\/sites\/35\/2020\/09\/AutoCAD-AutoLISP-Beginner-Feature-1536x830-1-scaled.jpg?fit=2560%2C1399&ssl=1","type":"image\/jpeg"}],"author":"Frank Mayfield","twitter_card":"summary_large_image","twitter_creator":"@heathercs3ez","twitter_site":"@autocad","twitter_misc":{"Written by":"Frank Mayfield","Est. reading time":"6 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.autodesk.com/blogs\/autocad\/autolisp-to-automate-your-tasks-part-1-beginner\/#article","isPartOf":{"@id":"https:\/\/www.autodesk.com/blogs\/autocad\/autolisp-to-automate-your-tasks-part-1-beginner\/"},"author":{"name":"Frank Mayfield","@id":"https:\/\/www.autodesk.com/blogs\/autocad\/#\/schema\/person\/fbfe7079a52f7aa618a72c29f6398de6"},"headline":"AutoLISP to Automate Your Tasks: Part 1 &#8211; Beginner","datePublished":"2020-09-22T14:00:00+00:00","dateModified":"2020-10-20T17:40:18+00:00","mainEntityOfPage":{"@id":"https:\/\/www.autodesk.com/blogs\/autocad\/autolisp-to-automate-your-tasks-part-1-beginner\/"},"wordCount":1140,"commentCount":0,"publisher":{"@id":"https:\/\/www.autodesk.com/blogs\/autocad\/#organization"},"image":{"@id":"https:\/\/www.autodesk.com/blogs\/autocad\/autolisp-to-automate-your-tasks-part-1-beginner\/#primaryimage"},"thumbnailUrl":"https:\/\/www.autodesk.com/blogs\/autocad\/wp-content\/uploads\/sites\/35\/2020\/09\/AutoCAD-AutoLISP-Beginner-Feature-1536x830-1-scaled.jpg","keywords":["Audit","AutoLISP","AutoLISP to Automate Your Tasks","Mtext","Purge","Ribbon"],"articleSection":["Learning"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.autodesk.com/blogs\/autocad\/autolisp-to-automate-your-tasks-part-1-beginner\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.autodesk.com/blogs\/autocad\/autolisp-to-automate-your-tasks-part-1-beginner\/","url":"https:\/\/www.autodesk.com/blogs\/autocad\/autolisp-to-automate-your-tasks-part-1-beginner\/","name":"AutoLISP to Automate Your Tasks: Part 1 - Beginner | AutoCAD Blog | Autodesk","isPartOf":{"@id":"https:\/\/www.autodesk.com/blogs\/autocad\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.autodesk.com/blogs\/autocad\/autolisp-to-automate-your-tasks-part-1-beginner\/#primaryimage"},"image":{"@id":"https:\/\/www.autodesk.com/blogs\/autocad\/autolisp-to-automate-your-tasks-part-1-beginner\/#primaryimage"},"thumbnailUrl":"https:\/\/www.autodesk.com/blogs\/autocad\/wp-content\/uploads\/sites\/35\/2020\/09\/AutoCAD-AutoLISP-Beginner-Feature-1536x830-1-scaled.jpg","datePublished":"2020-09-22T14:00:00+00:00","dateModified":"2020-10-20T17:40:18+00:00","description":"Learn the fundamentals of AutoCAD AutoLISP and how to immediately start automating tasks to save time with code examples.","breadcrumb":{"@id":"https:\/\/www.autodesk.com/blogs\/autocad\/autolisp-to-automate-your-tasks-part-1-beginner\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.autodesk.com/blogs\/autocad\/autolisp-to-automate-your-tasks-part-1-beginner\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.autodesk.com/blogs\/autocad\/autolisp-to-automate-your-tasks-part-1-beginner\/#primaryimage","url":"https:\/\/www.autodesk.com/blogs\/autocad\/wp-content\/uploads\/sites\/35\/2020\/09\/AutoCAD-AutoLISP-Beginner-Feature-1536x830-1-scaled.jpg","contentUrl":"https:\/\/www.autodesk.com/blogs\/autocad\/wp-content\/uploads\/sites\/35\/2020\/09\/AutoCAD-AutoLISP-Beginner-Feature-1536x830-1-scaled.jpg","width":2560,"height":1399,"caption":"Electric passenger train drives at high speed among urban landscape"},{"@type":"BreadcrumbList","@id":"https:\/\/www.autodesk.com/blogs\/autocad\/autolisp-to-automate-your-tasks-part-1-beginner\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u30db\u30fc\u30e0","item":"https:\/\/www.autodesk.com/blogs\/autocad\/"},{"@type":"ListItem","position":2,"name":"Learning","item":"https:\/\/www.autodesk.com/blogs\/autocad\/learning\/"},{"@type":"ListItem","position":3,"name":"AutoLISP to Automate Your Tasks: Part 1 &#8211; Beginner"}]},{"@type":"WebSite","@id":"https:\/\/www.autodesk.com/blogs\/autocad\/#website","url":"https:\/\/www.autodesk.com/blogs\/autocad\/","name":"AutoCAD Blog","description":"Your home for all things AutoCAD","publisher":{"@id":"https:\/\/www.autodesk.com/blogs\/autocad\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.autodesk.com/blogs\/autocad\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.autodesk.com/blogs\/autocad\/#organization","name":"Autodesk, Inc.","url":"https:\/\/www.autodesk.com/blogs\/autocad\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.autodesk.com/blogs\/autocad\/#\/schema\/logo\/image\/","url":"https:\/\/www.autodesk.com/blogs\/autocad\/wp-content\/uploads\/sites\/35\/2022\/06\/16\/autodesk-autocad-small_social-400.png","contentUrl":"https:\/\/www.autodesk.com/blogs\/autocad\/wp-content\/uploads\/sites\/35\/2022\/06\/16\/autodesk-autocad-small_social-400.png","width":400,"height":400,"caption":"Autodesk, Inc."},"image":{"@id":"https:\/\/www.autodesk.com/blogs\/autocad\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/autocad","https:\/\/x.com\/autocad"]},{"@type":"Person","@id":"https:\/\/www.autodesk.com/blogs\/autocad\/#\/schema\/person\/fbfe7079a52f7aa618a72c29f6398de6","name":"Frank Mayfield","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.autodesk.com/blogs\/autocad\/wp-content\/uploads\/sites\/35\/2020\/04\/frank-Headshot-Brick-Cropped_vfbt8t-150x150.png","url":"https:\/\/www.autodesk.com/blogs\/autocad\/wp-content\/uploads\/sites\/35\/2020\/04\/frank-Headshot-Brick-Cropped_vfbt8t-150x150.png","contentUrl":"https:\/\/www.autodesk.com/blogs\/autocad\/wp-content\/uploads\/sites\/35\/2020\/04\/frank-Headshot-Brick-Cropped_vfbt8t-150x150.png","caption":"Frank Mayfield"},"description":"Frank has worked in various design and CAD Management roles with AutoCAD and Autodesk software since 1986 (v2.62). He is currently a Design Technology Consultant in Tulsa, OK. He also serves as Vice President on the AUGI Board of Directors and is a member of numerous Autodesk user panels. As a top-rated mentor for trial users of AutoCAD 2018 and AutoCAD LT 2018, he has provided live, real-time guidance and support for over 2,500 new users in more than 50 countries worldwide. He currently serves on the AUGI Board of Directors and is a member of numerous Autodesk user panels.","sameAs":["https:\/\/x.com\/heathercs3ez"],"url":"https:\/\/www.autodesk.com/blogs\/autocad\/author\/frankmayfield\/"}]}},"_links":{"self":[{"href":"https:\/\/www.autodesk.com/blogs\/autocad\/wp-json\/wp\/v2\/posts\/10781","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.autodesk.com/blogs\/autocad\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.autodesk.com/blogs\/autocad\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.autodesk.com/blogs\/autocad\/wp-json\/wp\/v2\/users\/329"}],"replies":[{"embeddable":true,"href":"https:\/\/www.autodesk.com/blogs\/autocad\/wp-json\/wp\/v2\/comments?post=10781"}],"version-history":[{"count":0,"href":"https:\/\/www.autodesk.com/blogs\/autocad\/wp-json\/wp\/v2\/posts\/10781\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.autodesk.com/blogs\/autocad\/wp-json\/wp\/v2\/media\/10787"}],"wp:attachment":[{"href":"https:\/\/www.autodesk.com/blogs\/autocad\/wp-json\/wp\/v2\/media?parent=10781"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.autodesk.com/blogs\/autocad\/wp-json\/wp\/v2\/categories?post=10781"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.autodesk.com/blogs\/autocad\/wp-json\/wp\/v2\/tags?post=10781"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}