• Home
  • APP
    • Android
    • IOS
    • Mac
    • Windows
  • AutoCAD
    • DWG Blocks
    • Plans
      • Architecture plan
      • detail plan
      • Structure plan
  • Courses
  • Ebook
    • Architectural
    • Civil Engineering
    • Electrical
    • Math
    • Mechanical
  • Excel Sheets
  • Exercise
  • MOOC
  • Training
  • Videos
    • Tedx
    • Tutorial

Subscribe to Updates

Get the latest creative news

What's Hot

Why Modular Homes Are Becoming the Go-To Choice for Homebuyers

May 1, 2023
The Power of Biomimicry: Discovering Self-Cooling Buildings Inspired by Termites

The Power of Biomimicry: Discovering Self-Cooling Buildings Inspired by Termites

February 1, 2023
Bridge Types

Bridge Types

January 31, 2023
Facebook X (Twitter) Instagram
Facebook X (Twitter) Instagram
Civil Engineering LibraryCivil Engineering Library
  • Home
  • APP
    1. Android
    2. IOS
    3. Mac
    4. Windows
    5. View All
    Architizer: A+ Architecture

    Architizer: A+ Architecture

    August 18, 2021
    Qanvast: Interior Design Ideas

    Qanvast: Interior Design Ideas

    August 16, 2021
    Architecture Books

    Architecture Books

    July 24, 2021
    Basic Civil Engineering Books & Lecture Notes

    Basic Civil Engineering Books & Lecture Notes

    July 24, 2021
    Architizer: A+ Architecture

    Architizer: A+ Architecture

    August 18, 2021
    Qanvast: Interior Design Ideas

    Qanvast: Interior Design Ideas

    August 16, 2021
    Morpholio Trace - Sketch CAD

    Morpholio Trace – Sketch CAD

    August 15, 2021
    Architecture Dictionary - Terms Definitions

    Architecture Dictionary – Terms Definitions

    August 15, 2021
    Architizer: A+ Architecture

    Architizer: A+ Architecture

    August 18, 2021
    Qanvast: Interior Design Ideas

    Qanvast: Interior Design Ideas

    August 16, 2021
    Morpholio Trace - Sketch CAD

    Morpholio Trace – Sketch CAD

    August 15, 2021
    Architecture Dictionary - Terms Definitions

    Architecture Dictionary – Terms Definitions

    August 15, 2021
  • AutoCAD
    1. DWG Blocks
    2. Plans
      • Architecture plan
      • detail plan
      • Structure plan
    Featured
    AutoCAD 2016 and AutoCAD LT 2016
    AutoCAD

    AutoCAD 2016 and AutoCAD LT 2016 – No Experience Required

    By Julia AdamsJune 3, 20210
    Recent
    AutoCAD 2016 and AutoCAD LT 2016

    AutoCAD 2016 and AutoCAD LT 2016 – No Experience Required

    June 3, 2021
    DWG house plan

    Luxury House plan – Architecture Plan

    January 12, 2020
    Free DWG blocks

    Free DWG blocks

    January 12, 2020
  • Courses
  • Ebook
    1. Architectural
    2. Civil Engineering
    3. Electrical
    4. Math
    5. Mechanical
    6. View All
    questions about Aircrete Domes answered by AI

    7 questions about Aircrete Domes answered by AI

    December 22, 2022
    Building Services

    Building Services

    September 19, 2021
    BIOMIMETICS IN ARCHITECTURE - ARCHITECTURE OF LIFE AND BUILDINGS

    BIOMIMETICS IN ARCHITECTURE – ARCHITECTURE OF LIFE AND BUILDINGS

    September 9, 2021
    Construction Technology an illustrated

    Construction Technology an illustrated

    June 22, 2021
    Building Services

    Building Services

    September 19, 2021
    Behavior and Design of Buried Concrete Pipes

    Behavior and Design of Buried Concrete Pipes

    September 19, 2021
    New Zealand Concrete Masonry Manual

    New Zealand Concrete Masonry Manual

    September 8, 2021
    Masonry And Concrete

    Masonry And Concrete

    August 25, 2021
    Useful Formulas with Examples

    Useful Formulas with Examples

    June 6, 2021

    Essential Engineering Mathematics

    December 16, 2019

    Essential Engineering Mathematics

    November 20, 2019
    questions about Aircrete Domes answered by AI

    7 questions about Aircrete Domes answered by AI

    December 22, 2022
    A $100 million solution could save San Francisco's Millennium Tower

    A $100 million solution could save San Francisco’s Millennium Tower

    March 21, 2022
    Understanding and Analysing Trusses

    Understanding and Analysing Trusses

    October 2, 2021
    Building Services

    Building Services

    September 19, 2021
  • Excel Sheets
  • Exercise
  • MOOC
  • Training
  • Videos
    • Tedx
    • Tutorial
