Object References

An object reference can be either hard or soft, and it can be either an ownership reference or a pointer reference. The hard or soft distinction indicates whether the referenced object is essential to the existence of the object that refers to it. A hard reference indicates that an object depends on the referenced object for its survival. A soft reference indicates that an object has some kind of relationship to the referenced object, but it is not an essential one.

An ownership reference dictates how objects are filed. If one object owns another, then whenever the first object is filed out, it takes the owned object with it. Because an object can have only one owner, ownership references are used for nonredundant writing out of the database. In contrast, pointer references are used to express any arbitrary reference between AcDb objects. Pointer references are used for complete (redundant) writing out of the database.

For example, in the following figure, the double lines indicate ownership references. If you follow the double lines, you touch every object in this small database only once. If you also follow the single lines, which represent pointer references, you touch some objects more than once, because multiple objects can point to the same object. To obtain the full “definition” of the AcDbLine object, you would need to follow all the hard references, both ownership and pointer (that is, both the single and double solid lines).