Use layout entity(lines,plane) to control the mate relationship between parts

Did anybody experience controlling the mate relationship between parts by using layout entity(line,plane)?

and more, use API to create the layout entity and use api to mate parts within an assembly?

Thanks first.

Jin

SolidworksApi macros