Civil Engineering LibraryCivil Engineering Library
Home»Ebook»CAD & BIM»AutoCAD Platform Customization VBA
CAD & BIM

AutoCAD Platform Customization VBA

Thomas GrantBy Thomas GrantJune 7, 2021Updated:June 7, 2021No Comments6 Mins Read
Facebook Twitter Pinterest LinkedIn Tumblr Email Reddit Telegram WhatsApp
AutoCAD Platform Customization VBA
Share
Facebook Twitter LinkedIn Pinterest Email Tumblr Reddit Telegram WhatsApp

Acknowledgments

I have to give a very special thanks to all the great folks at Sybex, especially Willem Knibbe, for working on and helping to get this project off the ground after a few years of talking about it.

The next two people I would like to thank are Mary Ellen Schutz and Dassi Zeidel, the development and production editors on this book; you two made sure I stayed on track and delivered a high-quality book. I also want to thank Liz Welch (copyeditor), Candace Cunningham (proof-reader), and Ted Laux (indexer) for the work you all did on this book.

Thanks to all the folks at Autodesk, who put in the long hours and are dedicated to the work they do on the Autodesk® AutoCAD® product. I cannot forget one of the most important individuals on this book, my technical editor, Richard Lawrence. Richard is a great friend who I met many years ago at Autodesk University. He is a passionate and driven user of AutoCAD and is always looking to improve the way he uses AutoCAD. Richard, I appreciate everything that you have done to make this book better. Congrats on making it through your fi rst book as a technical editor.

Introduction

Welcome to AutoCAD Platform Customization: VBA! Have you ever thought to yourself, why doesn’t the Autodesk® AutoCAD® program include every feature I need? Why isn’t it stream lined for the type of work I perform? If so, you are not alone. AutoCAD at its core is a drafting platform that, through programming, can be shaped and molded to more effi ciently complete the tasks you perform on a daily basis and enhance your company’s workfl ows. Take a deep breath. I did just mention programming, but programming isn’t something to fear. At fi rst, just the idea of programming makes many people want to run in the opposite direction—myself included. The productivity gains are what propelled me forward. Programming isn’t all that different from anything else you’ve tried doing for the fi rst time.

In many ways, learning to program is much like learning a foreign language. For many new to Visual Basic for Applications (VBA), the starting place is learning the basics: the syntax of the programming language and how to leverage commands and system variables. Executing commands and working with system variables using the SendCommand and PostCommand methods can be a quick way to get started and become comfortable with VBA. After you are comfortable with the syntax of VBA and the SendCommand and PostCommand functions, you can begin to learn how to access the AutoCAD Object library to develop more complex and robust programs.

About Th is Book

AutoCAD Platform Customization: VBA provides you with an understanding of the VBA programming language and how it can be used in combination with the AutoCAD Object library to improve your productivity. This book is designed to be more than just an introduction to VBA and the AutoCAD Object library; it is a resource that can be used time and again when developing VBA programs for use with AutoCAD. As you page through this book, you will notice that it contains sample code and exercises that are based on real-world solutions.

This book is the third and fi nal book in a series that focuses on customizing and programming AutoCAD. The three-book series as a whole is known as AutoCAD Platform

