Colorscheme and Categories

Hi

I have a point and line shape file that are linked to the same key value eg each unique value could have a couple of points and some lines. I want the same unique values to be the same colour, but each separate value to be a different colour. I used the following and all the colours are different as required, but the points that belong with the lines with the same unique value the colours are not the same. I am thinking that as they are 2 different shape files this cannot be controlled. I am right in assuming I will to do my own expressions and apply these in order to make the colours the same?

fieldIndex = 0
With shpPnt(LyrNo).DefaultDrawingOptions
    .Visible = True
    .PointSize = 8
    .PointShape = tkPointShapeType.ptShapeCircle
End With
Dim schemePnt As New MapWinGis.ColorScheme
schemePnt.SetColors2 tkMapColor.Blue, tkMapColor.Yellow
shpPnt(LyrNo).Categories.Generate fieldIndex, tkClassificationType.ctUniqueValues, 0
shpPnt(LyrNo).Categories.ApplyColorScheme tkColorSchemeType.ctSchemeRandom, schemePnt
hndPnt(LyrNo) = Forms!DisplayGISmap.Map1.AddLayer(shpPnt(LyrNo), True)

With shpLine(LyrNo).DefaultDrawingOptions
    .LineWidth = 4
    .Visible = True
End With
Dim schemeLine As New MapWinGis.ColorScheme
schemeLine.SetColors2 tkMapColor.Blue, tkMapColor.Yellow
shpLine(LyrNo).Categories.Generate fieldIndex, tkClassificationType.ctUniqueValues, 0
shpLine(LyrNo).Categories.ApplyColorScheme tkColorSchemeType.ctSchemeRandom, schemeLine
hndLine(LyrNo) = Forms!DisplayGISmap.Map1.AddLayer(shpLine(LyrNo), True)
Forms!DisplayGISmap.Map1.Redraw

Regards

Colleen

Hello Colleen.

My uneducated guess (I would have to dig into the source) is that each shapefile would have to have the identical range and set of values for your specific key values to result in the same color. I wonder, however, if after setting the full range, you can add specific Breaks and Colors for the values you want to control. I assume that you’ve read this?

Outside of this, then you would likely instead have to take more control over the category expressions, as you suggest.

Let us know.
Regards,
Jerry.

Hi

Thanks for your input. I guess this way is never going to work as there could be points that don’t have lines for the same code and visa versa. I would have to use the category expressions

Regards

Colleen