How can I create a selection of all edges parallel to the x-axis using Scripting?

Options
Ryoma
Ryoma Member, Employee Posts: 7
First Answer First Anniversary Ansys Employee First Comment

How can I create a selection of all edges parallel to the x-axis using Scripting?

Answers

  • Mike.Thompson
    Mike.Thompson Member, Employee Posts: 279
    First Anniversary First Comment 5 Likes Ansys Employee
    Options

    I’m not sure which application you are asking about so I will comment on the general solution.
    Loop through all edges and filter out any that are not straight lines. Convert the line into a unit vector and do the dot product of the edge vector to the vector (1,0,0). If you are not worried about flipped orientation take the absolute value of the dot product.
    Perfect alignment will have 1 for dot product, but you can set a tolerance like anything above 0.999 is aligned.
    Save all the edges that meet criteria to a list, then convert this to an active selection or named selection/group

  • Ryoma
    Ryoma Member, Employee Posts: 7
    First Answer First Anniversary Ansys Employee First Comment
    Options

    Hi Mike, I posted this question here to share a script I created, but I think I created it twice by mistake.

    https://discuss.ansys.com/discussion/3286/how-can-i-create-a-selection-of-all-edges-parallel-to-the-x-axis-using-scripting#latest

    How can I withdraw this question?