Orienting disoriented surface

hi guys, i have a bunch of planes that i need to rotatte flat, i could project it but i would lose the true dimension of the plane, is there a way to orient its surface to another surface? so far only in 3ds max i know this to be possible

Orient3Pt should work here I thinkā€¦ If you have a lot, a scripted solution will probably be the best, though. --Mitch

yes a script would be useful! but great this is exactly what i needed!