How to compare a sketch segment against an assigned variable

This is in relation to a previous question I had that I figured out. I have a spline, horizontal line, and an array of vertical lines. I need to loop through my array of vertical lines to get the lengths of each and the end points. If I created a variable that I assigned to the horizontal line segment in my code, how do I code the logic to avoid selecting this line when I only want the vertical lines?

SolidworksApi macros