Re: MI MB: Latest Agony

2000-07-06 Thread Andrew_Dressel

I'm trying to make a single polygon in a single table change colors using
MB
and I can't seem to find the right MB incantation to make it happen.  All
I
want is to have the single selected polygon on the top layer of my map
window
be a distinct color from the other polygons around it. And I'd like it to
be
the same color every time the program fetches a new single polygon and
puts
that one on top of the layer control pile.  Does one of the MB experts in
the
crowd have a minute to brief me on this?

These four lines change the selected object to solid green

  Dim o As Object
  o = Selection.Obj
  Alter Object o Info 3, MakeBrush(2, RGB(0,255,0), RGB(0,0,0))
  Update Selection Set Obj = o

I don't know how your "program fetchs a new single polygon and puts that
one
on top of the layer control pile", but you'll likely need a similar
combination of Alter Object and Update statements.

--
To unsubscribe from this list, send e-mail to [EMAIL PROTECTED] and put
"unsubscribe MAPINFO-L" in the message body, or contact [EMAIL PROTECTED]



Re: MI MB: Latest Agony

2000-07-06 Thread Ian Garner

This may help

Dim a as object
Select * from your table where criteria to select the object into
temptable
a = selection.obj
ALTER OBJECT a INFO 3, MakeBrush(1, CYAN, BLUE)
UPDATE TempTable set obj = oDMA where rowid = 1

Commit table your table interactive

note
Makebrush command format = (pattern, forecolour, backcolour)

Ian

- Original Message -
From: Tim Rood [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Wednesday, July 05, 2000 6:02 PM
Subject: MI MB: Latest Agony



 I'm trying to make a single polygon in a single table change colors using
MB
 and I can't seem to find the right MB incantation to make it happen.  All
I
 want is to have the single selected polygon on the top layer of my map
window
 be a distinct color from the other polygons around it. And I'd like it to
be
 the same color every time the program fetches a new single polygon and
puts
 that one on top of the layer control pile.  Does one of the MB experts in
the
 crowd have a minute to brief me on this?
 Thanks,
 Tim Rood



 --
 To unsubscribe from this list, send e-mail to [EMAIL PROTECTED] and put
 "unsubscribe MAPINFO-L" in the message body, or contact [EMAIL PROTECTED]



--
To unsubscribe from this list, send e-mail to [EMAIL PROTECTED] and put
"unsubscribe MAPINFO-L" in the message body, or contact [EMAIL PROTECTED]



Re: MI MB: Latest Agony

2000-07-06 Thread Bill Thoen


Tim Rood wrote:
 
 I'm trying to make a single polygon in a single table change colors using MB
 and I can't seem to find the right MB incantation to make it happen.  All I

Another MapBasic agony? You might try swallowing a live toad
before sitting down to your next MapBasic session. Then
comparatively, the rest of the day will seem pretty pleasant.

Anyway, here's how to do this:
First you have to get access to the record with the polygon you
want to change. There's lots of ways to do this (see SQL select,
SelectionInfo(), fetch, etc.), but let's say the record cursor is
pointing at it, and the table is called POLY.

'---
dim objPoly as object
dim brushPoly as brush

'you need to include mapbasic.def for color definitions
brushPoly = makeBrush (2, YELLOW, WHITE)

objPoly = POLY.obj
nRow = POLY.rowid

alter object objPoly info OBJ_INFO_BRUSH, brushPoly
update POLY set obj = objPoly where rowid = nRow
'---

What I didn't understand when I was first struggling with this
myself is that you have to "update" the table or nothin shows.
Also notice the "where rowid = nRow" bit. Leave this off and ALL
you records get changed to this object.

- Bill Thoen

GISnet, 1401 Walnut St., Suite C, Boulder, CO  80302
tel: 303-786-9961, fax: 303-443-4856
mailto:[EMAIL PROTECTED], http://www.ctmap.com/gisnet

--
To unsubscribe from this list, send e-mail to [EMAIL PROTECTED] and put
"unsubscribe MAPINFO-L" in the message body, or contact [EMAIL PROTECTED]



MI MB: Latest Agony

2000-07-05 Thread Tim Rood


I'm trying to make a single polygon in a single table change colors using MB 
and I can't seem to find the right MB incantation to make it happen.  All I 
want is to have the single selected polygon on the top layer of my map window 
be a distinct color from the other polygons around it. And I'd like it to be 
the same color every time the program fetches a new single polygon and puts 
that one on top of the layer control pile.  Does one of the MB experts in the 
crowd have a minute to brief me on this?
Thanks,
Tim Rood



--
To unsubscribe from this list, send e-mail to [EMAIL PROTECTED] and put
"unsubscribe MAPINFO-L" in the message body, or contact [EMAIL PROTECTED]