My script aligns object to face like this:
But i need to get this:
there is a code i used:
faces = (polyOp.getFaceSelection $Box001) as array
face = faces[1]
theMatrix = matrixFromNormal(polyOp.getFaceNormal $Box001 face)
theMatrix.row4 = polyOp.getFaceCenter $Box001 face
$object.transform = theMatrix
Help me, friends :)