Thanks to Robert Crossley I was able to change points objects in rectangles.
The way to do is:
Function makeRect(BYVAL Pointobj As Object) As OBJECT
Dim myObj As Object
Create Rect Into myObj
((CentroidX(PointObj)-GridSpace/2),
(CentroidY(PointObj)-GridSpace/2))
((CentroidX(PointObj)+GridSpace/2),
(CentroidY(PointObj)+GridSpace/2))
makeRect=myObj
End Function
Update Table Set Obj = makeRect(obj)
Thanks a lot for your help.
Carla
Original queation:
> Last week I had a question how I could change a set of points which are
> situated in a regular grid into a polygon. I came to the conclusion that
> probably the easiest way is to change the points into squares, so that
they
> fit exactly to each other, and then combine them into one polygon.
>
> For this I can use the alter object command to change the object for
every
> point into a rectangle, but with the alter object every record will be
> changed one by one, which is much too slow, as I might have more then one
> million records.
> In the mapbasic help they recommand to use the Update command, where a
> complete selection is changed. To change the object, they give the
example:
> Update "selection"
> set object = CreatePoint(CentroidX(obj),CentroidY(obj))
> This brings me to the next question: If I want to use the update command
to
> change the object, and I want to change the object into a rectangle, how
can
> I do that? It seems to me that one can only use CreatePoint(),
> CreateCircle(), CreateLine() and CreateText(). Why isn't there a
> CreateRect() function?
> (There is a Create rect command, but it seems that I can not use that
> together with the update command?)
>
> Thanks, Carla
----------------------------------------------------------------------
To unsubscribe from this list, send e-mail to [EMAIL PROTECTED] and put
"unsubscribe MAPINFO-L" in the message body, or contact [EMAIL PROTECTED]