Lets say, you have created a custom entity based on a polyline, but derived from a AcDbEntity, and wish to change the way BHATCH and BOUNDARY find the edges of my object.
You can do this by overriding the AcDbEntity::explode() virtual method to return the boundaries you want used by the BOUNDARY or BHATCH commands. You would check the CMDNAMES system variable, to see whether one of the two commands was active, and then return the appropriate entities. Note that if you derive from AcDbPolyline, it will not call explode on your entity, but will use
the Polyline data directly.