{"id":10817,"date":"2020-10-06T07:00:00","date_gmt":"2020-10-06T14:00:00","guid":{"rendered":"https:\/\/www.autodesk.com/blogs\/autocad\/?p=10817"},"modified":"2021-12-07T13:09:46","modified_gmt":"2021-12-07T21:09:46","slug":"autolisp-to-automate-your-tasks-part-2-intermediate","status":"publish","type":"post","link":"https:\/\/www.autodesk.com/blogs\/autocad\/autolisp-to-automate-your-tasks-part-2-intermediate\/","title":{"rendered":"AutoLISP to Automate Your Tasks: Part 2 &#8211; Intermediate"},"content":{"rendered":"\n<p>In <a href=\"https:\/\/www.autodesk.com/blogs\/autocad\/autolisp-to-automate-your-tasks-part-1-beginner\/\" target=\"_blank\" rel=\"noreferrer noopener\">part one<\/a> of our <a href=\"https:\/\/www.autodesk.com/blogs\/autocad\/tag\/autolisp-to-automate-your-tasks\/\" target=\"_blank\" rel=\"noreferrer noopener\">series<\/a>, we talked about some of the basics you should know when beginning with AutoLISP and what kinds of things you can automate with that knowledge.<\/p>\n\n\n\n<p>Today\u2019s post assumes you\u2019re no longer a beginner, but not an expert yet either. You know what you\u2019re doing\u2026but you\u2019re still somewhere in between and in a fuzzy intermediate zone.<\/p>\n\n\n\n<p>By now, you\u2019ve graduated from creating your routines in Notepad to the <a rel=\"noreferrer noopener\" href=\"https:\/\/www.autodesk.com\/autodesk-university\/class\/Mastering-Visual-LISP-Integrated-Development-Environment-2014\" target=\"_blank\">VLIDE<\/a> (Visual Lisp Integrated Development Environment). You\u2019ve learned to load all or some of your code and can probably set <a href=\"https:\/\/help.autodesk.com\/view\/ACD\/2021\/ENU\/?guid=GUID-9ADDB1E6-4759-476F-808E-B50984EAC019\" target=\"_blank\" rel=\"noreferrer noopener\">Breakpoints<\/a> and step through your code. No doubt you watch variables or maybe just use the Last Evaluation box.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" class=\"wp-block-heading\" id=\"what-you-should-know-by-now\">What You Should Know by Now<\/h2>\n\n\n\n<p>At this point, your left hand can probably type SETQ as easily as it can ASDF. No doubt you\u2019re pretty good with object selection, whether it\u2019s a single entity using ENTSEL, or multiple items using SSGET (and of course you\u2019re familiar with all the <a href=\"https:\/\/help.autodesk.com\/view\/ACD\/2020\/ENU\/?guid=GUID-1DABEF81-C431-442A-8916-7F9079AA7799\" target=\"_blank\" rel=\"noreferrer noopener\">modes and filters<\/a> it uses).<\/p>\n\n\n\n<p>Since you\u2019re operating on multiple items in a selection set, you\u2019re comfortable using the WHILE <a href=\"https:\/\/forums.augi.com\/showthread.php?169829-AutoLISP-101-Loops-Discussion\" target=\"_blank\" rel=\"noreferrer noopener\">looping<\/a> function. Other iteration functions you know well should include REPEAT, FOREACH, and VLAX-FOR. I\u2019ll even include the often mis-understood MAPCAR function (so naturally, you know how to make an anonymous function with LAMBDA).<\/p>\n\n\n\n<p>You\u2019re good at getting entities, so you\u2019re probably good at manipulating them as well. You may do it in the native AutoLISP way, with ENTGET, ENTMAKE, SUBST etc., or you may have learned to convert it to a Visual LISP object with VLAX-ENAME&gt;VLA-OBJECT, access its properties, and use its methods, such as GET and PUT.<\/p>\n\n\n\n<p><em><span style=\"text-decoration: underline\">Note<\/span>: If you are using the various Visual Lisp functions, you also know that you must first load the ActiveX (COM) library with (<a rel=\"noreferrer noopener\" href=\"https:\/\/help.autodesk.com\/view\/ACD\/2020\/ENU\/?guid=GUID-BA470FE7-6488-4BC9-8FC8-ED93C32D86AA\" target=\"_blank\">VL-LOAD-COM<\/a>). You only need to do it once, so I add it to the top of my ACADDOC.lsp file. Then I don\u2019t have to worry about it not being loaded for any future function calls.<\/em><\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/www.autodesk.com/blogs\/autocad\/wp-content\/uploads\/sites\/35\/2020\/10\/Lisp-Intermediate_1.png\" target=\"_blank\" rel=\"noopener noreferrer\" data-lbwps-width=\"741\" data-lbwps-height=\"587\" data-lbwps-srcsmall=\"https:\/\/www.autodesk.com/blogs\/autocad\/wp-content\/uploads\/sites\/35\/2020\/10\/Lisp-Intermediate_1-300x238.png\"><img loading=\"lazy\" decoding=\"async\" width=\"741\" height=\"587\" src=\"https:\/\/www.autodesk.com/blogs\/autocad\/wp-content\/uploads\/sites\/35\/2020\/10\/Lisp-Intermediate_1.png\" alt=\"AutoLISP Visual Lisp Console\" class=\"wp-image-10819\" srcset=\"https:\/\/www.autodesk.com/blogs\/autocad\/wp-content\/uploads\/sites\/35\/2020\/10\/Lisp-Intermediate_1.png 741w, https:\/\/www.autodesk.com/blogs\/autocad\/wp-content\/uploads\/sites\/35\/2020\/10\/Lisp-Intermediate_1-300x238.png 300w\" sizes=\"auto, (max-width: 741px) 100vw, 741px\" \/><\/a><\/figure>\n\n\n\n<p>Since our AutoCAD drawings are made up of both entities and words, you\u2019re probably good at manipulating strings as well. More than likely, you\u2019re also using the VL- string functions since they offer more functionality and are easier to use than the AutoLISP functions.<\/p>\n\n\n\n<p>I find that most intermediate level AutoLISP\u2019ers understand and employ <a rel=\"noreferrer noopener\" href=\"https:\/\/help.autodesk.com\/view\/ACD\/2020\/ENU\/?guid=GUID-027AD2E0-5AC5-48DA-B451-112B7EECE40F\" target=\"_blank\">error handling<\/a> in their code. They have the ability to read from and write to external text files. Also, they might actively utilize the power of <a rel=\"noreferrer noopener\" href=\"http:\/\/docs.autodesk.com\/ACD\/2011\/ENU\/filesACG\/WS73099cc142f4875513fb5cd10c4aa30d6b-7f79.htm\" target=\"_blank\">ACAD<\/a>.lsp and <a rel=\"noreferrer noopener\" href=\"http:\/\/docs.autodesk.com\/ACD\/2011\/ENU\/filesACG\/WS73099cc142f4875513fb5cd10c4aa30d6b-7f79.htm\" target=\"_blank\">ACADDOC<\/a>.lsp (also known as the CAD Manager\u2019s best friend!).<\/p>\n\n\n\n<div class=\"wp-block-columns is-layout-flex wp-container-core-columns-is-layout-28f84493 wp-block-columns-is-layout-flex\">\n<div class=\"wp-block-column is-layout-flow wp-block-column-is-layout-flow\">\n<p>Many of the AutoLISP routines we create require getting various kinds of input from the user. Perhaps you\u2019ve moved on from using functions like GETSTRING, GETREAL, etc. to presenting the user with a dialog box created in <a rel=\"noreferrer noopener\" href=\"https:\/\/help.autodesk.com\/view\/ACD\/2020\/ENU\/?guid=GUID-F4A63A70-EB72-4F7D-A90C-3C5ABD6864A9\" target=\"_blank\">DCL<\/a> (Dialog Control Language).<\/p>\n<\/div>\n\n\n\n<div class=\"wp-block-column is-layout-flow wp-block-column-is-layout-flow\">\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/www.autodesk.com/blogs\/autocad\/wp-content\/uploads\/sites\/35\/2020\/10\/Lisp-Intermediate_2.png\" target=\"_blank\" rel=\"noopener noreferrer\" data-lbwps-width=\"469\" data-lbwps-height=\"407\" data-lbwps-srcsmall=\"https:\/\/www.autodesk.com/blogs\/autocad\/wp-content\/uploads\/sites\/35\/2020\/10\/Lisp-Intermediate_2-300x260.png\"><img loading=\"lazy\" decoding=\"async\" width=\"469\" height=\"407\" src=\"https:\/\/www.autodesk.com/blogs\/autocad\/wp-content\/uploads\/sites\/35\/2020\/10\/Lisp-Intermediate_2.png\" alt=\"AutoLISP dialog box\" class=\"wp-image-10821\" srcset=\"https:\/\/www.autodesk.com/blogs\/autocad\/wp-content\/uploads\/sites\/35\/2020\/10\/Lisp-Intermediate_2.png 469w, https:\/\/www.autodesk.com/blogs\/autocad\/wp-content\/uploads\/sites\/35\/2020\/10\/Lisp-Intermediate_2-300x260.png 300w\" sizes=\"auto, (max-width: 469px) 100vw, 469px\" \/><\/a><\/figure>\n<\/div>\n<\/div>\n\n\n\n<p>Obviously, this list isn\u2019t all-inclusive, and you may or may not have mastered all these skills, but it should give you a good idea about where you are on your AutoLISP journey.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" class=\"wp-block-heading\" id=\"ways-an-intermediate-user-can-automate-even-more\">Ways an Intermediate User Can Automate Even More <\/h2>\n\n\n\n<p>Suffice it to say that you have a lot more tools in your tool belt than you did as a beginner. While there\u2019s still the need to do some of the things we discussed in <a href=\"https:\/\/www.autodesk.com/blogs\/autocad\/autolisp-to-automate-your-tasks-part-1-beginner\/\" target=\"_blank\" rel=\"noreferrer noopener\">Part One<\/a>, you\u2019ve probably found that you can automate the process by adding them to the ACADDOC.lsp file. Most likely, you include your favorite short commands and control your environment by setting SYSVARs each time you open a file.<\/p>\n\n\n\n<p>Perhaps you\u2019re responsible for managing an entire department. You might help your users ensure CAD Standards in numerous ways. <\/p>\n\n\n\n<div class=\"wp-block-columns is-layout-flex wp-container-core-columns-is-layout-28f84493 wp-block-columns-is-layout-flex\">\n<div class=\"wp-block-column is-layout-flow wp-block-column-is-layout-flow\">\n<p>For example, if your standard dictates that Polylines are always to be used instead of Lines, make sure they always do it right by <a rel=\"noreferrer noopener\" href=\"https:\/\/knowledge.autodesk.com\/support\/autocad\/learn-explore\/caas\/CloudHelp\/cloudhelp\/2020\/ENU\/AutoCAD-Core\/files\/GUID-FC323813-D88D-4507-8665-67B215BF9EAD-htm.html\" target=\"_blank\">undefining<\/a> the LINE command, and replacing it with your own function that calls PLINE instead<\/p>\n<\/div>\n\n\n\n<div class=\"wp-block-column is-layout-flow wp-block-column-is-layout-flow\">\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/www.autodesk.com/blogs\/autocad\/wp-content\/uploads\/sites\/35\/2020\/10\/Lisp-Intermediate_3.png\" target=\"_blank\" rel=\"noopener noreferrer\" data-lbwps-width=\"468\" data-lbwps-height=\"244\" data-lbwps-srcsmall=\"https:\/\/www.autodesk.com/blogs\/autocad\/wp-content\/uploads\/sites\/35\/2020\/10\/Lisp-Intermediate_3-300x156.png\"><img loading=\"lazy\" decoding=\"async\" width=\"468\" height=\"244\" src=\"https:\/\/www.autodesk.com/blogs\/autocad\/wp-content\/uploads\/sites\/35\/2020\/10\/Lisp-Intermediate_3.png\" alt=\"AutoLISP PLINE\" class=\"wp-image-10822\" srcset=\"https:\/\/www.autodesk.com/blogs\/autocad\/wp-content\/uploads\/sites\/35\/2020\/10\/Lisp-Intermediate_3.png 468w, https:\/\/www.autodesk.com/blogs\/autocad\/wp-content\/uploads\/sites\/35\/2020\/10\/Lisp-Intermediate_3-300x156.png 300w\" sizes=\"auto, (max-width: 468px) 100vw, 468px\" \/><\/a><\/figure>\n<\/div>\n<\/div>\n\n\n\n<p>We\u2019ve established that you\u2019re probably proficient with most of the available string manipulation functions, as well as reading and writing external files, so why not combine those skills to further automate things? <\/p>\n\n\n\n<p>It should be well within your skill level to manage your standard Layers from a text file. Decide on a format (typically all layer properties will be on a single line) and build or reset your layers one at a time.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.autodesk.com/blogs\/autocad\/wp-content\/uploads\/sites\/35\/2020\/10\/Lisp-Intermediate_4.png\" alt=\"AutoLISP external layers\" class=\"wp-image-10823\" width=\"611\" height=\"221\" srcset=\"https:\/\/www.autodesk.com/blogs\/autocad\/wp-content\/uploads\/sites\/35\/2020\/10\/Lisp-Intermediate_4.png 814w, https:\/\/www.autodesk.com/blogs\/autocad\/wp-content\/uploads\/sites\/35\/2020\/10\/Lisp-Intermediate_4-300x109.png 300w, https:\/\/www.autodesk.com/blogs\/autocad\/wp-content\/uploads\/sites\/35\/2020\/10\/Lisp-Intermediate_4-768x278.png 768w\" sizes=\"auto, (max-width: 611px) 100vw, 611px\" \/><\/figure>\n\n\n\n<p>While you\u2019re automating your Layer and Style standards, you might want to decide to conditionalize what loads and when. In other words, evaluate the drawing being opened via the ACADDOC.lsp file, and do different things based on what you learn.<\/p>\n\n\n\n<div class=\"wp-block-columns is-layout-flex wp-container-core-columns-is-layout-28f84493 wp-block-columns-is-layout-flex\">\n<div class=\"wp-block-column is-layout-flow wp-block-column-is-layout-flow\">\n<p>In this example, the client name is part of the path structure to the file. Simply evaluate with a COND, bind the layers file name to a string (which represents a path), and pass that to your function that opens and iterates through the file.<\/p>\n<\/div>\n\n\n\n<div class=\"wp-block-column is-layout-flow wp-block-column-is-layout-flow\">\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/www.autodesk.com/blogs\/autocad\/wp-content\/uploads\/sites\/35\/2020\/10\/Lisp-Intermediate_5.png\" target=\"_blank\" rel=\"noopener noreferrer\" data-lbwps-width=\"665\" data-lbwps-height=\"419\" data-lbwps-srcsmall=\"https:\/\/www.autodesk.com/blogs\/autocad\/wp-content\/uploads\/sites\/35\/2020\/10\/Lisp-Intermediate_5-300x189.png\"><img loading=\"lazy\" decoding=\"async\" width=\"665\" height=\"419\" src=\"https:\/\/www.autodesk.com/blogs\/autocad\/wp-content\/uploads\/sites\/35\/2020\/10\/Lisp-Intermediate_5.png\" alt=\"AutoLISP layer\" class=\"wp-image-10824\" srcset=\"https:\/\/www.autodesk.com/blogs\/autocad\/wp-content\/uploads\/sites\/35\/2020\/10\/Lisp-Intermediate_5.png 665w, https:\/\/www.autodesk.com/blogs\/autocad\/wp-content\/uploads\/sites\/35\/2020\/10\/Lisp-Intermediate_5-300x189.png 300w\" sizes=\"auto, (max-width: 665px) 100vw, 665px\" \/><\/a><\/figure>\n<\/div>\n<\/div>\n\n\n\n<p>I love this last idea. Find what\u2019s unique about your drawings, evaluate it as it opens with ACADDOC.lsp, and act accordingly. Your key may be as simple as the drive letter, something in the path (as our previous example shows), or even something within the drawing, such as the title block name, or an entry in <a href=\"https:\/\/knowledge.autodesk.com\/support\/autocad\/learn-explore\/caas\/CloudHelp\/cloudhelp\/2021\/ENU\/AutoCAD-Core\/files\/GUID-2A98E78A-9E43-4DE8-8327-BF1BF803B4B7-htm.html?st=dwgprops\" target=\"_blank\" rel=\"noreferrer noopener\">DWGPROPS<\/a>. There\u2019s so much you can automate this way.<\/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>I\u2019ve just scratched the surface with some of the possibilities of applying your intermediate level of AutoLISP knowledge to automate things in AutoCAD. Think about and identify your own pain points. Look for repetitive tasks or just things that seem to be done \u201cthe long way.\u201d You\u2019ll soon find your own things to automate.<\/p>\n\n\n\n<p>Of course, the example code snippets I present aren\u2019t quite ready for prime time yet, but they should give you some idea of each concept. More than anything, I hope they are catalysts for the light bulb that should be going off above your head.<\/p>\n\n\n\n<p>I hope you join me again next time. In <a href=\"https:\/\/www.autodesk.com/blogs\/autocad\/autolisp-to-automate-your-tasks-part-3-advanced\/\" target=\"_blank\" rel=\"noreferrer noopener\">part three<\/a> of the <a href=\"https:\/\/www.autodesk.com/blogs\/autocad\/tag\/autolisp-to-automate-your-tasks\/\" target=\"_blank\" rel=\"noreferrer noopener\">series<\/a>, we&#8217;ll talk about what you should know as an \u201cAdvanced\u201d AutoLISP programmer and some of the things you can do. Until then, keep on programmin\u2019.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In part one of our series, we talked about some of the basics you should know when beginning with AutoLISP and what kinds of things you can automate with that knowledge. Today\u2019s post assumes you\u2019re no longer a beginner, but not an expert yet either. You know what you\u2019re doing\u2026but you\u2019re still somewhere in between [&hellip;]<\/p>\n","protected":false},"author":329,"featured_media":10825,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"inline_featured_image":false,"footnotes":""},"categories":[893],"tags":[386,7332,287,1010],"class_list":["post-10817","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-learning","tag-autolisp","tag-autolisp-to-automate-your-tasks","tag-layers","tag-polyline","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 Tutorial Part 2: Automate Tasks - AutoCAD Blog<\/title>\n<meta name=\"description\" content=\"Learn new ways to automate tasks and save time with AutoCAD AutoLISP. Helpful examples include how to manage layers and conditionalize loads.\" \/>\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-2-intermediate\/\" \/>\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 2 - Intermediate\" \/>\n<meta property=\"og:description\" content=\"Learn new ways to automate tasks and save time with AutoCAD AutoLISP. Helpful examples include how to manage layers and conditionalize loads.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.autodesk.com/blogs\/autocad\/autolisp-to-automate-your-tasks-part-2-intermediate\/\" \/>\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-10-06T14:00:00+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2021-12-07T21:09:46+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/i0.wp.com\/blogs.autodesk.com\/autocad\/wp-content\/uploads\/sites\/35\/2020\/10\/AutoLISP-Intermediate-Feature-1536x830-1-scaled.jpg?fit=2560%2C1383&ssl=1\" \/>\n\t<meta property=\"og:image:width\" content=\"2560\" \/>\n\t<meta property=\"og:image:height\" content=\"1383\" \/>\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=\"5 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-2-intermediate\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.autodesk.com/blogs\\\/autocad\\\/autolisp-to-automate-your-tasks-part-2-intermediate\\\/\"},\"author\":{\"name\":\"Frank Mayfield\",\"@id\":\"https:\\\/\\\/www.autodesk.com/blogs\\\/autocad\\\/#\\\/schema\\\/person\\\/fbfe7079a52f7aa618a72c29f6398de6\"},\"headline\":\"AutoLISP to Automate Your Tasks: Part 2 &#8211; Intermediate\",\"datePublished\":\"2020-10-06T14:00:00+00:00\",\"dateModified\":\"2021-12-07T21:09:46+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.autodesk.com/blogs\\\/autocad\\\/autolisp-to-automate-your-tasks-part-2-intermediate\\\/\"},\"wordCount\":1046,\"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-2-intermediate\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.autodesk.com/blogs\\\/autocad\\\/wp-content\\\/uploads\\\/sites\\\/35\\\/2020\\\/10\\\/AutoLISP-Intermediate-Feature-1536x830-1-scaled.jpg\",\"keywords\":[\"AutoLISP\",\"AutoLISP to Automate Your Tasks\",\"Layers\",\"Polyline\"],\"articleSection\":[\"Learning\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.autodesk.com/blogs\\\/autocad\\\/autolisp-to-automate-your-tasks-part-2-intermediate\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.autodesk.com/blogs\\\/autocad\\\/autolisp-to-automate-your-tasks-part-2-intermediate\\\/\",\"url\":\"https:\\\/\\\/www.autodesk.com/blogs\\\/autocad\\\/autolisp-to-automate-your-tasks-part-2-intermediate\\\/\",\"name\":\"AutoLISP Tutorial Part 2: Automate Tasks - AutoCAD Blog\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.autodesk.com/blogs\\\/autocad\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.autodesk.com/blogs\\\/autocad\\\/autolisp-to-automate-your-tasks-part-2-intermediate\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.autodesk.com/blogs\\\/autocad\\\/autolisp-to-automate-your-tasks-part-2-intermediate\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.autodesk.com/blogs\\\/autocad\\\/wp-content\\\/uploads\\\/sites\\\/35\\\/2020\\\/10\\\/AutoLISP-Intermediate-Feature-1536x830-1-scaled.jpg\",\"datePublished\":\"2020-10-06T14:00:00+00:00\",\"dateModified\":\"2021-12-07T21:09:46+00:00\",\"description\":\"Learn new ways to automate tasks and save time with AutoCAD AutoLISP. Helpful examples include how to manage layers and conditionalize loads.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.autodesk.com/blogs\\\/autocad\\\/autolisp-to-automate-your-tasks-part-2-intermediate\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.autodesk.com/blogs\\\/autocad\\\/autolisp-to-automate-your-tasks-part-2-intermediate\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.autodesk.com/blogs\\\/autocad\\\/autolisp-to-automate-your-tasks-part-2-intermediate\\\/#primaryimage\",\"url\":\"https:\\\/\\\/www.autodesk.com/blogs\\\/autocad\\\/wp-content\\\/uploads\\\/sites\\\/35\\\/2020\\\/10\\\/AutoLISP-Intermediate-Feature-1536x830-1-scaled.jpg\",\"contentUrl\":\"https:\\\/\\\/www.autodesk.com/blogs\\\/autocad\\\/wp-content\\\/uploads\\\/sites\\\/35\\\/2020\\\/10\\\/AutoLISP-Intermediate-Feature-1536x830-1-scaled.jpg\",\"width\":2560,\"height\":1383,\"caption\":\"Inside view of London underground\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.autodesk.com/blogs\\\/autocad\\\/autolisp-to-automate-your-tasks-part-2-intermediate\\\/#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 2 &#8211; Intermediate\"}]},{\"@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 Tutorial Part 2: Automate Tasks - AutoCAD Blog","description":"Learn new ways to automate tasks and save time with AutoCAD AutoLISP. Helpful examples include how to manage layers and conditionalize loads.","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-2-intermediate\/","og_locale":"en_US","og_type":"article","og_title":"AutoLISP to Automate Your Tasks: Part 2 - Intermediate","og_description":"Learn new ways to automate tasks and save time with AutoCAD AutoLISP. Helpful examples include how to manage layers and conditionalize loads.","og_url":"https:\/\/www.autodesk.com/blogs\/autocad\/autolisp-to-automate-your-tasks-part-2-intermediate\/","og_site_name":"AutoCAD Blog","article_publisher":"https:\/\/www.facebook.com\/autocad","article_published_time":"2020-10-06T14:00:00+00:00","article_modified_time":"2021-12-07T21:09:46+00:00","og_image":[{"width":2560,"height":1383,"url":"https:\/\/i0.wp.com\/blogs.autodesk.com\/autocad\/wp-content\/uploads\/sites\/35\/2020\/10\/AutoLISP-Intermediate-Feature-1536x830-1-scaled.jpg?fit=2560%2C1383&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":"5 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.autodesk.com/blogs\/autocad\/autolisp-to-automate-your-tasks-part-2-intermediate\/#article","isPartOf":{"@id":"https:\/\/www.autodesk.com/blogs\/autocad\/autolisp-to-automate-your-tasks-part-2-intermediate\/"},"author":{"name":"Frank Mayfield","@id":"https:\/\/www.autodesk.com/blogs\/autocad\/#\/schema\/person\/fbfe7079a52f7aa618a72c29f6398de6"},"headline":"AutoLISP to Automate Your Tasks: Part 2 &#8211; Intermediate","datePublished":"2020-10-06T14:00:00+00:00","dateModified":"2021-12-07T21:09:46+00:00","mainEntityOfPage":{"@id":"https:\/\/www.autodesk.com/blogs\/autocad\/autolisp-to-automate-your-tasks-part-2-intermediate\/"},"wordCount":1046,"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-2-intermediate\/#primaryimage"},"thumbnailUrl":"https:\/\/www.autodesk.com/blogs\/autocad\/wp-content\/uploads\/sites\/35\/2020\/10\/AutoLISP-Intermediate-Feature-1536x830-1-scaled.jpg","keywords":["AutoLISP","AutoLISP to Automate Your Tasks","Layers","Polyline"],"articleSection":["Learning"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.autodesk.com/blogs\/autocad\/autolisp-to-automate-your-tasks-part-2-intermediate\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.autodesk.com/blogs\/autocad\/autolisp-to-automate-your-tasks-part-2-intermediate\/","url":"https:\/\/www.autodesk.com/blogs\/autocad\/autolisp-to-automate-your-tasks-part-2-intermediate\/","name":"AutoLISP Tutorial Part 2: Automate Tasks - AutoCAD Blog","isPartOf":{"@id":"https:\/\/www.autodesk.com/blogs\/autocad\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.autodesk.com/blogs\/autocad\/autolisp-to-automate-your-tasks-part-2-intermediate\/#primaryimage"},"image":{"@id":"https:\/\/www.autodesk.com/blogs\/autocad\/autolisp-to-automate-your-tasks-part-2-intermediate\/#primaryimage"},"thumbnailUrl":"https:\/\/www.autodesk.com/blogs\/autocad\/wp-content\/uploads\/sites\/35\/2020\/10\/AutoLISP-Intermediate-Feature-1536x830-1-scaled.jpg","datePublished":"2020-10-06T14:00:00+00:00","dateModified":"2021-12-07T21:09:46+00:00","description":"Learn new ways to automate tasks and save time with AutoCAD AutoLISP. Helpful examples include how to manage layers and conditionalize loads.","breadcrumb":{"@id":"https:\/\/www.autodesk.com/blogs\/autocad\/autolisp-to-automate-your-tasks-part-2-intermediate\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.autodesk.com/blogs\/autocad\/autolisp-to-automate-your-tasks-part-2-intermediate\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.autodesk.com/blogs\/autocad\/autolisp-to-automate-your-tasks-part-2-intermediate\/#primaryimage","url":"https:\/\/www.autodesk.com/blogs\/autocad\/wp-content\/uploads\/sites\/35\/2020\/10\/AutoLISP-Intermediate-Feature-1536x830-1-scaled.jpg","contentUrl":"https:\/\/www.autodesk.com/blogs\/autocad\/wp-content\/uploads\/sites\/35\/2020\/10\/AutoLISP-Intermediate-Feature-1536x830-1-scaled.jpg","width":2560,"height":1383,"caption":"Inside view of London underground"},{"@type":"BreadcrumbList","@id":"https:\/\/www.autodesk.com/blogs\/autocad\/autolisp-to-automate-your-tasks-part-2-intermediate\/#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 2 &#8211; Intermediate"}]},{"@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\/10817","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=10817"}],"version-history":[{"count":0,"href":"https:\/\/www.autodesk.com/blogs\/autocad\/wp-json\/wp\/v2\/posts\/10817\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.autodesk.com/blogs\/autocad\/wp-json\/wp\/v2\/media\/10825"}],"wp:attachment":[{"href":"https:\/\/www.autodesk.com/blogs\/autocad\/wp-json\/wp\/v2\/media?parent=10817"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.autodesk.com/blogs\/autocad\/wp-json\/wp\/v2\/categories?post=10817"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.autodesk.com/blogs\/autocad\/wp-json\/wp\/v2\/tags?post=10817"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}