Thanks to everyone for their help.

Martin Roundhill came up with the solution and his answer is included.

Regards,

Matt Fossey
GIS Officer
Narrabri Shire Council
PH:     (02) 6799 6826
FAX:    (02) 6799 6888
EMAIL   [EMAIL PROTECTED]


-----Original Message-----
From:   Martin Roundill [SMTP:[EMAIL PROTECTED]]
<mailto:[SMTP:[EMAIL PROTECTED]]> 
Sent:   Monday, 24 September 2001 3:12 PM
To:     'Matthew Fossey'; '[EMAIL PROTECTED]'
Subject:        RE: MI-L Workspace Stuff

Hi Matthew,

The only way that pops to mind is to use the extractnodes function.  You
will need to check your data to find out how many "parts" the regions have.
If all the regions are single parts then you could simply use the following
code:
                'set the current colour to a green fill - you could also set
the pen
if required
                set style brush makebrush(2,45056,16777215)  
'assuming you have an existing selection set
update selection set object
converttoregion(converttopline(extractnodes(object,1,1,1,1)))
What this does is extract the first polygon object from each selected item
converts it to a polyline and then back into a region - this is required to
use the style set above - otherwise it would just return the existing
symbology.
See below for definition of the extractnodes command.
If you have multiple part regions you will need to have code that extracts
each part converts it and then combines it back together, along the lines
of:
                'set the current colour to a green fill - you could set the
pen if
required
                set style brush makebrush(2,45056,16777215)  
select * from selection into toprocess 'change as appropriate
                'Process the single part regions
                select * from toprocess where
val(str$(objectinfo(object,21))) = 1
into tochange  
                '21 is the code for
OBJ_INFO_NPOLYGONS
update tochange  set object
converttoregion(converttopline(extractnodes(object,1,1,1,1)))

                'Process the regions with 2 parts to them
                select * from toprocess where
val(str$(objectinfo(object,21))) = 2
into tochange  
                update tochange  set object = 
Combine(
converttoregion(converttopline(extractnodes(object,1,1,1,1))),
converttoregion(converttopline(extractnodes(object,2,1,1,1))) 
                        )

                'Process the regions with 2 parts to them
                select * from toprocess where
val(str$(objectinfo(object,21))) = 2
into tochange  
                update tochange  set object = 
Combine(
converttoregion(converttopline(extractnodes(object,1,1,1,1))),
                Combine(
converttoregion(converttopline(extractnodes(object,2,1,1,1))),
converttoregion(converttopline(extractnodes(object,3,1,1,1))) 
                                        )
                        )


etc...
Below is the extractnodes definition.
Hope this helps
Regards
Martin
=================================
Martin Roundill
GIS Manager
Waitakere City Council
Private Bag 93109
Henderson
Waitakere City
New Zealand




**********************************************************
ExtractNodes() function
**********************************************************
Purpose
Returns a polyline or region created from a subset of the nodes in an
existing object.
Syntax
ExtractNodes( object, polygon_index, begin_node, end_node, b_region ) 
object  is a polyline or region object
polygon_index  is an SmallInt value, 1 or larger: for region objects, this
indicates which polygon to query; for polylines, which section
begin_node  is a SmallInt node number, 1 or larger; indicates the beginning
of the range of nodes to return
end_node  is a SmallInt node number, 1 or larger; indicates the end of the
range of nodes to return
b_region  is a Logical value that controls whether a region or polyline
object is returned;  use TRUE for a region object or FALSE for a polyline
object
Return Value
Returns an object with the specified nodes. MapBasic applies all styles
(color, etc.) of the original object; then, if necessary, MapBasic applies
the current drawing styles. 
Description
If the beginnode is equal to or greater than endnode, the nodes are returned
in the following order:
                begin_node through the next-to-last node in the polygon;
                First node in polygon through end_node.
If object is a region object, and if begin_node and end_node are both equal
to 1, MapBasic returns the entire set of nodes for that polygon. This
provides a simple mechanism for extracting a single polygon from a
multiple-polygon region. To determine the number of polygons in a region,
call ObjectInfo( ). 
Error Conditions  
ERR_FCN_ARG_RANGE error generated if b_region is FALSE and the range of
nodes contains fewer than two nodes, or if b_region is TRUE and the range of
nodes contains fewer than three nodes. 







-----Original Message-----
From:   Matthew Fossey [mailto:[EMAIL PROTECTED]]
<mailto:[mailto:[EMAIL PROTECTED]]> 
Sent:   Monday, 24 September 2001 14:26
To:     '[EMAIL PROTECTED]'
Subject:        MI-L Workspace Stuff



Listers
Thanks for the responses, but it appears that I didn't seem to explain
myself very well. I wish to automatically select all from the mapped table
data and assign a brush permanently to this data using the .WOR file.  I
have already formatted and changed table structures and names using the .WOR
file so it automatically extracts information in a consistent format, now
all I need to do is find out how to automatically assign a brush to
everything in the layer.
Does anyone know if this can be done, and how?
                                Regards,

                                Matt Fossey
                                GIS Officer
                                Narrabri Shire Council
                                PH:     (02) 6799 6826
                                FAX:    (02) 6799 6888
                                EMAIL   [EMAIL PROTECTED]
<mailto:[EMAIL PROTECTED]> 

Previous Question:
Listers.
I know this is going to be a simple concept for many of you, but I am having
a little trouble and was wondering if you could help me out.  I have been
altering a workspace to extract property and rates data from our database
and running a match to the existing cadastre, selecting those parcels with
an exact match. Where I have trouble is that I want to assign all polygons
within this layer with a colour (brush) but cannot seem to get it to work. I
was wondering if this cannot be done in a workspace and you require MapBasic
(which I do not have) or I just haven't got the syntax correct.
Any ideas would be gratefully received.
TIA
Regards,
Matt Fossey


****************************************************************************
**************
This message is intended for the addressee named and may contain
confidential information.
If you are not the intended recipient, please delete it and notify the
sender. Views expressed in this message are those of the individual sender,
and are not necessarily the views of the Narrabri Shire Council, unless
otherwise stated.  
For the purposes of the Copyright Act, the permission of the holder of
copyright in this communication may be taken to have been granted, unless
stated otherwise, for the copying or forwarding of this message, as long as
both the content of this communication and the purposes for which it is
copied or forwarded are work-related. 

****************************************************************************
**************



_______________________________________________________________________
List hosting provided by Directions Magazine | www.directionsmag.com
<http://www.directionsmag.com>  | To unsubscribe, send e-mail to
[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>
and put "unsubscribe MapInfo-L" in the message body.



_______________________________________________________________________
List hosting provided by Directions Magazine | www.directionsmag.com |
To unsubscribe, send e-mail to [EMAIL PROTECTED] and
put "unsubscribe MapInfo-L" in the message body.

Reply via email to