Rotate To Grid handles a specific alignment task in 3ds Max: orienting an object along an edge. Take an Editable Poly object or apply the Edit Poly modifier, select a single edge, and call the script. The object aligns to the closest axis along that edge using face normals, much the same way Align to Edge works in Unwrap UVW, but in 3d.
The script is aimed at virtual studios and background planes where a reference image is not aligned properly. You can cut an edge using QuickSlice and then align the plane along it. It can also restore object orientation when transformations have been lost, for example after Reset X-Form is applied.
For edges shared by non-planar faces, there are two special cases: if the faces share at least one smoothing group, their average normal is used; if they share no smoothing group, the normal of one face is used. Rotate To Grid works with both Edit Poly and Editable Poly and has been tested on 3ds Max 2023 and 2024.