- •Contents
- •Contents at a Glance
- •Acknowledgments
- •Preface
- •Is This Book for You?
- •How This Book Is Organized
- •How to Use This Book
- •Doing the Exercises
- •Conventions Used in This Book
- •What the Icons Mean
- •About the CD-ROM
- •Other Information
- •Contacting the Author
- •Foreword
- •Credits
- •About the Author
- •Summary
- •AutoCAD’s Advantages
- •Comparing AutoCAD and AutoCAD LT
- •Starting AutoCAD and AutoCAD LT
- •Creating a New Drawing
- •Using the AutoCAD and AutoCAD LT Interface
- •Creating a New Folder
- •Using the Interface
- •Saving a Drawing
- •Closing a Drawing and Exiting from AutoCAD and AutoCAD LT
- •Summary
- •Creating a New Drawing from a Template
- •Working with Templates
- •Opening a Drawing with Default Settings
- •Opening an Existing Drawing
- •Using an Existing Drawing as a Prototype
- •Saving a Drawing Under a New Name
- •Summary
- •The Command Line and Dynamic Input
- •Command Techniques
- •Of Mice and Pucks
- •Getting Help
- •Summary
- •Typing Coordinates
- •Displaying Coordinates
- •Picking Coordinates on the Screen
- •Overriding Coordinate Settings
- •Locating Points
- •Summary
- •Choosing Unit Types
- •Drawing Limits
- •Understanding Scales
- •Creating a Title Block
- •Specifying Common Setup Options
- •Customizing with the MVSETUP Command
- •Using the Setup Wizards
- •Summary
- •Using the LINE Command
- •Drawing Rectangles
- •Drawing Polygons
- •Creating Construction Lines
- •Creating Rays
- •Summary
- •Drawing Circles
- •Drawing Arcs
- •Creating Ellipses and Elliptical Arcs
- •Making Donuts
- •Placing Points
- •Summary
- •Panning
- •Using the ZOOM Command
- •Using Aerial View
- •Saving Named Views
- •Working with Tiled Viewports
- •Using Snap Rotation
- •Understanding User Coordinate Systems
- •Creating Isometric Drawings
- •Summary
- •Editing a Drawing
- •Selecting Objects
- •Summary
- •Copying and Moving Objects
- •Resizing Commands
- •Using Construction Commands
- •Creating a Revision Cloud
- •Hiding Objects with a Wipeout
- •Double-Clicking to Edit Objects
- •Grips
- •Editing with the Properties Palette
- •Selection Filters
- •Groups
- •Summary
- •Working with Layers
- •Changing Object Color, Linetype, and Lineweight
- •Working with Linetype Scales
- •Importing Layers and Linetypes from Other Drawings
- •Matching Properties
- •Summary
- •Drawing-Level Information
- •Object-Level Information
- •Measurement Commands
- •AutoCAD’s Calculator
- •Summary
- •Creating Single-Line Text
- •Understanding Text Styles
- •Creating Multiline Text
- •Creating Tables
- •Inserting Fields
- •Managing Text
- •Finding Text in Your Drawing
- •Checking Your Spelling
- •Customizing the spelling dictionary
- •Summary
- •Working with Dimensions
- •Drawing Linear Dimensions
- •Drawing Aligned Dimensions
- •Creating Baseline and Continued Dimensions
- •Dimensioning Arcs and Circles
- •Dimensioning Angles
- •Creating Ordinate Dimensions
- •Drawing Leaders
- •Using Quick Dimension
- •Editing Dimensions
- •Summary
- •Understanding Dimension Styles
- •Defining a New Dimension Style
- •Changing Dimension Styles
- •Creating Geometric Tolerances
- •Summary
- •Creating and Editing Polylines
- •Drawing and Editing Splines
- •Creating Regions
- •Creating Boundaries
- •Creating Hatches
- •Creating and Editing Multilines
- •Creating Dlines
- •Using the SKETCH Command
- •Digitizing Drawings with the TABLET Command
- •Summary
- •Preparing a Drawing for Plotting or Printing
- •Creating a Layout in Paper Space
- •Working with Plot Styles
- •Plotting a Drawing
- •Summary
- •Combining Objects into Blocks
- •Inserting Blocks and Files into Drawings
- •Managing Blocks
- •Creating and Using Dynamic Blocks
- •Using Windows Features
- •Working with Attributes
- •Summary
- •Understanding External References
- •Editing an Xref within Your Drawing
- •Controlling Xref Display
- •Managing Xrefs
- •Summary
- •Preparing for Database Connectivity
- •Connecting to Your Database
- •Linking Data to Drawing Objects
- •Creating Labels
- •Querying with the Query Editor
- •Working with Query Files
- •Summary
- •Working with 3D Coordinates
- •Using Elevation and Thickness
- •Working with the User Coordinate System
- •Summary
- •Working with the Standard Viewpoints
- •Using DDVPOINT
- •Working with the Tripod and Compass
- •Displaying a Quick Plan View
- •Shading Your Drawing
- •Using 3D Orbit
- •Using Tiled Viewports
- •Defining a Perspective View
- •Laying Out 3D Drawings
- •Summary
- •Drawing Surfaces with 3DFACE
- •Drawing Surfaces with PFACE
- •Creating Polygon Meshes with 3DMESH
- •Drawing Standard 3D Shapes
- •Drawing a Revolved Surface
- •Drawing an Extruded Surface
- •Drawing Ruled Surfaces
- •Drawing Edge Surfaces
- •Summary
- •Drawing Standard Shapes
- •Creating Extruded Solids
- •Drawing Revolved Solids
- •Creating Complex Solids
- •Sectioning and Slicing Solids
- •Using Editing Commands in 3D
- •Editing Solids
- •Listing Solid Properties
- •Summary
- •Understanding Rendering
- •Creating Lights
- •Creating Scenes
- •Working with Materials
- •Using Backgrounds
- •Doing the Final Render
- •Summary
- •Accessing Drawing Components with the DesignCenter
- •Accessing Drawing Content with Tool Palettes
- •Setting Standards for Drawings
- •Organizing Your Drawings
- •Working with Sheet Sets
- •Maintaining Security
- •Keeping Track of Referenced Files
- •Handling Errors and Crashes
- •Managing Drawings from Prior Releases
- •Summary
- •Importing and Exporting Other File Formats
- •Working with Raster Images
- •Pasting, Linking, and Embedding Objects
- •Summary
- •Sending Drawings
- •Opening Drawings from the Web
- •Creating Object Hyperlinks
- •Publishing Drawings
- •Summary
- •Working with Customizable Files
- •Creating Keyboard Shortcuts for Commands
- •Customizing Toolbars
- •Customizing Tool Palettes
- •Summary
- •Creating Macros with Script Files
- •Creating Slide Shows
- •Creating Slide Libraries
- •Summary
- •Creating Linetypes
- •Creating Hatch Patterns
- •Summary
- •Creating Shapes
- •Creating Fonts
- •Summary
- •Working with the Customization File
- •Customizing a Menu
- •Summary
- •Introducing Visual LISP
- •Getting Help in Visual LISP
- •Working with AutoLISP Expressions
- •Using AutoLISP on the Command Line
- •Creating AutoLISP Files
- •Summary
- •Creating Variables
- •Working with AutoCAD Commands
- •Working with Lists
- •Setting Conditions
- •Managing Drawing Objects
- •Getting Input from the User
- •Putting on the Finishing Touches
- •Summary
- •Understanding Local and Global Variables
- •Working with Visual LISP ActiveX Functions
- •Debugging Code
- •Summary
- •Starting to Work with VBA
- •Writing VBA Code
- •Getting User Input
- •Creating Dialog Boxes
- •Modifying Objects
- •Debugging and Trapping Errors
- •Moving to Advanced Programming
- •Summary
- •A Final Word
- •Installing AutoCAD and AutoCAD LT
- •Configuring and Using Workspaces
- •Configuring AutoCAD
- •Starting AutoCAD Your Way
- •Configuring a Plotter
- •Discovering AutoCAD and AutoCAD LT
- •Accessing Technical Support
- •Autodesk User Groups
- •Internet Resources
- •System Requirements
- •Using the CD-ROM with Microsoft Windows
- •What’s on the CD-ROM
- •Troubleshooting
- •Index
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
