Well, if you have MapBasic, I'll provide the code.

1. Start by setting the default Region style using the default Mapinfo menu item for 
this. We'll then just use this style. This will of course only work if the style 
should be the same for all 200 tables.
2. Open the tables to have the region style changed

3. Insert the following In a new module in MapBasic, Save the file and compile.

Include "MapBasic.def"
Declare Sub Main

'**************************************
Sub Main

Dim     i, nRowID As Integer,
        szTab As String,
        aObj, aRow As Alias,
        oRegion As Object,
        brsNew As Brush,
        penNew As Pen

        If SystemInfo(SYS_INFO_MIVERSION) >= 700 Then
                penNew  = CurrentBorderPen( )   'Pen for Region
                brsNew  = CurrentBrush()
        Else
                penNew  = CurrentPen()          'Pen for both Region and Line
                brsNew  = CurrentBrush()
        End If

        For i = 1 To NumTables()
                szTab = TableInfo(i, TAB_INFO_NAME)
                Print "Updating styles on " & szTab & ", please wait...."
                aObj    = szTab & ".OBJ"
                aRow    = szTab & ".ROWID"

                'If you are sure what you are doing, and you want speed, use this 
command
                'Set Table szTab FastEdit On Undo Off

                Fetch First From szTab
                Do Until EOT(szTab)
                        nRowID  = aRow

                        If aObj Then
                                oRegion = aObj
                                If ObjectInfo(oRegion, OBJ_INFO_TYPE) = 
OBJ_TYPE_REGION Then
                                        Alter Object oRegion
                                                Info OBJ_INFO_PEN, penNew
                                        Alter Object oRegion
                                                Info OBJ_INFO_BRUSH, brsNew

                                        Update szTab
                                                Set     OBJ     = oRegion
                                                Where   ROWID   = nRowID

                                End If
                        End If
                        Fetch Next From szTab
                Loop

                'If you were sure what you were doing, or you wanted speed, use this 
command
                'Commit Table szTab
                'Set Table szTab FastEdit Off Undo On
        Next

End Sub

4. Run the application

HTH,
Peter Horsb�ll M�ller
GIS Developer
Geographical Information & IT
 
COWI A/S
Odensevej 95
DK-5260 Odense S.
Denmark
 
Tel     +45 6311 4900
Direct  +45 6311 4908
Mob     +45 5156 1045
Fax     +45 6311 4949
E-mail  [EMAIL PROTECTED]
http://www.cowi.dk


-----Original Message-----
From: Miguel Marques [mailto:[EMAIL PROTECTED] 
Sent: Friday, April 02, 2004 4:55 PM
To: [EMAIL PROTECTED]
Subject: MI-L Changing regions styles of several tables


Hi.

I have more than 200 tables with region objects (only)
and i would like to change pattern to all of them.
I have mapbasic but dont know how to program.

Any sugestions?

Thanks in advance.

__________________________________
Do you Yahoo!?
Yahoo! Small Business $15K Web Design Giveaway 
http://promotions.yahoo.com/design_giveaway/

---------------------------------------------------------------------
List hosting provided by Directions Magazine | www.directionsmag.com | To unsubscribe, 
e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
Message number: 11253


Reply via email to