block & sketchline trim

I am writing api for trimming block inserter on sketchline in drawing.

Pls guide me if anybody have done this.

api help gives trmming for 2 sketch lines but I need to write a code for block & line trim

api code is attached for your ref.

swsketchtrimtwoentities is not useful for my requirement

SolidworksApi macros