Hi Peter,

Thank you, I don not have MapBasic and as you say I can see it's a
complex action. The solution I wanted was running a script in MapBasic
window that automatic change colours on polylines based on the selected
attributes. The only solution I see now is to use a software (like
Manifold) that use themes on formatting drawings and export it to
Mid/Mif to get the colours included.

Thanks
Regards
Sören



 Hï Sören,

This cannot be done in a simple Update statement, becuase it's a complex
action that requires several steps:

1. Read the object from the table
2. Alter the object style using "Alter Object...."
3. update the object in the table with the new object

So you need either a loop or a special function, both solutions require
MapBasic.

'*************************************
'*************************************
'*************************************
1. The loop solution:
'*************************************
Sub UpdatePenStyle

Dim penNew As Pen,
    nRowID As Integer,
    oCur As Object

penNew = MakePen (2, 2, RED)

Fetch First From Selection
Do Until EOT(Selection)
   oCur   = Selection.OBJ
   nRowID = Selection.ROWID

   Alter Object oCur
      Info OBJ_INFO_PEN, penNew

   Update Selection
      Set   OBJ   = oCur
      Where ROWID = nRowID

   Fetch Next From Selection
Loop

End Sub
'*************************************
'*************************************
'*************************************
2. The function approach

'*************************************
Function AlterPenStyle(ByVal oLine As Object, ByVal penNew As Pen)

AlterPenStyle = oLine

'***Here you ought to built in some check on object type etc.

   Alter Object oLine
      Info OBJ_INFO_PEN, penNew

AlterPenStyle = oLine

End Function

'*************************************
Sub UpdatePenStyle

Dim penNew As Pen

penNew = MakePen (2, 2, RED)

Update Selection
   Set   OBJ   = AlterPenStyle(OBJ, penNew)

End Sub
'*************************************

HTH,
Peter Horsbĝll Mĝller
COWI A/S - Geographical Information

-----Original Message-----
From: Sören Lindqvist
To: [EMAIL PROTECTED]
Sent: 18-09-03 11:24
Subject: MI-L Change object colors in selection

Thanks for all helps this is a great list.

I have not find this in the manual how to do it.

I have an query selection on a network with polylines.
They are all standard black in color but I want to change the selection
to for example red color. How is this done?

Update selection .......???

Regards
Soren




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


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

Reply via email to