Getting 3d intersection curves..

Hi.. I don't know how to get 3d the intersection curves between modeldoc and number of planes automatically. I think first we need to select all faces of model, then use firstfeature to automatically select each plane and get 3d intersection curve on model. I did it manually i.e. hardcoded way but I need a general method that will work for every case. Any help guys. I also want to know how we can get the extreme points of model doc or possible max and min values of x, y, z coordinates.. Plz help me out guys...

SolidworksApi macros