Intersecting a Custom Entity with Another Entity

ObjectARX ®  is an open architecture where multiple applications can implement their own custom entities. It's possible that multiple applications will be loaded at the same time in an AutoCAD session. The user might select your custom entity in an operation that causes it to intersect with another custom entity that you are not aware of. The following guidelines should help you implement the subIntersectWith() function of your custom entity.

During this process, you need to be careful about how you call the intersectWith() function of the argument and how you interpret the points that are the results of intersection. For example, if the intersection type was kExtendArg, you want to change it to kExtendThis before calling intersectWith() on the argument. Similarly, if the intersection is an apparent intersection on a plane of projection, the points returned from the intersectWith() call on the argument entity is on the argument entity, not necessarily on your entity. You're supposed to return the intersection points on your entity; therefore, you need to project the points back onto the projection plane (where they will lie on your projected entity) and then project them back onto your entity before returning.