My Photo

Search


  • Search 280+ postings

Site Awards



Syndications for this Site


VBA Downloads for AutoCAD

I have uploaded a couple of additional sample VBA projects to my website that can be downloaded.  Below is an overview of the 4 samples that are currently available.

CustomDblClickEdit - This example is used to demonstrate how you can replace the standard functionality of the Double Click Editing inside of AutoCAD of your own handler. This allows for changing the default editors and the way objects are handled. Some what out dated with AutoCAD 2007, but if you are using a previous release and what to customize the actions that are performed when double clicking objects, you will want to check this one out.  Last updated for 2004, but will still work with 2005 and 2006 though.

SheetCount - This example is used to demonstrate how to create a custom sheet set property that holds the total number of sheets for all the sheets in the sheet set file. Project was originally developed with AutoCAD 2005 and later tested under AutoCAD 2006. A new version is now available for download that will work with AutoCAD 2007.

SummaryInfo - This example shows how to list, create and modify both standard and custom drawing properties for the current drawing. This is a great example to build on if you want to automate the population of custom properties that you want to use with fields in text objects.

The VBA sample code download page is available by clicking here. Check back once in a while as I will be uploading new samples as I have time to clean some of them up.  You never know what might show up on the site.  Stuck on trying to figure something out in VBA, just let me know and I will see what I can do about putting together a sample project file for you.  Looking for some AutoLISP sample code, well click the jump to access our AutoLISP downloads page.

Sincerely,
  Lee

AutoCAD & AutoCAD LT All-in-One Desk Reference For Dummies Book is Released

The AutoCAD & AutoCAD LT All-in-One Desk Reference For Dummies book has just been released and can be picked up at your favorite local bookstore or on the Internet from a site like BarnesandNobles.com or Amazon.com.  Like other books in the Dummies series, this book gives you the information that you need in order to quickly get up speed on new features if you are an existing user, or if you are a new user to AutoCAD or AutoCAD LT you will find the step-by-step approach helpful in learning the program much quicker.  The book covers AutoCAD 2007 and AutoCAD LT 2007, and weighs in at over 800 pages.  The book is broken down into 10 sub books that cover specific topics which allow you to find the information that you are looking for in a short period of time.

Click on the following links to read excerpts from the book:
Read Excerpt 1 (PDF)
Read Excerpt 2 (PDF)
Read Excerpt 3 (PDF)

Below is a listing of the 10 sub books and the chapters that can be found in each one:

Book I: AutoCAD Basics.
  Chapter 1: Drawing on (and in) AutoCAD.
  Chapter 2: Navigating the AutoCAD Interface.
  Chapter 3: All about Files.
  Chapter 4: Basic Tools.
  Chapter 5: Setting Up Drawings.
  Chapter 6: Precision Tools.

Book II: 2D Drafting.
  Chapter 1: Drawing Objects.
  Chapter 2: Modifying Objects.
  Chapter 3: Managing Views.

Book III: Annotating Drawings.
  Chapter 1: Text: When Pictures Just Won’t Do.
  Chapter 2: Dimensioning.
  Chapter 3: Hatching Your Drawings.

Book IV: LT Differences.
  Chapter 1: The LT Difference.
  Chapter 2: Extending AutoCAD LT.
  Chapter 3: Mixed Environments.

Book V: 3D Modeling.
  Chapter 1: Introducing the Third Dimension.
  Chapter 2: Using the 3D Environment.
  Chapter 3: Viewing in 3D.
  Chapter 4: Moving from 2D to 3D.
  Chapter 5: Working with Solids.
  Chapter 6: Working with Surfaces.
  Chapter 7: Rendering: Lights, Cameras, AutoCAD!

Book VI: Advanced Drafting.
  Chapter 1: Playing with Blocks.
  Chapter 2: Dynamic Blocks.
  Chapter 3: External References.
  Chapter 4: Organizing Your Drawings.
  Chapter 5: AutoCAD Utilities.

Book VII: Publishing Drawings.
  Chapter 1: Page Setup.
  Chapter 2: Sheet Sets without Regret.
  Chapter 3: Print, Plot, Publish.

Book VIII: Collaboration.
  Chapter 1: CAD Management: The Necessary Evil.
  Chapter 2: CAD Standards.
  Chapter 3: Working with Drawing Files.
  Chapter 4: Sharing Electronic Files.

Book IX: Customizing AutoCAD.
  Chapter 1: The Basics of Customizing AutoCAD.
  Chapter 2: Customizing the Interface.
  Chapter 3: Customizing the Tools.
  Chapter 4: Delving Deeper into Customization.

