
- English
- ePUB (mobile friendly)
- Available on iOS & Android
eBook - ePub
About this book
Customize and personalize programs built on the AutoCAD platform
AutoLISP is the key to unlocking the secrets of a more streamlined experience using industry leading software programs like AutoCAD, Civil 3D, Plant 3D, and more.
AutoCAD Platform Customization: AutoLISP provides real-world examples that show you how to do everything from modifying graphical objects and reading and setting system variables to communicating with external programs. It also features a resources appendix and downloadable datasets and customization examplesātools that ensure swift and easy adoption.
- Find out how to remove unused buttons from the ribbon to gain screen space
- Discover how to create macros for frequently performed actions, or add your company's logo to the bottom of every drawing
- Learn to perform more involved customizations, like communicating with a database to validate and update information entered in drawing layers
- Ideal for CAD administrators, senior drafters, savvy users, and other professionals and students
Through detailed discussions and tutorials that include real-world examples, this book gives you the power to enhance your program's experience and output.
Frequently asked questions
Yes, you can cancel anytime from the Subscription tab in your account settings on the Perlego website. Your subscription will stay active until the end of your current billing period. Learn how to cancel your subscription.
No, books cannot be downloaded as external files, such as PDFs, for use outside of Perlego. However, you can download books within the Perlego app for offline reading on mobile or tablet. Learn more here.
Perlego offers two plans: Essential and Complete
- Essential is ideal for learners and professionals who enjoy exploring a wide range of subjects. Access the Essential Library with 800,000+ trusted titles and best-sellers across business, personal growth, and the humanities. Includes unlimited reading time and Standard Read Aloud voice.
- Complete: Perfect for advanced learners and researchers needing full, unrestricted access. Unlock 1.4M+ books across hundreds of subjects, including academic and specialized titles. The Complete Plan also includes advanced features like Premium Read Aloud and Research Assistant.
We are an online textbook subscription service, where you can get access to an entire online library for less than the price of a single book per month. With over 1 million books across 1000+ topics, weāve got you covered! Learn more here.
Look out for the read-aloud symbol on your next book to see if you can listen to it. The read-aloud tool reads text aloud for you, highlighting the text as it is being read. You can pause it, speed it up and slow it down. Learn more here.
Yes! You can use the Perlego app on both iOS or Android devices to read anytime, anywhere ā even offline. Perfect for commutes or when youāre on the go.
Please note we cannot support devices running on iOS 13 and Android 7 or earlier. Learn more about using the app.
Please note we cannot support devices running on iOS 13 and Android 7 or earlier. Learn more about using the app.
Yes, you can access AutoCAD Platform Customization by Lee Ambrosius in PDF and/or ePUB format, as well as other popular books in Computer Science & Digital Media. We have over one million books available in our catalogue for you to explore.
Information
Chapter 1
Quick Start for New AutoLISP Programmers
The AutoLISPĀ® language and programming in general are two subjects that I have enjoyed for over 15 years now, but the same subjects make some people cringe and want to run in the opposite direction. I am not going to claim AutoLISP is easy to learn, but it can be learned by anyone, whether or not they have a programming background. When I first set out to learn AutoLISP, I didn't have any programming experience, but I wanted the benefits that AutoLISP could offer.
I understand if you have some hesitation at the thought of learning AutoLISP, but you don't need to feel that wayāI will help you. This chapter will ease you into some core programming concepts and the AutoLISP programming language by exposing you to a variety of functions that are available.
To complete the exercises in this chapter and be able to create and edit LSP files, you must have the following:
- For Windows users: AutodeskĀ® AutoCADĀ® 2006 or later and the Notepad program
- For Mac OS users: AutodeskĀ® AutoCADĀ® 2011 or later and the TextEdit program
NOTE
Although I mention AutoCAD 2006 or later, everything covered in this chapter should work without any problems going all the way back to AutoCADĀ® 2000 and even possibly earlier releases.
Working with AutoLISP Expressions
AutoLISP is a natural extension of AutoCAD, as it can be used seamlessly from the AutoCAD Command prompt. You can enter AutoLISP when no commands are active or when AutoCAD prompts you for a value. The programming statements used in AutoLISP are known as expressions. You can type expressions at the Command prompt as long as they start with an opening parenthesis [
(] or an exclamation point (!). Follow those symbols with the functions you wish to execute and the arguments that provide data or further instruction.Each AutoLISP expression that starts with an opening parenthesis must also end with a closing parenthesis. AutoLISP expressions must contain the same number of opening and closing parenthesesāthis is sometimes referred to as balancing parentheses. You can enter the opening and closing parentheses on separate lines, though.
Use these steps to gain a basic understanding of entering AutoLISP expressions at the AutoCAD Command prompt:
- Launch AutoCAD, if it is not already running.
- At the AutoCAD Command prompt, type
(and press Enter.AutoCAD responds with the prompt(_>, which is the program's way of letting you know that AutoLISP has taken control. - Press Esc to return to the standard AutoCAD Command prompt.
- At the AutoCAD Command prompt, type
(+ 3 2)and press Enter.The AutoLISP expression is evaluated and returns a value of 5, which is the result of adding 3 and 2 together. The+(plus sign) is the function of the AutoLISP expression;3and2are the arguments (in this case, data) that are passed to the function. The AutoLISP function you want to use must be the first item after the opening parenthesis. - Type
(* 3.5 2)and press Enter.The value 7.0 is returned as a result of multiplying 3.5 by 2. - Type
(setq rad (/ 0.375 2))and press Enter.The value 0.1875 is returned as a result of dividing 0.375 by 2, but the same value is also assigned to the user-defined variable named rad with thesetqfunction. AutoLISP expressions can be nested one inside of another, and they are evaluated from the innermost to the outermost expression. In this example, the expression(/ 0.375 2)is evaluated first and returns 0.1875. The next expression,(setq rad 0.1875), is evaluated and it also returns 0.1875. - Type
circleand press Enter.The AutoCADcirclecommand is started. - At the
Specify center point for circle or [3P/2P/Ttr (tan tan radius)]:prompt, type(list 0 5)and press Enter.The(list 0 5)expression returns a value of (0 5), which is a list of two values that presents the 2D coordinate of 0,5. The center of the circle is started at 0,5,0. - At the
Specify radius of circle or [Diameter]:prompt, type!radand press Enter.AutoLISP evaluates the rad user-defined variable and returns its value to be used for the circle's radius. The radius of the circle should be set to 0.18...
Table of contents
- Cover
- Title Page
- Copyright
- Publisher's Note
- Dedication
- Acknowledgments
- About the Author
- Introduction
- Chapter 1: Quick Start for New AutoLISP Programmers
- Chapter 2: Understanding AutoLISP
- Chapter 3: Calculating and Working with Values
- Chapter 4: Working with Lists
- Chapter 5: Requesting Input and Using Conditional and Looping Expressions
- Chapter 6: Creating and Modifying Graphical Objects
- Chapter 7: Creating and Modifying Nongraphical Objects
- Chapter 8: Working with the Operating System and External Files
- Chapter 9: Catching and Handling Errors
- Chapter 10: Authoring, Managing, and Loading AutoLISP Programs
- Chapter 11: Using the Visual LISP Editor (Windows only)
- Chapter 12: Working with ActiveX/COM Libraries (Windows only)
- Chapter 13: Implementing Dialog Boxes (Windows only)
- End User License Agreement