Until one of the guru's post the right way of doing it here is an idea
Information at bottom is copied from docs
The code below adds Xdata to a box and uses the Extended Data group 1011(Look at info at bottom) with a 3dPoint(0,0,0)
which will update with parent object.
Look at the Attached pictue and notice the values for the Position
There are groups like scale and distince so you use other groups to see if it scaled or streched
So when the objectModified event is fired you check the Xdata to see what change and calculate what needed.
The steps below are what I did to produce the results in the picture
1. Draw a box
2. Run code below
3. Use AutoCAD Command XDLIST then enter "X" for AppName
4. Move Box
5. Run XDLIST
[CommandMethod("XdataSolid")]
public void XdataSolid()
{
Database db = HostApplicationServices.WorkingDatabase;
Editor ed = Application.DocumentManager.MdiActiveDocument.Editor;
ObjectId solidID = ed.GetEntity("Select Soild").ObjectId;
using (Transaction tr = db.TransactionManager.StartTransaction())
{
RegAppTable regTbl = (RegAppTable)tr.GetObject(db.RegAppTableId, OpenMode.ForWrite, false);
RegAppTableRecord regRec = new RegAppTableRecord();
regRec.Name = "X";
regTbl.Add(regRec);
tr.AddNewlyCreatedDBObject(regRec, true);
Entity ent = solidID.GetObject(OpenMode.ForWrite) as Entity;
ent.XData = new ResultBuffer(new TypedValue(1001, "X"), new TypedValue(1011, new Point3d(0, 0, 0)));
tr.Commit();
}
World space position
1011. Unlike a simple 3D point, the world space coordinates are moved, scaled, rotated, and mirrored along with the parent entity to which the extended data belongs. The world space position is also stretched when the STRETCH command is applied to the parent entity and this point lies within the selection window.
World space displacement
1012. A 3D point that is scaled, rotated, or mirrored along with the parent, but not stretched or moved.
World direction
1013. Also a 3D point that is rotated, or mirrored along with the parent, but not scaled, stretched, or moved. The world direction is a normalized displacement that always has a unit length.
Distance
1041. A real value that is scaled along with the parent entity.
Scale factor
1042. Also a real value that is scaled along with the parent.