# HOW TO SELECT VERTICAL EDGE IN POLY ?

I have a building , i tried to select vertical edge but i can not , can you help me ? Thank you very much

## Comment viewing options ### and How to select horizontal

and How to select horizontal edges? ### :)

actionMan.executeAction 0 "40044" -- Selection: Select Invert ### .

What is "vertical" edge?

You can try this:
1- get the edges one by one
2- get the verts of this edge
3- check if the Z position of one verts is higher than the Z position of the other vert. If the X and Y position of both verts are the same then this is "vertical" edge. ### thank

but how can i do in maxscript ? can you give me the function ? ### .

Select only one Editable Poly object.

```(
if selection.count == 1 and classOf selection == Editable_Poly do
(
threshold = 1.0

curO = selection
curOEdgesBA = #{1..(polyop.getNumedges curO)}
vertEdgesBA = #{}

for eIdx in curOEdgesBA do
(
edgeVertsArr = polyop.getEdgeVerts curO eIdx
v01pos = polyop.getVert curO edgeVertsArr
v02pos = polyop.getVert curO edgeVertsArr

if v01pos.z != v02pos.z do
(
if abs (v01pos.x - v02pos.x) <= threshold and abs (v01pos.y - v02pos.y) <= threshold do
vertEdgesBA += #{eIdx}
)
)

if vertEdgesBA.numberset != 0 then
(
subobjectlevel = 2
polyop.setEdgeSelection curO vertEdgesBA
)
else
messagebox "No vertical edges" title:""
)
)``` ### thank u very much

when i wait you , i do one for my self :)

mangcanh =#()
sPoly=\$
subObjectLevel = 2
actionMan.executeAction 0 "40021" -- Selection: Select All
idcanh = sPoly.getSelection #Edge as array
k = idcanh.count
for i = 1 to k do
(
polyop.setEdgeSelection sPoly i
redrawViews()
sPoly.convertSelection #Edge #Vertex
aVerts = sPoly.getSelection #Vertex as array
diema = aVerts
diemb = aVerts