Share
 
 

About Migrating Automation Projects (ActiveX)

In general, an AutoCAD automation project created in the VBA IDE or created with Visual Studio might require some updates before it can be used in AutoCAD 2025. AutoLISP programs that utilize ActiveX might also require updates, but this is less common.

For a general history of the changes made to the ActiveX API, see "ActiveX API History."

Note: AutoCAD LT doesn't support Visual Basic for Applications (VBA) programming.

New and Changed Objects in Latest Release

New Objects

No new objects were added.

Changed Objects

The following table describes the changes made to existing objects.

AutoCAD 2024 AutoCAD 2025 Description of change

AutoCAD Only:

AutoCAD.Application.24 or AutoCAD.Application.24.3

AutoCAD Only:

AutoCAD.Application.25 or AutoCAD.Application.25.0

Use AutoCAD.Application to create an instance of the AutoCAD application based on the latest library installed.

ActiveX Library References (AutoCAD Only)

References to the AutoCAD ActiveX API might need to be updated in VBA projects created in the AutoCAD drawing environment or other applications that support VBA, such as Microsoft Word or Excel. Managed .NET and ObjectARX applications that use the AutoCAD ActiveX API might also need to update.

The following table lists the filename of the AutoCAD object library that is supported by AutoCAD-based product release.

Release Release Number AutoCAD Type Library AutoCAD/ObjectDBX Type Library
AutoCAD 2025 25.0 acax25<language>.tlb axdb25<language>.tlb
AutoCAD 2024 24.3 acax24<language>.tlb axdb24<language>.tlb
AutoCAD 2023 24.2 acax24<language>.tlb axdb24<language>.tlb
AutoCAD 2022 24.1 acax24<language>.tlb axdb24<language>.tlb
AutoCAD 2021 24.0 acax24<language>.tlb axdb24<language>.tlb
AutoCAD 2020 23.1 acax23<language>.tlb axdb23<language>.tlb
AutoCAD 2019 23.0 acax23<language>.tlb axdb23<language>.tlb
AutoCAD 2018 22.0 acax22<language>.tlb axdb22<language>.tlb
AutoCAD 2017 21.0 acax21<language>.tlb axdb21<language>.tlb
AutoCAD 2016 20.1 acax20<language>.tlb axdb20<language>.tlb
AutoCAD 2015 20.0 acax20<language>.tlb axdb20<language>.tlb
AutoCAD 2014 19.1 acax19<language>.tlb axdb19<language>.tlb
AutoCAD 2013 19.0 acax19<language>.tlb axdb19<language>.tlb
AutoCAD 2012 18.2 acax18<language>.tlb axdb18<language>.tlb
AutoCAD 2011 18.1 acax18<language>.tlb axdb18<language>.tlb
AutoCAD 2010 18.0 acax18<language>.tlb axdb18<language>.tlb
AutoCAD 2009 17.2 acax17<language>.tlb axdb17<language>.tlb
AutoCAD 2008 17.1 acax17<language>.tlb axdb17<language>.tlb
AutoCAD 2007 17.0 acax17<language>.tlb axdb17<language>.tlb
AutoCAD 2006 16.2 acax16<language>.tlb axdb16<language>.tlb
AutoCAD 2005 16.1 acax16<language>.tlb axdb16<language>.tlb
AutoCAD 2004 16.0 acax16<language>.tlb axdb16<language>.tlb
AutoCAD 2002 15.2 acax15.tlb axdb15.tlb
AutoCAD 2000i 15.1 acax15.tlb axdb15.tlb
AutoCAD 2000 15.0 acax15.tlb axdb15.tlb
Note: <language> represents the language of the object library. For example, <language> might be enu on English installations and fra on French installations.

The following lists filenames of the other AutoCAD ActiveX APIs used by earlier releases and the object library files that they have been replaced with the latest release:

  • acETransmit17.tlb through acETransmit19.tlb – Change to acETransmit20.tlb
  • AcSmComponents17.tlb through AcSmComponents24.tlb – Change to AcSmComponents25.tlb
  • cao16<language>.tlb – Change to cao20<language>.tlb

General Changes from an Earlier Release (AutoCAD Only)

In addition to updating COM library references, the following changes might need to be made to migrate a program from an earlier release:

  • The methods and properties used for 64-bit support must be revised. These changes are outline in the "64-bit Migration" section.
  • Starting with AutoCAD 2015-based products, the SendCommand method sends a command string to an AcadDocument object and executes it asynchronously. The execution of the VBA project is suspended until the last command executed by the command string is completed or terminated and returns the document to an idle state. In earlier releases, the command string was sent to the AcadDocument object without suspending the VBA and you to pass values to the current command using the SendCommand method.

    For example, the following worked in AutoCAD 2014-based products and earlier:

    ThisDrawing.SendCommand "._LINE "
    ThisDrawing.SendCommand "0,0 5,5 "

    In AutoCAD 2015-based products and later, the previous code would execute the LINE command and then wait for the user to provide points. After the LINE command was completed or terminated the second SendCommand method would be executed. You would change the previous code to the following to execute correctly:

    ThisDrawing.SendCommand "._LINE 0,0 5,5 "

    If you need to break your code statements up across multiple lines, you might be able to utilize the PostCommand method which posts a command string to the AcadDocument object and executes the string synchronously. Synchronous execution of the command string means that it is executed when the outermost procedure is executed and the AcadDocument object is in an idle state.

  • The SaveAs method no longer supports the ability to assign a password to a drawing. Password protection is no longer supported. Remove the AcadSecurityParams object from the vSecurityParams parameter of the SaveAs method to update the code statement for use in the latest release.

