The AutoCADET's Guide to Visual LISP: Optimize and Customize Your AutoCAD Design Environment

Chapter 10: Basic User Input

Most programming languages have a way to accept string input and convert it to a particular data type. But Visual LISP, because it runs in a CAD/CAM environment, must do more than just accept basic input in the form of numbers or strings. Visual LISP's input system must be able to accept points, entity selections, selection sets, window selections, angles, and distances, as well as numbers and strings.

Operator input in the Visual LISP environment can be accepted in three ways: in a dialog box, from the graphics screen, and from the command line. The next chapter introduces dialog boxes and their components. In this chapter, you look at command-line and graphic screen input. Virtually all applications written in Visual LISP use at least one of the subrs described in this chapter.

Building AutoCAD Commands

Like output, the input to a command function should parallel the AutoCAD system as much as possible even if you have a better method in mind. (If you are writing code only for yourself, however, improve the interface to suit your fancy.) When writing code for a large community of AutoCAD users, it is best to keep the essence of the command like AutoCAD. That means supplying a default value whenever possible and including options in the same form when prompting the user. The normal approach is to provide a prompting question, and then present the options (if any) between the [ and ] characters, with the default option following between the

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: Digital Panel Meters
Finish!
Privacy Policy

This is embarrasing...

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