Accessing the object hierarchy is easy from within VBA. This is because VBA is running in-process with the current AutoCAD session so there is no additional step needed to connect it to the application.
ThisDrawing object. By using ThisDrawing you gain immediate access to the current Document object and all of its methods and properties, and all of the other objects in the hierarchy.
VBA provides a link to the active drawing in the current AutoCAD session through theThisDrawing always refers to the active document in AutoCAD. When used in embedded projects, ThisDrawing always refers to the document containing the project. For example, the following line of code in a global project saves whatever drawing is currently active in AutoCAD:
When used in global projects,ThisDrawing.Save