
AutoCAD Platform Customization
Description
Alles über E-Books | Antworten auf Fragen rund um E-Books, Kopierschutz und Dateiformate finden Sie in unserem Info- & Hilfebereich.
More details
Other editions
Additional editions

Person
Content
Introduction
Welcome to AutoCAD Platform Customization: User Interface, AutoLISP, VBA, and Beyond. Have you ever thought about customizing AutoCAD only to think it is not for you because you're not a programmer? If so, you are not alone, as there are many people that connect customization with programming. However, customization is not the same as programming, but programming can be considered a form of customization.
While using one of the supported programming languages can be useful in implementing custom workflows and new commands, there are many simpler ways to increase your drafting efficiency in a shorter period of time. AutoCAD supports a wide range of customization features that you can learn and begin to leverage in minutes, which can led to improved CAD standards and a decrease in the amount of time it takes to complete a task.
I, like many others, even yourself most likely, have customized AutoCAD without even realizing it. Have you ever created a new layer, text style, or block? Chances are pretty great that you have created one or more of those items before. You might have even stored those items in a drawing template (DWT) file so they would be available each time a new drawing was created. While you might not have thought about these as forms of customization, they are indeed a few of the basic drawing customization features that can be used to enhance the out-of-box AutoCAD experience.
Drawing customization affects the appearance of and settings in a drawing file or drawing template (DWT) file, and should form the cornerstone of your company's CAD standards. Often when people think of customization though, they commonly think of application customization, which contains the support files that AutoCAD uses as well as the tools in the application's user interface. Application customization is not dependent on which drawing is currently open, but which user profile or workspace might be current.
About This Book
The AutoCAD Platform Customization: User Interface, AutoLISP, VBA, and Beyond book covers many of the customization and programming features that can be found in AutoCAD on Windows and Mac OS X. This book covers most of the customization features available along with two of the easier to learn programming languages that AutoCAD supports. If any of the following are true, this book will be useful to you:
- Want to learn about which customization and programming options are available in AutoCAD.
- Want to customize the user interface or support files, such as linetypes and hatch patterns, that AutoCAD utilizes.
- Want to automate repetitive tasks.
- Want to create and manage CAD standards for your company.
- Want to learn how to create custom programs with AutoLISP or Visual Basic for Applications (VBA).
Customization in AutoCAD
Customization is one of the feature areas that sets AutoCAD apart from many other CAD programs. Even though the product can be used out of the box, configuring the user interface and modifying the support files that come with the product can greatly improve your productivity. By customizing AutoCAD, you can streamline product workflows and create new ones that are a better fit with the way your company works. These workflows might range from importing layers and styles into a drawing to the extraction of drawing-based information into a spreadsheet or database.
Not all of the customization features require you to learn a new tool or skill set; chances are you might have customized AutoCAD and not even realized it. If you have ever created a layer or a block, you already understand some of the customization features of AutoCAD.
The following outlines many of the common customization and programming options available:
Basic
- Layers
- Annotation styles (text, dimensions, multileaders, and tables)
- Layouts
- Blocks
- Plot styles
- Plotters
- Page setups
- Materials, visual styles, and render presets
- Drawing templates
- Command aliases
- User profiles (Windows only)
- Workspaces (Windows only)
- Desktop icon customization (Windows only)
- Tool palettes (Windows only)
Intermediate
- Scripts
- User interface (CUIx) and DIESEL
- Linetypes and hatch patterns
- Shapes and text styles
- Action macros (Windows only)
- Dynamic blocks (Windows only)
Advanced
- AutoLISP
- ObjectARX
- Visual Basic for Applications (Windows only)
- ActiveX/COM (Windows only)
- Database connectivity (Windows only)
- Sheet Set Manager API (Windows only)
- CAD Standards plug-ins (Windows only)
- Transmittal API (Windows only)
- Managed.NET (Windows only)
- JavaScript (Windows only)
AutoLISP in AutoCAD
AutoLISP is the most popular, and is the original supported programming language for the AutoCAD program. The reason for its popularity with new (and even veteran) programmers is that it is a natural extension of the AutoCAD program. There is no additional software to purchase, and AutoLISP can leverage the commands that Autodesk and third-party developers expose at the Command prompt. For example, with a few simple lines of code you can set a layer current and insert a title block with a specific insertion point, scale, and rotation. The block is then inserted on the layer you specified. To perform the same tasks manually, the end user would have to first set a layer 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 AutoLISP programming language can be used to:
- Create custom functions that can be executed from the AutoCAD Command prompt
- 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 files and directories in the operating system
- Read from and write to external files
- Connect to applications that support ActiveX and COM
- Display dialog boxes and get input from the end user
AutoLISP code can be entered directly at the Command prompt or loaded using a LSP file. Once an AutoLISP program has been loaded, you can execute the custom functions from the Command prompt. Functions executed from the Command prompt can be similar to standard AutoCAD commands, but the programmer determines the prompts that should be displayed. It is also possible to use AutoLISP code with a command macro that is activated from the AutoCAD user interface or a tool on a tool palette.
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-specific secondary component to use VBA. You can leverage VBA to perform simple tasks, such as inserting a title block with a specific insertion point, scale, and rotation and placing the block reference on a specific layer. To perform the same tasks manually, end users would have to first 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 files and directories in the operating system
- Read from and write to external files
- 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 file. 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.
What to Expect
This book is organized to help to customize AutoCAD, learn the fundamentals of AutoLISP, and how to use the objects in the AutoCAD Object library with the VBA programming language. Additional resources and files containing the example code found throughout this book can be found on the companion website, www.sybex.com/go/autocadcustomization.
Part I: AutoCAD Customization: Increasing Productivity through Personalization
- Chapter 1: Establishing the Foundation for Drawing Standards In this chapter, you'll learn how to establish drawing standards. Drawing standards allow you to enforce consistency across multiple drawings. By enforcing a set of standards, you can easily share your drawings and make them look the same when...
System requirements
File format: ePUB
Copy protection: Adobe-DRM (Digital Rights Management)
System requirements:
- Computer (Windows; MacOS X; Linux): Install the free reader Adobe Digital Editions prior to download (see eBook Help).
- Tablet/smartphone (Android; iOS): Install the free app Adobe Digital Editions or the app PocketBook before downloading (see eBook Help).
- E-reader: Bookeen, Kobo, Pocketbook, Sony, Tolino and many more (not Kindle).
The file format ePub works well for novels and non-fiction books – i.e., „flowing” text without complex layout. On an e-reader or smartphone, line and page breaks automatically adjust to fit the small displays.
This eBook uses Adobe-DRM, a „hard” copy protection. If the necessary requirements are not met, unfortunately you will not be able to open the eBook. You will therefore need to prepare your reading hardware before downloading.
Please note: We strongly recommend that you authorise using your personal Adobe ID after installation of any reading software.
For more information, see our ebook Help page.