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?
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, ...
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?
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"
John
http://www.support-pc.com
Order MapPoint 2006 Here
https://secure.mp2kmag.com/?refer=support-PC
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
There are currently 1 users browsing this thread. (0 members and 1 guests)