AutoCAD Platform Customization: VBA

Book description

Boost productivity and streamline your workflow with expert AutoCAD: VBA programming instruction

AutoCAD Platform Customization: VBA is the definitive guide to personalizing AutoCAD and the various programs that run on the AutoCAD platform, including AutoCAD Architecture, Civil 3D, Plant 3D, and more. Written by an Autodesk insider with years of customization and programming experience, this book features detailed discussions backed by real-world examples and easy-to-follow tutorials that illustrate each step in the personalization process. Readers gain expert guidance toward managing layouts and external references, changing the menu and other interface items, creating forms, and communicating with Office applications—all designed to streamline the workspace and improve productivity. An additional resources appendix, downloadable datasets, and customization examples provide extra information and tools that allow users to implement the most advanced customizations.

Autodesk's AutoCAD platform is the basis for much of the software that is integral to the modern design and engineering processes. VBA allows users to customize the AutoCAD interface and other features to increase screen real estate, create macros, validate drawing information, and more, leaving less repetition, fewer distractions, and more time for design. AutoCAD Platform Customization: VBA walks readers through the many options available, teaching them to:

  • Create, modify, annotate, and view drawing objects

  • Interact comfortably with the application, open documents, and the user

  • Manage external data, communicate with other applications, and define user forms

  • Debug custom programs and handle errors

  • Customization allows users to keep their favorite tools at their fingertips, and put away the ones they don't need. For AutoCAD users looking to streamline their workflow, AutoCAD Platform Customization: VBA provides expert instruction and insider advice.

    Table of contents

    1. Title Page
    2. Copyright
    3. Dedication
    4. Acknowledgments
    5. About the Author
    6. Introduction
      1. About This Book
      2. Is This Book for You?
      3. VBA in AutoCAD
      4. What to Expect
      5. Other Information
      6. Styles and Conventions of This Book
      7. Contacting the Author
    7. Chapter 1: Understanding the AutoCAD VBA Environment
      1. What Makes Up an AutoCAD VBA Project?
      2. What You'll Need to Start
      3. Getting Started with the VBA Editor
      4. Managing VBA Programs
      5. Executing VBA Macros
      6. Accessing the AutoCAD VBA Documentation
    8. Chapter 2: Understanding Visual Basic for Applications
      1. Learning the Fundamentals of the VBA Language
      2. Exploring Data Types
      3. Comparing Values
      4. Conditionalizing and Branching Statements
      5. Repeating and Looping Expressions
    9. Chapter 3: Interacting with the Application and Documents Objects
      1. Working with the Application
      2. Managing Documents
      3. Working with System Variables
      4. Querying and Setting Application and Document Preferences
      5. Executing Commands
      6. Exercise: Setting Up a Project
    10. Chapter 4: Creating and Modifying Drawing Objects
      1. Understanding the Basics of a Drawing-Based Object
      2. Accessing Objects in a Drawing
      3. Working with Model or Paper Space
      4. Creating Graphical Objects
      5. Getting an Object in the Drawing
      6. Modifying Objects
      7. Changing Object Properties
      8. Exercise: Creating, Querying, and Modifying Objects
    11. Chapter 5: Interacting with the User and Controlling the Current View
      1. Interacting with the User
      2. Selecting Objects
      3. Performing Geometric Calculations
      4. Changing the Current View
      5. Exercise: Getting Input from the User to Draw the Plate
    12. Chapter 6: Annotating Objects
      1. Working with Text
      2. Dimensioning Objects
      3. Creating and Modifying Geometric Tolerances
      4. Adding Leaders
      5. Organizing Data with Tables
      6. Creating Fields
      7. Exercise: Adding a Label to the Plate
    13. Chapter 7: Working with Blocks and External References
      1. Managing Block Definitions
      2. Inserting and Working with Block References
      3. Managing External References
      4. Listing File Dependencies
      5. Exercise: Creating and Querying Blocks
    14. Chapter 8: Outputting Drawings
      1. Creating and Managing Layouts
      2. Displaying Model Space Objects with Viewports
      3. Controlling the Output of a Layout
      4. Plotting and Previewing a Layout
      5. Exporting and Importing File Formats
      6. Exercise: Adding a Layout to Create a Check Plot
    15. Chapter 9: Storing and Retrieving Custom Data
      1. Extending Object Information
      2. Creating and Modifying a Custom Dictionary
      3. Storing Information in the Windows Registry
      4. Exercise: Storing Custom Values for the Room Labels Program
    16. Chapter 10: Modifying the Application and Working with Events
      1. Manipulating the AutoCAD User Interface
      2. Using External Custom Programs
      3. Working with Events
      4. Exercise: Extending the User Interface and Using Events
    17. Chapter 11: Creating and Displaying User Forms
      1. Adding and Designing a User Form
      2. Placing and Arranging Controls on a User Form
      3. Changing the Appearance of a User Form or Control
      4. Defining the Behavior of a User Form or Control
      5. Displaying and Loading a User Form
      6. Exercise: Implementing a User Form for the DrawPlate Project
    18. Chapter 12: Communicating with Other Applications
      1. Referencing a Programming Library
      2. Creating and Getting an Instance of an Object
      3. Accessing a Drawing File from outside of AutoCAD
      4. Working with Microsoft Windows
      5. Reading and Writing Text Files
      6. Parsing Content in an XML File
      7. Working with Microsoft Office Applications
      8. Exercise: Reading and Writing Data
    19. Chapter 13: Handling Errors and Deploying VBA Projects
      1. Catching and Identifying Errors
      2. Debugging a VBA Project
      3. Deploying a VBA Project
      4. Exercise: Deploying the DrawPlate VBA Project
    20. End User License Agreement

    Product information

    • Title: AutoCAD Platform Customization: VBA
    • Author(s):
    • Release date: May 2015
    • Publisher(s): Sybex
    • ISBN: 9781118798935