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

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

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

Answers

  • Mike.Thompson
    Mike.Thompson Member, Employee Posts: 330
    25 Answers First Anniversary 100 Comments 25 Likes
    ✭✭✭✭

    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 Comment First Anniversary Ansys Employee First Answer
    ✭✭✭

    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?