Добавил:
Upload Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
Книги_AutoCad_2 / AutoCAD 2006 and AutoCAD LT 2006 Bible_2004г__.pdf
Скачиваний:
142
Добавлен:
09.04.2015
Размер:
17.83 Mб
Скачать

1030 Part VI Customizing AutoCAD

10.In the Command List, choose the Pedit .1 command. (This custom command was created in the exercise on Customizing the Buttons Menu.) Drag it anywhere in the Shortcut Keys list.

11.In the Properties pane, click the Key(s) text box, and then click the Ellipsis button. In the Shortcut Keys dialog box, click the Press new Shortcut Key text box. On your keyboard, press Ctrl+Shift+F12 (the function key). Click Assign and click OK.

12.Double-click the Temporary Override Keys item in the Customizations In pane to expand it. Scroll down and choose Object Snap Override: Intersection, which doesn’t have a default temporary override key. In the Properties pane, click the Key(s) text box, and then click the Ellipsis button. In the Shortcut Keys dialog box, click the Press New Shortcut Key text box. On your keyboard, press Shift+1. Click Assign and click OK.

13.Click OK to save the changes to the customization file and return to your drawing.

14.Draw a polyline that contains segments that intersect each other. Turn off OSNAP, if it is on. To test the intersection object snap shortcut key, start the LINE command and pick any point off the polyline for the first point. At the Specify next point or [Undo]: prompt, press Shift+1. Pass the cursor over the intersection of the polyline segment. When you see the Intersection marker (an X) and tooltip, click and end the LINE command.

15.The Pedit .1 custom command issues the PEDIT command, waits for you to select a polyline, and then sets its width to .1. To test the keyboard shortcut, press Shift+F12. The PEDIT command starts. Select the polyline. Its width changes to .1.

16.Select the polyline. To test the Deselect All command, press Ctrl+D. The polyline is deselected.

17.Type cuiload. In the Load/Unload Customizations dialog box, choose AB4 and click Unload. Click Browse, choose acad.cui or aclt.cui, and click Open. Click Close to return to your drawing.

18.Draw another intersecting polyline. Press Shift+F12. Nothing happens. Select the polyline and press Ctrl+D; it stays selected. Try to draw a line to the intersection, using Shift+1. It doesn’t work.

Don’t save your drawing.

Summary

In this chapter, you read about how to customize the menu to suit your situation and speed up your everyday work. Specifically, you learned the following:

How to work with main and partial customization files

How to write menu macros

How to customize mouse and tablet buttons

All about customizing drop-down menus

How to create custom commands

How to create custom shortcut menus

Chapter 33 Customizing Menus 1031

How to create image-tile menus

About customizing the tablet menu

How to create keyboard shortcuts, including shortcut keys and temporary override keys

This chapter ends Part VI, “Customizing AutoCAD and AutoCAD LT.” Part VII challenges you to go further in your customization of AutoCAD by starting to program with AutoLISP and Visual Basic for Applications.

 

 

 

Programming

AutoCAD

Part VII invites you to go the distance and start programming AutoCAD with AutoLISP, Visual LISP, and Visual Basic for Applications (VBA). AutoLISP is a powerful programming language that lets you quickly create your own commands and routines that are tailored to your needs. Visual LISP adds an easy-to-use interface

to AutoLISP programming.

VBA is a programming language that is supported by many Windows applications. You can create programs and dialog boxes for AutoCAD with VBA. Using ActiveX, which lets you access other Windows applications, you can write programs that integrate AutoCAD with other applications.

Unfortunately, AutoCAD LT doesn’t support either AutoLISP or VBA. Therefore, this entire part applies only to AutoCAD.

P A R T

VII

In This Part

Chapter 34

Understanding AutoLISP

and Visual LISP Basics

Chapter 35

Exploring

AutoLISP Further

Chapter 36

Exploring Advanced

AutoLISP Topics

Chapter 37

Programming with Visual Basic for Applications

Understanding

AutoLISP and

Visual LISP Basics

AutoLISP is a programming language that can greatly enhance your productivity by automating often-used or repetitive tasks.

AutoLISP provides a glimpse into the inner workings of AutoCAD and can serve as an excellent stepping-stone to learning more-advanced automation methods, such as ObjectARX and VBA. An AutoLISP routine gives you complete control of its interaction with the user and what it does after it’s loaded.

Unfortunately, AutoCAD LT doesn’t support AutoLISP.

You can type AutoLISP expressions on the command line in response to prompts, or you can save your code to a file that you can load and use when needed. AutoLISP offers wide and varied possibilities for shortcuts. Best of all, you can customize AutoLISP to any level of complexity.

AutoLISP intimidates many AutoCAD users, but this fear is unwarranted. The many benefits of AutoLISP well justify the initial time that you invest to learn this rich and full-featured programming language.

You can also find a tremendous number of AutoLISP routines. Many CAD Web sites offer huge libraries of AutoLISP routines as free downloads. (For more details, see Bonus Chapter 2 on the CD.) Every office with more than a trivial number of AutoCAD workstations has probably created at least one AutoLISP routine to expedite some common task.

Many of the commands that you already use in AutoCAD are in AutoLISP routines, including 3DARRAY, MVSETUP, AI_BOX, and others. You can often find examples of how to handle complex problems by reviewing these applications.

LISP stands for List Processing, and as you’ll see in the next chapter, the understanding of lists is crucial to using AutoLISP.

Most AutoLISP routines define a command name, which you then type at the command line to run the routine. Some routines include a dialog box to help you choose options and specifications.

34C H A P T E R

In This Chapter

Understanding AutoLISP programming and the Visual LISP environment

Working with the Visual LISP interface

Getting help in

Visual LISP

Creating your own

AutoLISP expressions

Using AutoLISP on the command line

Соседние файлы в папке Книги_AutoCad_2