You could try first to select external faces on the part by getting all faces ( Body2.GetFaces()) ;
Get normal vector from each face( value = instance.Normal).
U can assume that vectors should be along certain axis and leave 4 faces;
From those you leave only 2 faces comparing their area (value = Face.GetArea());
Now take loops from faces (value = Face.GetLoops())
Then (value = Loop.IsOuter()) and value = Loop.Select(Edge, Append, SelectionData)
Thank you for taking the time to reply. I will try your ideas. Even though I am a total beginner, I believe that there is another way, that will work in most cases similar to this one.