Pick up edges and points using only three faces

i would like to run a macro to apply /  realign a  sldlfp (LIBRARY FEATURE) file to a model selecting only THREE FACES and have the macro select and match up the edges   - see attached pdf -

i not really sure how to write the lines to collect the information from the model and feed back the information

although in principle i should be able to get point #5 by using the get x and y of face one and intersect with x of face two this in turn should allow you to define line #3 and line #1, am not too the familiar with soildworks api,

Thank you for your help

this were am starting from

2017 SOLIDWORKS API Help - Find Outside Edges of Face Example (VBA)

SolidworksApi macros