Customization: User Interface, AutoLISP, VBA, and Beyond, which will be available as a printed book in 2015. Book 1 in the series, AutoCAD Platform Customization: User Interface and Beyond, was published in early 2014 and focused on CAD standards and general customization of AutoCAD; Book 2, AutoCAD Platform Customization: AutoLISP, was published in mid-2014 and covers the AutoLISP programming language.

Is Th is Book for You?

AutoCAD Platform Customization: VBA covers many aspects of VBA programming for AutoCAD on Windows. If any of the following are true, this book will be useful to you:

  • You want to develop and load custom programs with the VBA programming language for use in the AutoCAD drawing environment.
  • You want to automate the creation and manipulation of drawing objects.
  • You want to automate repetitive tasks.
  • You want to help manage and enforce CAD standards for your company.

NOTE VBA programming isn’t supported for AutoCAD on Mac OS.

VBA in AutoCAD

VBA is often overlooked as one of the options available to extend the AutoCAD program. There

is no additional software to purchase, but you must download and install a release-specifi c secondary component to use VBA. You can leverage VBA to perform simple tasks, such as inserting a title block with a specifi c insertion point, scale, and rotation and placing the block reference on a specifi c layer. To perform the same tasks manually, end users would have to fi rst set a layer as current, choose the block they want to insert, and specify the properties of the block, which in the case of a title block are almost always the same.

The VBA programming language and AutoCAD Object library can be used to do the following:

  • Create and manipulate graphical objects in a drawing, such as lines, circles, and arcs
  • Create and manipulate nongraphical objects in a drawing, such as layers, dimension styles, and named views
  • Perform mathematical and geometric calculations
  • Request input from or display messages to the user at the Command prompt
  • Interact with fi les and directories in the operating system
  • Read from and write to external fi les
  • Connect to applications that support ActiveX and COM
  • Display user forms and get input from the end user

VBA code statements are entered into the Visual Basic Editor and stored in a DVB fi le. Once a VBA project has been loaded, you can execute the macros through the Macros dialog box.

Unlike standard AutoCAD commands, macros cannot be executed from the Command prompt, but once executed, a macro can prompt users for values at the Command prompt or with a user form. It is possible to execute a macro from a command macro that is activated with a command button displayed in the AutoCAD user interface or as a tool on a tool palette.

Contents at a Glance

Introduction

Chapter 1 • Understanding the AutoCAD VBA Environment
Chapter 2 • Understanding Visual Basic for Applications
Chapter 3 • Interacting with the Application and Documents Objects
Chapter 4 • Creating and Modifying Drawing Objects
Chapter 5 • Interacting with the User and Controlling the Current View
Chapter 6 • Annotating Objects
Chapter 7 • Working with Blocks and External References
Chapter 8 • Outputting Drawings
Chapter 9 • Storing and Retrieving Custom Data
Chapter 10 • Modifying the Application and Working with Events
Chapter 11 • Creating and Displaying User Forms
Chapter 12 • Communicating with Other Applications
Chapter 13 • Handling Errors and Deploying VBA Projects
Index


1 2
Share. Facebook Twitter Pinterest LinkedIn Tumblr Email Reddit Telegram WhatsApp
Thomas Grant

    Iam a civil engineer I share on this blog the news concerning construction

    Related Posts

    questions about Aircrete Domes answered by AI

    7 questions about Aircrete Domes answered by AI

    December 22, 2022
    A $100 million solution could save San Francisco's Millennium Tower

    A $100 million solution could save San Francisco’s Millennium Tower

    March 21, 2022
    Understanding and Analysing Trusses

    Understanding and Analysing Trusses

    October 2, 2021
    Building Services

    Building Services

    September 19, 2021
    Add A Comment

    Leave A Reply Cancel Reply

    Search
    Tag Cloud
    Aircrete Architecture Concrete Concrete Masonry Desert Architecture Design Domes Masonry Modular Homes Safety on the Worksite SMALL HOUSE
    Civil Engineering Library
    Facebook X (Twitter) Instagram Pinterest Vimeo YouTube
    • Home
    • Privacy Policy
    • Contact us
    © 2023 PDF CIVIL ENGINEERING.

    Type above and press Enter to search. Press Esc to cancel.