You use the Visual Basic Editor to create macros with objects listed in the Object Browser. You make objects available by referencing type libraries. AutoCAD Map has two libraries, an AutoCAD library and an AutoCAD Map library (exact names vary with released versions).
To reference required libraries
1 Open the drawing or project.
2 From AutoCAD Map, choose Tools > Macro > Visual Basic Editor.
3 Choose Tools > References.
4 Locate the AutoCAD Map library in the list of references (exact name varies with released versions), and if it is not checked, click to check it.
5 Check that the following required libraries are already checked: the AutoCAD library (exact name varies with released versions), Visual Basic for Applications, OLE Automation, and Microsoft Forms 2.0 Object Library.
Now you can create macros that interact with AutoCAD Map through the Automation API libraries.