This book will help you take full advantage of the Visual Basic for Applications programming environment within AutoCAD 2006. Whether you want to automate routine tasks, or create sophisticated applications or design that can be generated programmatically, this book will empower you to make AutoCAD work for you.
This book is also suitable if you’re a power user who wants to make use of the advanced features of AutoCAD 2006 VBA, and you need a fast reference for the full AutoCAD object model. You’ll learn to run Autodesk design tasks in the embedded VBA environment. This book is loaded with source code examples, and gives you no matter your skill level the necessary tools to accomplish your AutoCAD 2006 automation tasks.
Le informazioni nella sezione "Riassunto" possono far riferimento a edizioni diverse di questo titolo.
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.
AutoCAD 2006 VBA
A Programmer’s
Reference
Joe Sutphin
AutoCAD 2006 VBA: A Programmer’s Reference
Copyright © 2005 by Joe Sutphin
All rights reserved. No part of this work may be reproduced or transmitted in any form or by any means,
electronic or mechanical, including photocopying, recording, or by any information storage or retrieval
system, without the prior written permission of the copyright owner and the publisher.
ISBN: 1-59059-579-3
Library of Congress Cataloging-in-Publication data is available upon request.
Printed and bound in the United States of America 9 8 7 6 5 4 3 2 1
Trademarked names may appear in this book. Rather than use a trademark symbol with every occurrence
of a trademarked name, we use the names only in an editorial fashion and to the benefit of the trademark
owner, with no intention of infringement of the trademark.
Lead Editor: Tony Davis
Technical Reviewers: Phillip Ash, Steve Johnson
Editorial Board: Steve Anglin, Dan Appleman, Ewan Buckingham, Gary Cornell, Tony Davis,
Jason Gilmore, Jonathan Hassell, Chris Mills, Dominic Shakeshaft, Jim Sumser
Associate Publisher: Grace Wong
Project Manager: Kylie Johnston
Copy Edit Manager: Nicole LeClerc
Copy Editors: Candace English, Kim Wimpsett
Assistant Production Director: Kari Brooks-Copony
Production Editor: Janet Vail
Compositor: Linda Weidemann, Wolf Creek Press
Proofreaders: Linda Seifert and Sue Boshers
Indexer: Broccoli Information Management
Interior Designer: Van Winkle Design Group
Cover Designer: Kurt Krames
Manufacturing Manager: Tom Debolski
Distributed to the book trade worldwide by Springer-Verlag New York, Inc., 233 Spring Street, 6th Floor,
New York, NY 10013. Phone 1-800-SPRINGER, fax 201-348-4505, e-mail orders-ny@springer-sbm.com, or
visit http://www.springeronline.com.
For information on translations, please contact Apress directly at 2560 Ninth Street, Suite 219, Berkeley,
CA 94710. Phone 510-549-5930, fax 510-549-5939, e-mail info@apress.com, or visit http://www.apress.com.
The information in this book is distributed on an “as is” basis, without warranty. Although every precaution
has been taken in the preparation of this work, neither the author(s) nor Apress shall have any liability to
any person or entity with respect to any loss or damage caused or alleged to be caused directly or indirectly
by the information contained in this work.
The source code for this book is available to readers at http://www.apress.com in the Source Code section.
Contents at a Glance
About the Author . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xxv
About the Technical Reviewers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xxvii
Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xxix
Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xxxi
■CHAPTER 1 The VBA Integrated Development Environment (VBAIDE) . . . . . . . . . 1
■CHAPTER 2 Introduction to Visual Basic Programming . . . . . . . . . . . . . . . . . . . . . . 23
■CHAPTER 3 Application Elements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55
■CHAPTER 4 AutoCAD Events . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67
■CHAPTER 5 User Preferences . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75
■CHAPTER 6 Controlling Layers and Linetypes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87
■CHAPTER 7 User Interaction and the Utility Object . . . . . . . . . . . . . . . . . . . . . . . . 111
■CHAPTER 8 Drawing Objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 143
■CHAPTER 9 Creating 3-D Objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 173
■CHAPTER 10 Editing Objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 205
■CHAPTER 11 Dimensions and Annotations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 231
■CHAPTER 12 Selection Sets and Groups . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 259
■CHAPTER 13 Blocks, Attributes, and External References . . . . . . . . . . . . . . . . . . . 285
■CHAPTER 14 Views and Viewports. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 321
■CHAPTER 15 Layout and Plot Configurations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 337
■CHAPTER 16 Controlling Menus and Toolbars . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 355
■CHAPTER 17 Drawing Security . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 383
■CHAPTER 18 Using the Windows API. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 391
■CHAPTER 19 Connecting to External Applications . . . . . . . . . . . . . . . . . . . . . . . . . . 403
■CHAPTER 20 Creating Tables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 415
■CHAPTER 21 The SummaryInfo Object. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 427
■CHAPTER 22 An Illustrative VBA Application . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 437
■APPENDIX A AutoCAD Object Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 447
■APPENDIX B AutoCAD Constants Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 631
■APPENDIX C System Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 671
■INDEX . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 697 v
Le informazioni nella sezione "Su questo libro" possono far riferimento a edizioni diverse di questo titolo.
GRATIS per la spedizione in U.S.A.
Destinazione, tempi e costiEUR 3,84 per la spedizione in U.S.A.
Destinazione, tempi e costiDa: SecondSale, Montgomery, IL, U.S.A.
Condizione: Very Good. Item in very good condition! Textbooks may not include supplemental items i.e. CDs, access codes etc. Codice articolo 00073196748
Quantità: 1 disponibili
Da: ThriftBooks-Dallas, Dallas, TX, U.S.A.
Hardcover. Condizione: Very Good. No Jacket. May have limited writing in cover pages. Pages are unmarked. ~ ThriftBooks: Read More, Spend Less 3.1. Codice articolo G1590595793I4N00
Quantità: 1 disponibili
Da: Toscana Books, AUSTIN, TX, U.S.A.
Hardcover. Condizione: new. Excellent Condition.Excels in customer satisfaction, prompt replies, and quality checks. Codice articolo Scanned1590595793
Quantità: 1 disponibili
Da: BennettBooksLtd, North Las Vegas, NV, U.S.A.
hardcover. Condizione: New. In shrink wrap. Looks like an interesting title! Codice articolo Q-1590595793
Quantità: 1 disponibili
Da: Lucky's Textbooks, Dallas, TX, U.S.A.
Condizione: New. Codice articolo ABLIING23Mar2811580082147
Quantità: Più di 20 disponibili
Da: BuchWeltWeit Ludwig Meier e.K., Bergisch Gladbach, Germania
Buch. Condizione: Neu. This item is printed on demand - it takes 3-4 days longer - Neuware -\* 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. 744 pp. Englisch. Codice articolo 9781590595794
Quantità: 2 disponibili
Da: Ria Christie Collections, Uxbridge, Regno Unito
Condizione: New. In. Codice articolo ria9781590595794_new
Quantità: Più di 20 disponibili
Da: AHA-BUCH GmbH, Einbeck, Germania
Buch. Condizione: Neu. nach der Bestellung gedruckt Neuware - Printed after ordering - This book will help you take full advantage of the Visual Basic for Applications programming environment within AutoCAD 2006. Whether you want to automate routine tasks, or create sophisticated applications or design that can be generated programmatically, this book will empower you to make AutoCAD work for you.This book is also suitable if you're a power user who wants to make use of the advanced features of AutoCAD 2006 VBA, and you need a fast reference for the full AutoCAD object model. You'll learn to run Autodesk design tasks in the embedded VBA environment. This book is loaded with source code examples, and gives you no matter your skill level the necessary tools to accomplish your AutoCAD 2006 automation tasks. Codice articolo 9781590595794
Quantità: 2 disponibili
Da: moluna, Greven, Germania
Condizione: New. Second Edition of the comprehensive and highly respected guide to the AutoCAD VBA languageSuitable for all skill levels, novice and advanced power usersA complete reference for the AutoCAD 2006 object model, it shows you how to connect to o. Codice articolo 458520171
Quantità: Più di 20 disponibili
Da: Books Puddle, New York, NY, U.S.A.
Condizione: New. pp. 780. Codice articolo 26478092
Quantità: 4 disponibili