Free Ebook VBA for AutoCAD 2002: Writing AutoCAD MacrosBy Jeffrey E. Clark
The utmost sales letter will offer you a distinct publication to overcome you life to a lot better. Book, as one of the recommendation to obtain many sources can be thought about as one that will attach the life to the experience to the understanding. By having book to review, you have actually tried to connect your life to be far better. It will encourage your high quality not just for your life but likewise individuals around you.
VBA for AutoCAD 2002: Writing AutoCAD MacrosBy Jeffrey E. Clark
Free Ebook VBA for AutoCAD 2002: Writing AutoCAD MacrosBy Jeffrey E. Clark
Introducing a new hobby for other people may inspire them to join with you. Reading, as one of mutual hobby, is considered as the very easy hobby to do. But, many people are not interested in this hobby. Why? Boring is the reason of why. However, this feel actually can deal with the book and time of you reading. Yeah, one that we will refer to break the boredom in reading is choosing VBA For AutoCAD 2002: Writing AutoCAD MacrosBy Jeffrey E. Clark as the reading material.
That's a very common condition. To conquer this contains, what should do? Reading a book? Surely? Why not? Publication is just one of the resources that many people trust fund of it. Even it will certainly rely on guide kind and title, or the author; books always have positive thoughts and minds. VBA For AutoCAD 2002: Writing AutoCAD MacrosBy Jeffrey E. Clark is one of the choices for you to earn you looking forward for your life. As understood, reviewing will certainly lead you for a better means. The manner in which you take certainly will certainly be analogously with your instance.
As recognized, to finish this book, you might not have to get it at the same time in a day. Doing the activities along the day might make you really feel so bored. If you attempt to require reading, you might favor to do various other entertaining tasks. But, one of ideas we desire you to have this book is that it will not make you really feel bored. Really feeling burnt out when reading will be just unless you don't such as guide. VBA For AutoCAD 2002: Writing AutoCAD MacrosBy Jeffrey E. Clark really uses just what everyone desires.
Be various with other individuals who don't read this publication. By taking the great advantages of reviewing VBA For AutoCAD 2002: Writing AutoCAD MacrosBy Jeffrey E. Clark, you can be a good idea to invest the time for reviewing various other publications. And also below, after getting the soft fie of VBA For AutoCAD 2002: Writing AutoCAD MacrosBy Jeffrey E. Clark and also offering the link to provide, you could likewise discover other book collections. We are the best area to seek for your referred publication. And also currently, your time to obtain this book as one of the compromises has been ready.
VBA for AutoCAD 2002: Writing AutoCAD Macros helps you leverage the full power of AutoCAD and VBA to automate complex design tasks, integrate design data across the enterprise, and solve more challenging problems than ever before. Discover how AutoCAD and VBA work together in the real world¾and apply VBAÕs power to everything from 2D and 3D graphic objects to dimensioning, PaperSpace to database, and Web integration!
- Sales Rank: #3842084 in Books
- Color: Cream
- Published on: 2001-12-20
- Original language: English
- Number of items: 1
- Dimensions: 9.10" h x 1.60" w x 6.90" l, 2.28 pounds
- Binding: Paperback
- 752 pages
From the Back Cover
The practical, realistic guide to AutoCAD problem solving with VBA.
- Make AutoCAD do more than you ever thought possible!
- Automate your most complex design tasks
- Integrate design data with enterprise systems, databases, and the Internet
- Control PaperSpace, Viewports, and plotting
- Build a complete AutoCAD database application—step-by-step
AutoCAD 2002 isn't just the world's #1 design and drafting tool. It's a powerful, programmable platform for automating complex design tasks, integrating design data with enterprise information systems, and solving a wide range of technical and business problems. The key to all that power is Visual Basic for Applications. And the key to AutoCAD VBA programming is in your hands: VBA for AutoCAD 2002: Writing AutoCAD Macros.
Clark ties together AutoCAD's key tools and VBA's capabilities as never before, showing how AutoCAD and VBA work together in the real world — and helping you create real-world applications faster than you ever thought possible. One step at a time, you'll:
- Take control of AutoCAD: master the fundamentals of automation, COM, and object-oriented programming
- Get comfortable with AutoCAD's VBA Interactive Development Environment
- Go under the hood with DXF to understand the structure of AutoCAD's drawing database
- Master the AutoCAD object model: documents, user interface, file management, collections, objects, and beyond
- Automate 2D and 3D graphic objects, external references, entities, modeled solids, dimensions, and events
- Use VBA to control PaperSpace, Viewports, and plotting
- Extend VBA to communicate with other applications and across the Internet
Deepen your skills with a start-to-finish case study application that integrates an AutoCAD drawing with a Microsoft Access database using Microsoft's Data Access Objects (DAO) technology. VBA for AutoCAD 2002: Writing AutoCAD Macros also contains concise references to AutoCAD system and enumerated variables, object inheritance, and graphical entities. If you're ready to leverage all the power built into AutoCAD 2002, this is the book you've been searching for!
About the Author
JEFFREY E. CLARK is project manager with a national consulting and systems integration firm specializing in facility management. He writes Visual Basic/VBA code on a daily basis to help create and maintain facility databases. An AutoCAD user for over 15 years, Clark has developed several commercial AutoCAD applications. His work has been featured in publications ranging from Cadalyst to Facilities Design & Management to PC Magazine.
Excerpt. © Reprinted by permission. All rights reserved.
Preface
Data management has been a central focus of mine throughout most of my 30-plus-year career. As an architect engaged mostly in working with business managers, helping them define their project needs (Should I build, lease, expand, or what? ... And how much do I need?), I needed a computer early on. I began using BASIC in 1970, on a timesharing network, to manage the data I collected and to produce reports.
Thus began my involvement with the BASIC language. I have used many dialects, from the line-numbered, Beginners All-purpose Symbolic Instruction Code that came out of Dartmouth University around 1960, to the modern versions of VB and VBA. These are now among the favored languages for communicating with relational databases such as Oracle, SQL Server, and the like, and for creating content for the Internet.
BASIC was so-named because, as an interpreted language, it was easy to learn by incrementally developing a program, entering a few lines of code at a time, and then testing the result. At the time, however, many professional programmers thought it to be something of a toy. Mr. Gates, on the other hand, was a strong supporter of the language, introducing three levels of BASIC with the first IBM PC in 1981. Cassette BASIC was hardwired into the machines' ROM, and you could only save files to a cassette tape. (I never actually did that!)
The disk and advanced levels were built into Microsoft's first version of its operating system: MS-DOS 1.0. A BASIC compiler (BASCOM) was introduced shortly thereafter, which produced executable programs in .EXE format.
Late in the 1980s, QuickBasic was introduced with the first Interactive Development Environment (IDE) for DOS. This was followed in 1991 by Visual Basic 1.0, in both DOS and Windows versions. Visual Basic (VB) continues its growth in popularity.
Microsoft Word and Excel were the first components of Microsoft Office, and each had its own internal functionality for creating macros, essentially scripts that allowed certain procedures to be automated within the application. Visual Basic for Applications (VBA) was first introduced in Excel in 1993. With the addition of Access, PowerPoint, and other products to the mix, VBA now provides an object-oriented programming environment common to all the Office components. This not only allows the creation of macros within each of the applications, but macros that allow Access, for example, to actually start up and communicate with Excel.
The AutoCAD WorldAutoCAD is and always has been a database program. Underlying its graphic interface are lists within lists that define the entities that make up your drawing. During its evolution into a fully Windows-compatible product, many new data-oriented features were added.
Initially conceived as a drafting package and written by engineers, AutoCAD was designed with an accessible data structure that allows both the manipulation of its graphic entities as well as the attachment and extraction of textual and numeric data. Attribute extraction using AutoLISP was at first the only means of manipulating the data within the drawing, and this method was widely used in the DOS days of the mid-1980s, when I began using the application. The AutoCAD SQL Extension (ASE), introduced with Release 12 in the early 90s, provided a rudimentary interface to databases such as DBASE and PARADOX.
AutoCAD was recast in object-oriented C++ with Release 13 and the introduction of the AutoCAD Runtime Extension (ARX). Using ARX requires a programmer capable of creating DLLs using C++, which the average AutoCAD user is not. About the same time, however, AutoCAD users began experimenting with programs written in Visual Basic 3.0 using Dynamic Data Exchange (DDE). Curiously, support for a more robust connection between VB and AutoCAD had been provided in Release 12, but was dropped in Release 13. Autodesk added support for Microsoft's ActiveX Automation interface standard to Release 14, first allowing VBA access to AutoCAD objects.
Autodesk initially released AutoCAD 2000 in the spring of 1999, fully incorporating VBA. Further enhancements focusing on Internet functionality were a feature of the 2000i release in the summer of 2000. The development environment has a look and feel identical to that of any Microsoft Office component. With this convergence, the ability to write AutoCAD macros and communicate with other VBA-enabled applications is now fully accessible to the user.
Now, with the release of AutoCAD 2002, Autodesk has adopted a policy of regular releases, incorporating "technology extensions" in the form of incremental upgrades. The extensions added over each period of time will be incorporated into the latest modular release.
Who This Book Is ForAutoCAD 2002 is the flagship product of Autodesk, which, according to the company's web page "is the world's leading supplier of PC design software and digital content creation." Since its initial release in 1982, well over two million copies of AutoCAD have been shipped. There are nearly 1000 Autodesk Training Centers worldwide, and over one million students are trained on Autodesk products each year.
Eighty five percent of the companies in the Fortune 500 are Autodesk customers, and the firm's products are available in 19 languages. There are, according to Autodesk, over 200 user groups worldwide, along with almost 3000 registered developers.
There are also countless unregistered developers who have no formal relationship with Autodesk. They produce add-ons and customizations both for sale and for their own and their companies' use. The CAD Manager who needs to convert the layers of several hundred drawings received from another consultant is a potential AutoCAD developer. The Facility Manager who needs to link drawing attributes representing occupied and available areas to an Excel spreadsheet can now use VBA to accomplish this.
Automation using VBA allows the user to work on the AutoCAD side, or the Excel side, or in some other application, whichever he or she is more comfortable with. I have routinely used VBA to write SQL scripts to populate database tables, as well accessing and modifying drawings in AutoCAD. I used to do many of these things in AutoLISP, which was the only act in town for 15 years.
This book is for the AutoCAD and Office user who has problems to solve. Users who are already programmers can use it to familiarize themselves with the AutoCAD object model. Users who are not programmers will be able to get started by studying the book's examples.
My paramount goal, more than just presenting the components of VBA, is to tie together the disparate elements of AutoCAD with which you must be reasonably comfortable in order to use VBA effectively. The AutoCAD documentation treats, in unrelated discussions, many of those features that need to work in concert to get a job done. Understanding the DXF file representation, for example, together with some of the basic syntax of AutoLISP as it relates to the underlying database structure, provides the keys to unlocking the AutoCAD drawing and manipulating its data. It is the purpose of this book to provide those necessary links.
What's in the Book?VBA for AutoCAD 2002: Writing AutoCAD Macros is divided into three major sections:
There are four appendices containing additional reference material as well as some supplemental utilities and examples. Part Two, Using the AutoCAD Object Model, is by far the longest section, in which the application's numerous collections and objects will be discussed in detail.
The following outline gives you an overview of what you can expect to see in each chapter.
Part One: The AutoCAD VBA EnvironmentChapter 1, Taking Control of AutoCAD, introduces you to some of the concepts of Automation and Microsoft's Component Object Model (COM). In it we will talk about what we mean by object-oriented programming; its tripartite foundation of encapsulation, inheritance, and polymorphism; and define such terms as class, interface, and binding. We will look at a programming example that reads data from an Excel worksheet and creates an AutoCAD drawing with it, without either application being visible, in 30 lines of code. Finally, we will introduce a system that we will use to chart all of AutoCAD's methods, properties, and events, categorizing them in a concise reference format that will be used throughout the book.
Chapter 2, The VBA Environment, shows you how to use the Interactive Development Environment (IDE); how to create, edit, and save VBA projects; and differentiates between global and embedded projects.
Chapter 3, DXF: Key to the Drawing Structure, goes into some necessary detail about DXF that will add to your understanding of the drawing database. Subclass markers, which are the reflection of AutoCAD's internal object structure, are introduced. We will develop two small VBA projects. One lets you look at selected DXF entity data within an AutoCAD drawing (DWG) file, and the other searches for specified entities in a DXF file. At the end of the chapters we will look at two tiny procedures that do the same thing, one in VBA and one in AutoLISP. You can decide for yourself which is the more accessible of the two languages.
Chapter 4, Elements of the Object Model, introduces the AutoCAD object model. We will talk a little more about Automation interfaces, but will concentrate on taking a high-level view of the collections and objects that VBA offers within AutoCAD.
Part Two: Using the AutoCAD Object ModelChapter 5, Documents and the User Interface, begins our top-down examination of the object model in detail. In the first part of the chapter we will talk about file management: creating, opening, saving, closing, importing, and exporting drawings. Then we will turn our attention to the user interface, discussing how to control your display and how to handle views and viewports.
Chapter 6, Collections and Objects, continues our traversal of the object model with a discussion of the Application and Document objects. We will discuss such document-related functions as layer management and then look at how to manage Collections and access the data within the Objects they contain.
Chapter 7, Utility Objects, concludes our introduction of the AutoCAD object model. In this chapter we will concentrate on functions related to creating and editing drawing data, such as Selection Sets: How to select entities in the drawing in order to do something to them. The utility object includes methods for acquiring and converting the formats of data and accessing the Internet.
Chapter 8, Blocks and External References, prefaces Chapters 9-11, which deal with the AutoCAD graphic objects, or entities, both two- and three-dimensional. Blocks are complete AutoCAD drawings that have been inserted into other drawings, as symbols in many instances. We discuss Attributes in this chapter, which provide one of the means by which alphanumeric data can be stored and accessed in AutoCAD drawings.
External References, which are similar to blocks, exist when other drawings are not actually inserted, but references to them are created so that changes appear automatically when the referenced drawings are updated. In Chapter 8 we will create procedures to rename and redefine XRefs, as they are called, while preserving their insertion instances.
Chapter 9, Entities, covers all 23 basic AutoCAD Entities exclusive of the modeled solids and dimensions. We will dwell at some length upon some of the more interesting ones such as the Multiline, seeing how it is constructed and how to create multiline styles using DXF representation. Both kinds of meshes are treated in detail. We will create a Polyface Mesh from a data table stored in a text file and a Polygon Mesh using an Excel VBA macro and a point matrix stored in a worksheet.
Chapter 10, Solids, covers the 11 three-dimensional entities in the domain of AutoCAD's solid modeler. In addition to constructing them, we will concentrate on the methods for editing them, creating compound objects using Boolean functions, making sections, and slicing. Finally, we will discuss their mass properties, such as moment of inertia, and what these properties mean.
Chapter 11, Dimensions, covers the seven basic dimension types together with the Leader and Tolerance objects. We begin this chapter with a discussion of dimension styles and how to manage them. Creating and using special symbols with the tolerance object for annotation purposes is also covered. The remainder of the chapter is devoted to the dimensioning properties, which are categorized according to AutoCAD's dimension style manager. Each property is defined, along with its corresponding system variable.
Chapter 12, Editing, extends our vocabulary of methods for changing and manipulating AutoCAD objects, such as Copy, Move, and the like. We will spend some time on a subject that is often glossed over, the use of geometric transformation matrices. We will develop a procedure that uses the TransformBy method to dynamically zoom and scale a three-dimensional object.
Chapter 13, Events, deals with AutoCAD's "inflection points," which occur whenever there is a change of state in the application itself, the drawing you are working on, or an entity. You can write VBA subroutines called event handlers that automatically execute whenever the event to which they are connected occurs.
Chapter 14, Forms and Controls, covers the principal user interface with VBA programs. Forms are containers for dialog box controls such as command buttons, list boxes, and the like, through which the user directs the program. After introducing the standard toolbox and some tips for using it, we will spend the balance of the chapter developing a utility application to discover how to integrate the form interface with many of the entity creation and editing functions we have been discussing. The utility application, called Relative, copies or moves selected entities relative to an existing location, using a dialog box. Relative also draws lines and polylines relative to a specified start point.
Chapter 15, PaperSpace and Plotting, will discuss Viewports along with the Plot Configuration and Layout objects, two alternative means of formatting drawings. PaperSpace is AutoCAD's environment intended for setting up drawings to print. We will look at the methods for detecting plotter and media characteristics in order to produce the desired output.
We will develop a plotting application called BatchPlot, which will format (in paper space) and plot multiple drawings with your desired layer settings. You specify the drawings to be printed using either Visual Basic's common dialog box or a list contained in a text file.
Chapter 16, Preferences, deals with parts of the AutoCAD object model that control characteristics of the application itself, its environment, and the means of manipulating it, rather than the drawing itself. These are of two types, preferences stored in the registry, corresponding to the tabs on the AutoCAD's dialog box for user options, plus user options stored in the drawing that can be accessed from other applications without the use of AutoCAD itself.
Chapter 17, Menus, gives you the means of altering AutoCAD's main menu, toolbars, and other menus using VBA.
Part Three: Communicating with Other Applications and the InternetChapter 18, Extensibility, will demonstrate how you can use VBA to communicate with other applications. It covers extended entity data in detail, introducing some concepts and test data that will be used more extensively in Chapter 19's project.
This chapter also covers working in a zero document state, the VBA interface itself, and a brief section on ARX application handling.
Chapter 19, The Facility Project, ties together much of the material presented throughout the book into an application that links an AutoCAD drawing to a Microsoft Access database. The facility project (FP) uses Microsoft's Data Access Objects (DAO) object model to integrate AutoCAD with Access, in order to track area allocation in an office layout.
Chapter 20, The DWF Object Model, will go beyond AutoCAD, using and give you an understanding of how to use this additional functionality in querying and displaying drawings in DWF format over the Internet. AutoCAD's Whip! viewer, which is freely downloadable for displaying drawings in a browser, also has a VBA programming interface.
We will develop an Excel-based procedure that locates a specified floor drawing and room based on a row selection in a worksheet.
AppendicesAppendix A, System Variables: A dictionary of the AutoCAD system variables, other than those pertaining to dimensions covered in Chapter 11.
Appendix B, Enums: A listing of AutoCAD's enumerated variables, defined integer constants used in developing VBA macros.
Appendix C, Object Inheritance: A chart of AutoCAD's COM interface hierarchy.
Appendix D, DXF Reference: A selection of the basic graphical entities as they are represented in DXF format. An Excel VBA application is included that will read your DXF files and list the various sections in a conveniently readable format.
VBA for AutoCAD 2002: Writing AutoCAD MacrosBy Jeffrey E. Clark PDF
VBA for AutoCAD 2002: Writing AutoCAD MacrosBy Jeffrey E. Clark EPub
VBA for AutoCAD 2002: Writing AutoCAD MacrosBy Jeffrey E. Clark Doc
VBA for AutoCAD 2002: Writing AutoCAD MacrosBy Jeffrey E. Clark iBooks
VBA for AutoCAD 2002: Writing AutoCAD MacrosBy Jeffrey E. Clark rtf
VBA for AutoCAD 2002: Writing AutoCAD MacrosBy Jeffrey E. Clark Mobipocket
VBA for AutoCAD 2002: Writing AutoCAD MacrosBy Jeffrey E. Clark Kindle
0 komentar:
Posting Komentar