How to write a button for trimming planes?

I use the 2015 version and I want to clarify one thing: is there any way to write a macro to automatically trim the plane when building the model?

There is a similar thing when building pipe structures.

SolidworksApi/macros