>There does not seem to be a variant of the Alter Object statement >to fix up the position of the centroid of a new region object. > >How do you set the centroid of a region programatically? Here's a sample MB application which demonstrates the object centroid manipulation ability of MI Pro and MapBasic 5.5. The beta is available at http://testdrive.mapinfo.com/mipro55 Include "MapBasic.def" Dim oRegion, oPoint As Object Dim x, y As Float oRegion = Selection.Obj oPoint = ObjectGeography(oRegion, OBJ_GEO_CENTROID) x = ObjectGeography(oPoint, OBJ_GEO_POINTX) y = ObjectGeography(oPoint, OBJ_GEO_POINTY) Alter Object oPoint Geography OBJ_GEO_POINTX, y Alter Object oPoint Geography OBJ_GEO_POINTY, x Alter Object oRegion Geography OBJ_GEO_CENTROID, oPoint Update Selection Set Object = oRegion ---------------------------------------------------------------------- To unsubscribe from this list, send e-mail to [EMAIL PROTECTED] and put "unsubscribe MAPINFO-L" in the message body, or contact [EMAIL PROTECTED]
