Welcome to MapForums!

Register, sign in, or use Facebook Connect above to join in and participate in the forum.

When you are signed in, this message, the ads in this row, and the red-underlined link ads all go away.

Subscribe to receive our newsletter.
Subscribe Unsubscribe
Results 1 to 3 of 3

Naming Shapes

This is a discussion on Naming Shapes within the MapPoint Desktop Discussion forums, part of the Map Forums category; I have a similar problem to this post . However the solution it to identify the shapes using their name, ...

  1. #1
    Daniel is offline Junior Member White Belt
    Join Date
    Jul 2004
    Posts
    8

    Naming Shapes

    I have a similar problem to this post. However the solution it to identify the shapes using their name, unfortunately I can't figure out how to name a shape from within MapPoint. Can anyone shed some light?

  2. #2
    John Meyer's Avatar
    John Meyer is offline Senior Member Blue Belt
    Join Date
    Jul 2002
    Posts
    478
    Here is a sample for you that might help. Note that shapes like geoLine, geoFreeform and geoTextBox do not have a name property.

    Code:
    Dim objmap As MapPointCtl.Map
    Set objmap = MappointControl1.ActiveMap
        
    Dim objShapes As MapPointCtl.Shapes
    Dim objshape As MapPointCtl.Shape
    Set objShapes = objmap.Shapes
    
    Set objshape = objShapes.AddShape(geoShapeRadius, objmap.FindResults("Denver, CO").Item(1), 500, 500)
    objshape.Name = "MyShape"

  3. #3
    Daniel is offline Junior Member White Belt
    Join Date
    Jul 2004
    Posts
    8
    I've had to determin the zone based on it's type, colour and width, which is a pain as it's not very generic. Although you state geoFreeform doesn't have a name property mappoint seems happy to set and return it.
    Code:
        Dim Shape As MapPoint.Shape
        For Each Shape In mpc.ActiveMap.Shapes
            Select Case GetItemType(Shape)
                Case "geoFreeform"
                    ' Set freeforms based on fill colour.
                    If Shape.Fill.ForeColor = 10092543 Then Shape.Name = "Zone A"
                    If Shape.Fill.ForeColor = 1 Then Shape.Name = "Zone E"
                Case "Circle based on a radius"
                    ' Set radii based on width.
                    If Shape.Width > 4 And Shape.Width < 5 Then Shape.Name = "Zone B"
                    If Shape.Width > 8 And Shape.Width < 9 Then Shape.Name = "Zone C"
                    If Shape.Width > 12 And Shape.Width < 13 Then Shape.Name = "Zone D"
            End Select
        Next

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Pushpins from shapes
    By glennuser in forum MapPoint Desktop Discussion
    Replies: 12
    Last Post: 03-29-2004, 08:36 AM
  2. Shapes behind roads?
    By Anonymous in forum MapPoint Desktop Discussion
    Replies: 0
    Last Post: 08-27-2003, 10:35 AM
  3. Using Shapes as Territories
    By Anonymous in forum MapPoint Desktop Discussion
    Replies: 0
    Last Post: 08-01-2003, 10:14 AM
  4. Shapes and Queries
    By Anonymous in forum MapPoint Desktop Discussion
    Replies: 1
    Last Post: 06-09-2003, 06:20 PM
  5. Transparent shapes
    By Anonymous in forum MapPoint Desktop Discussion
    Replies: 2
    Last Post: 06-01-2003, 01:59 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25