: Joe Sutphin
: AutoCAD 2006 VBA A Programmer's Reference
: Apress
: 9781430200697
: 2
: CHF 93.70
:
: Informatik
: English
: 744
: Wasserzeichen/DRM
: PC/MAC/eReader/Tablet
: PDF
* Second Edition of the comprehensive and highly respected guide to the AutoCAD VBA language.

* Suitable for all skill levels, novice and advanced power users.

* A complete reference for the AutoCAD 2006 object model, it shows you how to connect to other VBA-enabled applications, such as Word and Excel, and use the using the Win32 API to further extend your applications.



Joe Sutphin's background includes more than 20 years in the machinery manufacturing industry. He has more than 14 years of computer-aided design experience with more than eight years of AutoCAD-specific experience. Joe is an Autodesk registered developer, and his work has appeared in the pages of Cadence and Cadalyst magazines. He has been programming for over 10 years, with the last five years spent focusing on Visual Basic. In 1998, he collaborated with Microsoft on a Visual Basic application case study.
Contents6
About the Author23
About the Technical Reviewers24
Acknowledgments25
Introduction26
Chapter 1 The VBA Integrated Development Environment (VBAIDE)28
Visual Basic Concepts28
Windows, Events, and Messages28
Event-Driven vs. Procedural Programming29
Developing Your Applications Interactively30
Starting the Editor30
Exploring the User Interface31
The Project Explorer32
The Code Window32
The Properties Window33
The Object and Procedure Boxes33
The Immediate Window34
The Options Dialog Box35
Managing Projects36
Project Structure36
Creating,Opening, and Saving Projects37
Adding, Saving, and Removing Files39
Adding ActiveX Controls and Code Components40
The Object Browser42
Overview of AutoCAD VBA Commands49
Summary49
Chapter 2 Introduction to Visual Basic Programming50
Variables50
Declaring Variables50
Variable Scope and Lifetime52
Data Types54
Introduction to Arrays56
Modules58
UserForm58
Standard58
Class59
Procedures59
Calling Procedures61
Passing Arguments to Procedures61
Control Structures61
Decision Structures61
Select Case63
Loop Structures64
Do While ... Loop64
Do ... Loop While65
Do Until ... Loop and Do Loop ... Until65
For ... Each ... Next67
Nested Control Structures67
Exiting a Control Structure68
Exiting a Sub or Function Procedure69
With ... End With69
Application Writing Techniques70
Writing Statements on Multiple Lines70
Combining Statements on a Single Line70
Adding Comments to Your Code71
Overview of Object-Oriented Programming71
Objects and Classes71
Object Data72
Private Variables72
Public Variables72
An Object s Behavior72
Debugging Basics73
Summary80
Chapter 3 Application Elements81
Designing a UserForm81
Adding a UserForm to Your Application81
Setting UserForm Properties82
Adding a Control to a Form84
Visual Basic ActiveX Controls86
TextBox87
ListBox88
CheckBox88
OptionButton89
ToggleButton89
Frame90
CommandButton90
Additional ActiveX Controls90
TabStrip90
MultiPage91
ScrollBar91
SpinButton91
Image91
Summary92
Chapter 4 AutoCAD Events93
Application-Level Events93
Document-Level Events96
The BeginCommand and EndCommand Events97
The BeginOpen and EndOpen Events98
The BeginClose and BeginDocClose Events98
The Activate and Deactivate Events99
The BeginSave and EndSave Events99
Object-Level Events99
Summary100
Chapter 5 User Preferences101
Getting and Setting Support Path(s)103
Controlling Cursor Size104
Getting and Setting the AutoSaveInterval Property104
Getting and Setting the Drawing Template File Path105
Getting and Setting the Printer Support Path105
Getting and Setting the File SaveAs Type106
Enabling and Disabling the Startup Dialog Box108
Saving and Retrieving Personal Preferences109
User Preferences Changes in AutoCAD 2004110
Summary111
Chapter 6 Controlling Layers and Linetypes112
Layers112
Accessing Layers113
Iterating Layers113
Checking for Existing Layers114
Creating a New Layer116
Making a Layer Active117
Turning a Layer On/Off119
Setting a Layer to Be Frozen or Thawed120
Locking/Unlocking a Layer120
Making Layers Plottable121
Renaming a Layer121
Deleting a Layer122
Getting a Layer s Handle123
Layer Colors123
Layer Linetypes124
Layer Lineweights125
Linetypes125
Accessing Linetypes126
Checking for Existing Linetypes127
Loading a Linetype128
Making a Linetype Active130
Renaming a Linetype131
Deleting a Linetype132
Getting a Linetype s Handle133
Changing a Linetype s Description133
Scaling Linetypes134
Summary135
Chapter 7 User Interaction and the Utility Object136
Interface Methods136
Input Methods and Dialogs136
The PromptMethod138
The InitializeUserInputMethod138
Handling Errors in User Input153
Conversion Methods154
The AngleToRealMethod154
The AngleToStringMethod155
The DistanceToRealMethod155
The RealToStringMethod156
The AngleFromXAxisMethod157
The PolarPointMethod158
The TranslateCoordinatesMethod159
Internet Methods161
The IsURLMethod161
The LaunchBrowserDialogMethod162
The GetRemoteFileMethod164
The IsRemoteFileMethod165
The PutRemoteFileMethod165
Summary166
Chapter 8 Drawing Objects167