AutoCAD VBA Programming: Tools and Techniques

There are objects everywhere in programming these days. Understanding the different types of objects can be daunting to a programmer who doesn't have experience with them. In general, an object is a container that is used to store data, to maintain data, and (on certain types of objects) to respond to events. This chapter will explore the use of custom classes in VBA. Specifically, we are going to show how to create our own objects, and how we can manipulate these objects into programming tools that greatly enhance our ability as programmers to produce good applications.
All the entities in the AutoCAD database are objects. There are entity objects, collection objects, and so forth. The repeated use of the term object can get confusing when talking about programming especially if you are new to object-oriented programming in the first place. One area of confusion in AutoCAD-based programming is that there are two types of objects.
The first type is a programming object that helps you in the program by organizing data and maintaining it. VBA allows you to create programming objects inside the program using the class module. Objects created in this manner have properties and methods; however, this type of object cannot contain event trigger definitions. We will see how to create an object after we see what is different between this kind of object and an AutoCAD object.
The second type of object is an AutoCAD object that is stored in the drawing database.