Book X: Programming AutoCAD.
  Chapter 1: The AutoCAD Programming Interfaces.
  Chapter 2: Using Custom Programs.
  Chapter 3: Introducing AutoLISP.
  Chapter 4: Visual Basic for AutoCAD.

This book was an absolute joy to write for my first published work through a publisher, and I hope you enjoy it as much as I did writing it.  Now what are you waiting for, go grab a cup of Starbucks (or a favorite drink of your's) and get a copy of the AutoCAD & AutoCAD LT All-in-One Desk Reference For Dummies Book.  After you pick up a copy of the book, it would be great to hear from you.

Sincerely,
  Lee

AutoCAD ActiveX History Reference

Do you find yourself maintaining multiple releases of AutoCAD and need to know what ActiveX functions existed in which release? Maybe you are on an older release and want to know what might have been added. A fellow read and visitor of my web site has shared with me his cross reference table of all the ActiveX Methods and Properties from AutoCAD 2000 through 2006.  Many thanks to Marc for sharing this.

Below is a linkt to the PDF file that he has posted.
AutoCAD ActiveX History (Methods and Properties)

Thanks,
  Lee

What's Changed in the ActiveX API? - AutoCAD 2004/2005

One of the readers of this blog asked if I had a list of changes in the ActiveX API for AutoCAD 2004 and AutoCAD 2005, just like I have provided for AutoCAD 2006.  Which my response was, "Yes I do".  It was a listing that I pulled together for my class that I taught at AU last year called "What's New in the ActiveX API?".  The class covered changes that dated back to AutoCAD 2004 and 2005.  So for those users of AutoCAD that are looking to upgrade this time around, here is a list of changes to the ActiveX API that you might be of interest to you.

Changes to the API for AutoCAD 2004
New Collections
AcadFileDependencies

New Classes
AcadAcCmColor
AcadFileDependency
AcadSummaryInfo
AcadSecurityParams

New Enumerators
AcColorMethod
AcGradientPatternType
AcHatchObjectType
AcShadePlot
AcadSecurityParamsConstants
AcadSecurityParamsType

Class Changes
AcadApplication
    Property - HWND

AcadDocument
    Property - FileDependencies
    Property - SummaryInfo

AcadExternalReference
    Property - EffectiveName

AcadHatch
    Property - GradientAngle
    Property - GradientCentered
    Property - GradientColor1
    Property - GradientColor2
    Property - GradientName
    Property - HatchObjectType

AcadLWPolyline
    Property - Length

AcadMtext
    Property - LineSpacingDistance

AcadMtext
    Property - RemoveHiddenLines (Removed)
    Property - ShadePlot (Replaces RemoveHiddelLines)

AcadPreferencesFiles
    Property - ColorBookPath
    Property - ToolPalettePath
    Property - LicenseServer (Removed)
    Property - ObjectARXPath (Removed)

AcadPreferencesOpenSave
    Property - SaveAsType (Constant values for AcSaveAsType changed)

AcadPreferencesUser
    Property - SCMTimeMode
    Property - SCMTimeValue

Changed Enumerators
AcSaveAsType
    ac2000_dwg
    ac2000_dxf
    ac2000_Template
    ac2004_dwg
    ac2004_dxf
    ac2004_Template
    acR18_dwg
    acR18_dxf
    acR18_Template
    acNative (value has changed to be the same as ac2004_dwg)

AcViewportScale
    acVp1and1_2in_1ft

Changes to the API for AutoCAD 2005
New Collections
N/A

New Classes
AcadOle
AcadSortentsTable
AcadTable
AcadTableStyle

New Enumerators
AcCellAlignment
AcCellEdgeMask
AcCellType
AcGridLineype
AcRowType
AcSelectType
AcTableDirection
AcTableStyleOverrides
AcOlePlotQuality
AcOleType
AcRotationAngle

Changed Collections
AcadLayers >> IAcadLayers2

Class Changes
AcadLayers
    Method - GenerateUsageData

Changed Classes
AcadLayer >> IAcadLayer2
AcadBlock >> IAcadBlock2
AcadModelSpace >> IAcadModelSpace2
AcadMText >> IAcadMText2
AcadPaperSpace >> IAcadPaperSpace2
AcadPreferencesFile >> IAcadPreferencesFile2
AcadPreferencesOutput >> IAcadPreferencesOutput2
AcadPViewport >> IAcadPViewport2
AcadText >> IAcadText2
AcadView >> IAcadView2

Class Changes
AcadDocument
    Event - BeginDocClose

AcadBlock
    Method - AddTable

AcadLayer
    Property - Description

AcadModelSpace
    Method - AddTable

AcadMText
    Property - BackgroundFill
    Method - FieldCode

AcadPaperSpace
    Method - AddTable

AcadPreferencesFile
    Property - PageSetupOverridesTemplateFile
    Property - PlotLogFilePath
    Property - QNewTemplatePath

AcadPreferencesOutput
    Property - AutomaticPlotLog
    Property - ContinuousPlotLog

AcadPViewport
    Property - HasSheetView
    Property - LabelBlockId
    Property - ModelView
    Property - SheetView
    Method - SyncModelView

AcadText
    Method - FieldCode

AcadView
    Property - CategoryName
    Property - HasVpAssociation
    Property - LayerState
    Property - LayoutId

Changed Enumerators
AcEntityName
    acTable

Sincerely,
  Lee

What's Changed in the ActiveX API? - AutoCAD 2006

I have compiled a list of all the changes to the ActiveX API that I could find in the latest Beta of AutoCAD 2006 that I have.  I will publish a final copy of ther changes once AutoCAD 2006 has started shipping to customers.  Below is a high level view of the changes though.  I will post some specifics over the next couple of days/weeks, but make note that some of these items are open to change yet since they are based on a Beta version of the software.

New Classes
AcadDimArcLength
AcadDimRadialLarge
AcadDynamicBlockReferenceProperty

New Enumerators
AcBlockScaling
AcDimArcLengthSymbol
AcDynamicBlockReferencePropertyUnitsType
AcMLineJustification

Changed Classes
AcadAttribute >> IAcadAttribute2
AcadAttributeReference >> IAcadAttributeReference2
AcadBlock >> IAcadBlock3
AcadBlockReference >> IAcadBlockReference2
AcadExternalReference >> IAcadExternalReference2
AcadHatch >> IAcadHatch2
AcadMInsertBlock >> IAcadMInsertBlock2
AcadMLine >> IAcadMLine2
AcadModelSpace >> IAcadModelSpace3
AcadPaperSpace >> IAcadPaperSpace3
AcadTable >> IAcadTable2
AcadUtility >> IAcadUtility2

Changed Enumerators
AcEntityName
AcViewportScale

Sincerely,
  Lee

Chapters 11 - 13 all wrapped up

I have finished putting the final touches on Chapters 11 - 13 for my VBA book this past weekend.

Chapter 11: Storing & Retrieving Data for Future Use
This chapter focuses up working with System Variables, Windows Registry, XData and XRecords.

Chapter 12: Modifying Objects in a Drawing
This chapter focuses up on modifying objects that are already in a drawing.  It covers things like Mirroring, Copying and many other methods that are used for modifying objects.

Chapter 13: Formatting with Colors, Linetypes, Lineweights and Layers
This chapter focuses on formatting properties of an object.  These include work with True Colors along with Layers, Linetypes and Lineweights too.  I also take a look at Layer States and how they can be used to help working on drawings.

I will give an update on what is going on for the next chapters once they have been completed.  As you can see the chapter outline has been revised compared to the original list of chapters that I put together.  As I was working through many of the chapters, things came up before they were talked about so I had to revise the order of some of the content.  If you have any questions or comments just let me know.

Sincerely,
  Lee

Chapters 1 - 10 are Complete

I have completed the first 10 chapters of the VBA book that I am working on.  This month has been very busy with the new addition to my family and some other things going on.  Below is a breakdown of what is in the first 10 chapters that span almost 200 pages, 198 pages to be exact.

Introduction

Chapter 1: AutoCAD Commands for VBA
Covers the commands that are available in AutoCAD for working with VBA projects.

Chapter 2: Visual Basic Editor
General look at the various tools that are in the Visual Basic Editor (IDE)

Chapter 3: Code Modules
A breakdown of what you can find in a code module and what a code module is.  You will learn how to work with procedures, variables, data types and general error handling.

Chapter 4: UserForm (Dialog Boxes)
You will learn how to add controls to a UserForm and how to manipulate both controls and the UserForm at design-time.

Chapter 5: Basic VBA Functions & Conditional and Looping Statements
A look at some of the most widely used functions that VBA has to offer.  These include string and data conversion procedures, and working with mathematics.  The chapter also covers working with While and For loops, among much more.

Chapter 6:  AutoCAD Entities - Part 1
A look at some of the basic entities that can be added to a drawing and are found in the AutoCAD Object Library.  These are objects like AcadObject and AcadEntity which are the base for objects that can be added to a drawing file.  Then it starts covering objects like Lines, Circles, Arcs and many others.

Chapter 7: AutoCAD Entities - Part 2
A continued look at entities that can be added to a drawing, but these are the complex entities.  Objects like Polylines, Hatches, Splines and many others can be found in this chapter.

Chapter 8: Document Object
This chapter focuses on the Document object which represents the Document window and the database objects that hold the contents of an open drawing file.  It also takes a look at the preferences of the Database, Drawing Properties, File Dependencies and how to work with collections.

Chapter 9: Application Object
This chapter focuses on the Application object which represents the actual AutoCAD session and allows for accessing all the open drawings.  You can also find information about the application preferences, which normally you find under the Options command of AutoCAD.

Chapter 10: User Input Outside of a UserForm
You can find information on how to get information from the user at the Command Line in this chapter.  I have also included some information that I have gathered through out the years to help improve the process of working with the Command Line based input methods.

I should be complete with the next three chapters over the next couple of days and will post an update after they are complete.  Thanks to everyone that has posted comments or have sent me an e-mail on what they would like to see included in the book, so keep the information and concerns coming.

Sincerely,
  Lee

VBA Book Project in Progress

I have been working on and off for some time on whether or not to release a VBA book that covers in great depth from what I have ventured down the path in the past.  I am proud to announce that I will be going forward with this project and if anyone out there has any feedback to what they would like to see I am open to listening to them.  Below is a summary of the chapter titles that will be included in the VBA for AutoCAD book.  The book once completed should be some where in the neighborhood of 26 chapters and over 450 pages.  I am hoping to have it completed in the next couple of months.

Chapters
Introduction
1. AutoCAD Commands for VBA
2. Visual Basic Editor
3. Components of a VBA Project
4. Error Handling and Debugging Code
5. Conditional and Looping Statements
6. Basic VBA Functions
7. Object Browser and Getting Help
8. AutoCAD Entities - Part 1
9. AutoCAD Entities - Part 2
10. AutoCAD Document
11. Application Object
12. User Input Outside of a UserForm
13. Storing & Retrieving Data for Future Use
14. Modifying Objects in the Drawing
15. Formatting with Colors, Linetypes, Lineweights and Layers
16. Annotation - Text, Tables and Dimensions
17. Blocks and Xrefs
18. Selection Sets
18. Views and Zooming
19. Layouts and Plotting
20. Manipulating the AutoCAD UI (Menu bar and Toolbars)
21. Responding to Events
22. Accessing Files and Folders
23. Working with the Internet
24. Accessing Other Applications from AutoCAD
25. Odds and Ends
Appendixes, Glossary and Index

I have read many different VBA books throughout the years and some just seem to be way to intense or just not very basic for the beginner.  I hope to be able to bring a blend of content that will help those that are new and familiar to VBA programming in AutoCAD.  I have been using VBA with AutoCAD since R14 so I have been using it since the beginning.  I hope to show a variety of samples that some might have never seen before.  Like I mentioned earlier I would like to hear what people would be looking for in a book that they might be interested in purchasing on VBA for AutoCAD.

Sincerely,
  Lee

AutoCAD Customization/ProgrammingTraining

I am proud to announce that  I have partnered up with Virtual Partners to offer AutoCAD training in the areas of both General and Customization/Programming.  The schedule will change with demands on classes, but we have slotted classes from January through February.  These classes range from customizing AutoCAD, using AutoLISP and VBA to great automation and improving work flow to general AutoCAD upgrade classes.  If you have any questions please contact James Murphy at murph@virtualpartners.com or myself at lee_ambrosius@hyperpics.com.

Class schedule and information can be found on the Virtual Partners website.  Contact us today to learn how to unlock the secrets and benefits of customizing AutoCAD; education is a great tool so start the New Year off on the right foot.

Sincerely,
  Lee

Mini Guide for Intro to VBA for AutoCAD

Vba_mini_guide_1   For sometime now I have had some people asking about whether or not I would do an eBook on VBA for AutoCAD.  I have had one for a while, but until recently it wasn't up to date.  A new version has been created that is a total of 17 Chapters and 169 pages.  Typically people want to see a copy of it before buying it which is understandable.  So What I have decided to do instead was publish a Mini Guide which contains certain sections of the full version.  Below are two links to a scaled down version of the eBook that is titled "Introduction to VBA for AutoCAD".

  If you are interested in purchasing a copy of the full version just e-mail me, otherwise enjoy the Mini Guide to VBA for AutoCAD without any strings attached.  Hope you enjoy the Mini Guide on VBA to AutoCAD.

Click here to access the eBook Introduction to VBA for AutoCAD (Mini Guide)

Sincerely,
  Lee

Feeds


  • Between the Lines Blog

  • Will render for food... Digital Media Blog

  • HyperPics.com