How to copy orientation

Hey guys,

I’m doing a pretty simple project for 3D printing later. But I came across a section that I could do manually and be done with it, but I want to kind of “automate” it (not sure how to call it sorry).

So, basically I want the mesh A to have the same rotation as the edge B.

I’m pretty sure I used to do this fairly easy in the past but now I’ve been wasting hours trying to “automate” this but brain not braining!

- I’m not looking for answers like: you can rotate it in the Y axis and try to match it, or something like that 😅 I’m sure there’s a pretty simple option with append or something else that I can’t remember.

Thank you everyone for your help!!!