VBA Enabler Download
AutoCAD 2012, 2011, and 2010 do not ship with VBA. To continue using your VBA macros: 1) download the VBA enabler package from Autodesk, 2) install AutoCAD 2012/11/10, 3) install the VBA enabler package. For 64-bit AutoCAD requiring the VBA enabler you may have a conflict with a 32-bit VBA host application where your AutoCAD macros will not execute. Try uninstalling the 32-bit host application (our offender was Excel) and restarting AutoCAD. The goal is to transition users to .NET.

VBA Demonstration Routines
All routines were developed in and for AutoCAD 20xx and are compatible up to AutoCAD 2012.
See '.DVB' files for demand-loading and additional info



ad_AcadDate
Demonstrates manipulation of internal date formats.
ad_AcadPath
Demonstrates retrieval of path of AutoCAD executable.
ad_ActiveDwg
Allows switching between active drawings by selecting from a dropdown list.
ad_AddDimStyle
Demonstrates adding a new dimension style and defining properties.
ad_AddMenuItems
Demonstrates adding a new menu item, toolbar, and toolbar button.
ad_AddWord
Demonstrates adding a leading and trailing word to existing text.
ad_AttributeUpdate
Demonstrates updating block attributes and dynamic button and form captions.
ad_CircleToPoint
Collects and changes specified circles to points using a filtered selection set.
ad_CloseAllDwgs
Closes current drawings with option to save.
ad_Cloud
Draws and configures polyline revision clouds. Includes two related routines.
ad_ColorToLayer
Places entities on layers based upon their color and changes color to ByLayer.
ad_ConvertText
Demonstrates the conversion of an MText entity to a Text Entity, or a Text entity to an MText entity.
ad_CopyDim
Copies the Measurement property of the selected dimension to the Windows clipboard.
ad_CrossHairToggle
Toggles the display crosshair between 5% and 100%.
ad_DeleteBlankText
Deletes all modelspace blank text and mtext entities.
ad_DeleteLayouts
Deletes all paperspace layouts.
ad_DimCG
Locates and dimensions the CG of a selected solid.
ad_DimStyleMatch
Demonstrates adding a new dimension style and define its various properties by matching an existing dimension object.
ad_DimVisibility
Demonstrates controlling visibility of specific objects.
ad_DwgDate
Inserts the current system date in a block.  Requires ad_DwgDate.dwg.
ad_DwgList
Writes a list of the current active drawings to a text file.
ad_DwgVer
Determines the AutoCAD version format of the current drawing.
ad_Dxf2Dwg
Converts a folder of DXF files to DWG using SaveAs.
ad_EntityByLayer
Demonstrates updating all drawing entity color and linetypes to ByLayer.
ad_FindReplace
Demonstrates multiple-field find/replace of Text and MText.
ad_FindZoom
Locates and zooms to specified drawing objects.
ad_FixBlocks
Demonstrates selective updates of block attributes.
ad_FixPlotStyles
Updates drawing plot styles.
ad_FormatNumbers
Demonstrates ways to format numbers.
ad_FreezeAll
Freezes all layers except current.
ad_FreezePick
Freezes the layer of a selected entity.
ad_GetBlocks
Collects all blocks in a drawing and creates and displays a list of the blocks and their attributes.
ad_GetObjectName
Displays the AutoCAD ObjectName for the selected entity.
ad_GetPlotInfo
Demonstrates the retrieval of plot device and media information for the active layout.
ad_GraphScrColor
Toggles the graphics window background color between black and white.
ad_LayerList
Populates a combobox with the drawing layers.
ad_LayerRename
Demonstrates the manipulation of drawing layer names.
ad_LayerSS
Demonstrates the creation of a selection set of all entities on a given layer.
ad_LayoutIsolate
Demonstrates a way to isolate entities according to the layout on which they reside.
ad_LayoutLimits
Displays a message box with the limits for each drawing layout.
ad_LineList
Populates a combobox with the drawing linetypes.
ad_ListLayouts
Lists the layouts defined in the current drawing.
ad_MatchLayer
Makes the selected entitys layer current.
ad_MatchProps
Mimics the basic functionality of the _MatchProps command.
ad_OutlookJournal
Demonstrates the creation of simple journal entries in MS Outlook to record drawing open/close.
ad_PageLayout
Selects a particular layout as the active layout.
ad_PerpOn
Rotates the crosshairs to match the angle of the selected line. Includes a routine to return crosshairs to 0 degrees.
ad_PlotLayouts
Plots all layouts in the current drawing to a plot device. Uses their default page setups.
ad_PlotStyles
Retrieves and displays the plot policy and plot styles for the active layout.
ad_PlotToFile
Plots all layouts in the current drawing to file in the drawing folder. Uses their default page setups.
ad_PlotToFolder
Plots all layouts in the current drawing to file in a specific folder. Uses their default page setups.
ad_Profiles
Saves and loads user profiles.
ad_SaveToR2000
Updates older versioned drawing files to include preview bitmap.
ad_ScreenMenu
Toggles the visibility of the screen menu.
ad_ssBox
Gets and displays the bounding box of a selection set.
ad_SwapProfiles
Toggles user profiles.
ad_Table
Inserts an AutoCAD Table and populates it with block attribute information. For AutoCAD 2007+.
ad_TextLayer
Creates a selection set of all text on a given layer.
ad_TextMatchAngle
Demonstrates rotating text to match the rotation of a selected line.
ad_TextOnAngle
Demonstrates adding text to match the rotation of a selected line.
ad_TextStyleList
Populates a combobox with the drawing textstyles.
ad_ThawAll
Thaws all layers.
ad_Timer
Demonstrates the use of a timer and also the relative strengths of entity iteration vs selection sets.
ad_TotalLines
Demonstrates the retrieval of the cumulative total.
ad_ToUpper
Changes all drawing MText and text to uppercase.
ad_UnloadVBA
Demonstrates a self-unloading macro.
ad_UpdateTextStyles
Updates the font for all TextStyles in all drawings in a folder.
ad_Utility
Groups 52 ActiveDwg non-dialog based VBA macros and demand load statements in a single file.
ad_VerifyDims
Highlights drawing dimensions that contain text overrides.




DISCLAIMER NOTICE: All code is provided 'as-is' and has been verified to function properly FOR OUR PURPOSES. It is your responsibility to verify that the code will function properly for your purpose PRIOR TO ITS USE. ActiveDwg and its affiliated sites make no warranty, express or implied, as to the viability of particular code for any particular purpose. By downloading from this site, you are indicating your agreement with these terms.