How to rotate a grouped artworks in the same way as Rotate Tool ?
I have made some code that rotates a grouped artwork.
ASErr rotate( AIArtHandle ah, AIReal radians, AIRealPoint const& center )
{
ASErr err = 0;
AIRealMatrix mtx;
sAIRealMath->AIRealMatrixSetTranslate ( &mtx, -center.h, -center.v );
sAIRealMath->AIRealMatrixConcatRotate ( &mtx, radians );
sAIRealMath->AIRealMatrixConcatTranslate( &mtx, center.h, center.v );
err = sAITransformArt->TransformArt( ah, &mtx, 1, kTransformObjects );
return err;
}
..................
ASErr err = kNoErr;
//--------------------------------------- ah_selection
AIArtHandle ah_selection = ..................
AIRealRect rect = ..............
AIRealPoint center;
center.h = (rect.right+rect.left) / 2;
center.v = (rect.top+rect.bottom) / 2;
AIReal radians = sAIRealMath->DegreeToRadian(30);
//---------------------------------------
AIArtHandle child = NULL;
err = sAIArt->GetArtFirstChild(ah_selection, &child);
err = rotate( child, radians, center );
while (1)
{
err = sAIArt->GetArtSibling(child, &child);
if ( err || child == NULL)
break;
err = rotate( child, radians, center );
}
It works but with one difference. When I select a grouped artworks and apply to it, it's bounding box does not rotates.

This is same as " Object > Transform > Transform Each" menu way that individual are having their own origin points.
How can I rotate with bounding box also rotated ?
Thanks in advance.
