Hi Shimon,Originally posted in cdnusers.org by Dave Elder
It is not easy to get the text centre location as it is not an attribute of the text dbid.
One method to calculate it is to use the height, width and character spacing of the text block that the text uses:
tbParam = axlGetParam(strcat("paramTextBlock:" txtObj ->textBlock))
txtHgt = tbParam ->height, chWid = tbParam ->width, chSpc = tbParam ->charSpace
Alternatively, and more easily, take the bounding box of the text object and find the centre of that:
bbox = txtObj ->bBox, centre = list((caar(bbox) + caadr(bbox)) / 2.0, (cadar(bbox) + cadadr(bbox)) / 2.0)
Good luck with Skill and keep the questions coming.
Note that neither method will give the exact centre of the actual text graphics.