Selecting only vertical or horizontal lines

Is it possible to select only vertical or horizontal lines? Or, for that matter, lines which only go at a particular specific angle?

I’m looking create object edge lines which overlap like as below. (For one simple object It would be easy to extract wire frame and explode it and select only vertical or horizontal lines, but for many objects of differing sizes, or for complex objects, I’m not sure how to select and then stretch only those going at a particular direction/angle.)

Be easier to help if you uploaded some geometry to work with.

You can write a quick grasshopper script that takes the edges, calculates the angle with the direction vector you are interested in (here the z axis), then isolates the ones whose angle is 0 (modulo Pi) using Dispatch

Although next time please provide an example file so we can see more clearly what you wish to accomplish

vertical-select-gh.gh (8.1 KB)

Vertical-select-rhino.3dm (239.4 KB)

Here are a few scripts from my library:

SelWorldVertical.py (5.5 KB)
SelCPlaneVertical.py (5.5 KB)

SelWorldHorizontal.py (4.3 KB)
SelCPlaneHorizontal.py (4.3 KB)

SelXParallelLines.py (2.7 KB)
SelYParallelLines.py (2.7 KB)
SelZParallelLines.py (2.7 KB)

Thanks all. Looking forward to trying these out.