Assign a Color to a Shape

I am sure this is an easy thing to do, but I cannot find out how to do this outside of a shape file. I see in the old documentation that you can use Map1.ShapeFillColor but it no longer seems to work. I am zooming to a shape and want to make just that shape a different colour eg zoom to a road. I have also looked at the drawing layer but there does not seem to be anything to draw just that shape. Even better would be able to zoom to a shape and flash that shape as a different colour 3 times. Does anyone have any ideas on this?


Colleen Crawford

Hi Collen

I have a Access VBA application that highlights a road in yellow, and zooms to the feature. The code is as follows:

The shapefile name is ShapeFile_Roads_Undev . Transparency values are 0 to 255 .

' Undeveloped Roads

    Undev_Road = 0
        For Undev_Road = 0 To ShapeFile_Roads_Undev.NumShapes - 1
               If ShapeFile_Roads_Undev.CellValue(FieldNumber, Undev_Road) = Spatial_ID Then
                     shapenumber = Undev_Road
                    ShapeFile_Roads_Undev.ShapeSelected(Undev_Road) = True

                                ShapeFile_Roads_Undev.SelectionDrawingOptions.LineWidth = 8
                                ShapeFile_Roads_Undev.Selectable = True
                                ShapeFile_Roads_Undev.SelectionTransparency = 255
                                ShapeFile_Roads_Undev.SelectionColor = vbYellow
                                ShapeFile_Roads_Undev.SelectionAppearance = saDrawingOptions
                            'Set Label Values  ------------------------------------------------------------------------------------
                                 x = ShapeFile_Roads_Undev.Shape(Undev_Road).Point(0).x
                                 y = ShapeFile_Roads_Undev.Shape(Undev_Road).Point(0).y
                                 LabelText = ShapeFile_Roads_Undev.CellValue(FieldNumber, Undev_Road)
                                 ShapeFile_Roads_Undev.Labels.OffsetX = 10
                                 ShapeFile_Roads_Undev.Labels.OffsetY = -10
                                 ShapeFile_Roads_Undev.Labels.Alignment = laTopRight
                                 ShapeFile_Roads_Undev.Labels.FrameBackColor = vbYellow
                                 ShapeFile_Roads_Undev.Labels.FontColor = vbBlack
                                 MapLabel = ShapeFile_Roads_Undev.Labels.InsertLabel(Undev_Road, LabelText, x, y, angleRotation, -1)
                     ZoomSkip = True
                     GoTo foundRecord
               End If
         Next Undev_Road


’ Zoom to Asset

ZoomToAsset = Map0.ZoomToShape(zoom_layer, shapenumber)

Thank you - I had just figured it out and came to post. I did not know how to select the shape I had zoomed to but see that it is very easy.
With shpRdLineBackground
.ShapeSelected(i) = True
.SelectionColor = vbGreen
.SelectionTransparency = 255
’ It seems this is the default - it puts a very thin green line on the edges of the Road
.SelectionAppearance = saSelectionColor
End With