Hi All, I've been trying to write a tool that recenters polygons based on a user defined point. I've got it all figured out, except one strange problem. I've noticed the centroid of the polygons can shift during the recentering. I've tried the ConvertToPline, ConvertToRegion trick, but the centroid wont recenter if the original centroid (before polygon moving) is within the new bounds of the polygon. When I try to set the centroid to the user-defined point using the Alter Object command, I get an error that the point must be within the region. Argh! It's the point I used to recenter, so it's right at the center of the region!! Any thoughts? Here's a sample of my code too: For j=1 to numNode - 1 nodeX = ObjectNodeX(Mover, 1, j) nodeY = ObjectNodeY(Mover, 1, j) Alter Object Mover Node Set Position 1, j (nodeX + DeltaX, nodeY + DeltaY) Next Update Selection Set Obj = Mover Where Rowid = i Update Selection Set Obj = ConvertToPline(Mover) Where Rowid = i Update Selection Set Obj = ConvertToRegion(Mover) Where Rowid = I 'Alter Object Mover Geography OBJ_GEO_CENTROID, Targ_obj 'Update Selection Set Obj = Mover Where Rowid = i Thanks! Erin
Erin Comparri | Mapping Specialist CB Richard Ellis | CBRE Mapping Center 1620 Fountainhead Pkwy, Suite 610 | Tempe, AZ 85282 MC 877 580 4674 | F 480 929 6400 [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]> | www.cbre.com <http://www.cbre.com/> | mapping.cbre.com _______________________________________________ MapInfo-L mailing list [email protected] http://www.directionsmag.com/mailman/listinfo/mapinfo-l
