AutoCAD: Secrets Every User Should Know

Chapter 8: AutoLISP by Example Getting Started

Overview

I don t know why more users don t write programs in AutoLISP; perhaps the very notion of programming is too intimidating. And yet nothing has more potential to expand your AutoCAD efficiency than programming new commands. Of all the programming tools out there, AutoLISP is the most accessible to AutoCAD users; but do I really think every user should know how to program in AutoLISP? Yes, I do and you ll see why as you work through this chapter.

If the prospect of programming leaves you a bit daunted, I ve got good news: If you can use AutoCAD, you can program in AutoLISP. To show you how easy it is, let s write a program right now. Just follow these steps:

  1. At the AutoCAD command line, type this: (defun C:OO()(setvar osmode 4143)) .

  2. Clear your osnap settings in the Object Snap tab of the Drafting Settings dialog box.

  3. Type OO at the command line.

Congratulations, you ve just written an AutoLISP program. To see what it did, check the settings for running object snaps again. We ll get back to this program after I give you a little background. When you finish this chapter, you ll be thinking up and creating all kinds of useful new AutoLISP functions of your own.

  • Background

  • Writing AutoLISP Programs

  • AutoLISP Examples

  • Automatic Loading

Background

AutoLISP is a powerful customizing tool with which you can write useful new AutoCAD commands in minutes. Although other programming languages are often used with AutoCAD (most notably Visual...

UNLIMITED FREE
ACCESS
TO THE WORLD'S BEST IDEAS

SUBMIT
Already a GlobalSpec user? Log in.

This is embarrasing...

An error occurred while processing the form. Please try again in a few minutes.

Customize Your GlobalSpec Experience

Category: Programming Languages
Finish!
Privacy Policy

This is embarrasing...

An error occurred while processing the form. Please try again in a few minutes.