64-bit Migration (AutoCAD Only)

Starting with AutoCAD 2014, AutoCAD supports VBA 7.1 which offers native 64-bit support. This change will require you to maintain two versions of your VBA projects: 32-bit and 64-bit. In releases prior to AutoCAD 2014, VBA ran as an out-of-process component, accessed through a 32-bit-to-64-bit "thunking" layer which allowed existing 32-bit VBA projects to function as expected in AutoCAD 64-bit.

VBA 64-bit requires the use of different libraries and controls for forms. Not all VBA libraries and form controls are available in 64-bit yet, and you might need to adjust some of your code to work correctly on both Windows 32-bit and Windows 64-bit.

If your VBA projects were developed for AutoCAD 2009 through AutoCAD 2013, you need to take the following into consideration when migrating VBA projects to the latest release:

  • Controls used on forms originally created for Windows 32-bit might need to be updated or replaced with a 64-bit alterative to execute correctly on Windows 64-bit.
  • Methods and properties created specifically to allow VBA 32-bit to work with AutoCAD 64-bit are now obsolete and have been removed. Replace the use of the obsolete method and property with the correct method and property, often removing "32" from the name of the method or property is enough.
Handling ObjectId

Beginning with AutoCAD 2009 64-bit through AutoCAD 2013 64-bit, object IDs were represented by a 64-bit integer datatype (__int64). Accessing those values in 32-bit VBA caused a compilation error. As a resolution, a new set of method names suffixed with "32" corresponding to the old methods were created (e.g. ObjectID32(), OwnerID32()). Those methods used the LONG data type, which internally mapped to the 64-bit integer data type.

To be more precise, a 32-bit Object ID was created internally for each object ID required in VBA. This ID was mapped to its 64-bit actual ID, so that if the 32-bit ID was passed back to AutoCAD from VBA code, then the 64-bit object ID could be returned and used internally for all purposes.

The following sample gives an example of ported 32-bit Object ID code:

Original code 64-bit (AutoCAD 2009 through AutoCAD 2013)

Dim splineObj As AcadSpline
Dim objectID As Long
objectID = splineObj.objectID32
Dim tempObj As AcadObject
Set tempObj = ThisDrawing.ObjectIdToObject32(objectID)

Code ported for AutoCAD 2014 64-bit and later compatibility

Dim splineObj As AcadSpline
Dim objectID As Long
objectID = splineObj.objectID
Dim tempObj As AcadObject
Set tempObj = ThisDrawing.ObjectIdToObject(objectID)

VBA applications can also use an object’s handle instead of its object ID. The following sample shows how to use the handle instead of the object ID:

Original code using an object's Object ID

Dim splineObj As AcadSpline
Dim objectID As Long
objectID = splineObj.objectID
Dim tempObj As AcadObject
Set tempObj = ThisDrawing.ObjectIdToObject(objectID)

Revised code using an object's handle

Dim splineObj As AcadSpline
Dim objectHandle As String
objectHandle = splineObj.Handle
Dim tempObj As AcadObject
Set tempObj = ThisDrawing.HandleToObject(objectHandle)
Appendix of 32-bit Methods (Obsolete with AutoCAD 2014 64-bit and Later)
Note: Object IDs are no longer converted to the LONG data type for AutoCAD 32-bit.

The following table lists the methods that were used in AutoCAD 2009 64-bit through AutoCAD 2013 64-bit as 32-bit substitutions:

VBA Methods for a 64-bit System
Method - AutoCAD 2009 through 2013 Method - AutoCAD 2014 and Later Use
GetBlockAttributeValue32 GetBlockAttributeValue Returns the attribute value from the specified block cell for the attribute definition object contained in the block using its 32-bit object ID.
GetBlockTableRecordId32 GetBlockTableRecordId Gets the 32-bit object ID of the block table record associated to the block-type cell and nContent.
GetFieldId32 GetFieldId Returns the 32-bit object ID of the field object associated to the specified cell.
GetGridLinetype32 GetGridLinetype Returns the 32-bit object ID of the grid linetype object.
Key32 Key Specifies the object ID of the source object in the CopyObjects operation for a 64-bit system.
ObjectID32 ObjectID Gets the object ID for a 64-bit system.
ObjectIDtoObject32 ObjectIDtoObject Gets the object that corresponds to the given object ID for a 64-bit system.
OwnerID32 OwnerID Gets the object ID of the owner (parent) object for a 64-bit system.
SetBlockAttributeValue32 SetBlockAttributeValue Sets the attribute value from the specified block cell for the attribute definition object contained in the block and nContent using its 32-bit object ID.
SetBlockTableRecordId32 SetBlockTableRecordId Sets the 32-bit object ID block table record associated to the block-type cell and nContent.
SetFieldId32 SetFieldId Sets the 32-bit object ID of the field object associated to the specified cell and nContent.
SetGridLinetype32 SetGridLinetype Sets the 32-bit object ID of the grid line type object.
Value32 Value Specifies the current value for the property, or the object ID of the newly created cloned object, for a 64-bit system.

Was this information helpful?