MapInfo Pro

 View Only
  • 1.  Text objects MBR

    Posted 06-18-2024 10:33

    Hi,
    I think this may have been raised before but I can't find the post.

    I'm trying to work out the MBR for text objects without taking into account the label lines.

    I've tried taking the object and resetting the label line to the centroid of the object and then swtiching off the label line.
    But the MBR() still returns the full region including the original line.

    x = CentroidX(oText)
    y = CentroidY(oText)
    'reset arrow and then remove arrow so mbr to just text object
    Alter object oText Geography OBJ_GEO_TEXTLINEX, x
    Alter object oText Geography OBJ_GEO_TEXTLINEY, y
    Alter object oText Info OBJ_INFO_TEXTARROW, 0
    oMRB = MBR(oText)
    MRBx1 = ObjectGeography(oMRB,OBJ_GEO_MINX)
    MRBy1 = ObjectGeography(oMRB,OBJ_GEO_MINY)
    MRBx2 = ObjectGeography(oMRB,OBJ_GEO_MAXX)
    MRBy2 = ObjectGeography(oMRB,OBJ_GEO_MAXY)
    I then create rectangles using those coords and as you can see the MBR returned, still includes the arrow.
    So how can I determine the actual coords of the text object?
    Cheers
    David


    ------------------------------
    Dave Wilson
    Buchanan Computing Ltd
    London
    ------------------------------