Community of VE/MapPoint Users and Developers
This is a discussion on Naming Shapes within the MapPoint 2006/2009 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, ...
| |||||||
| Register | Blogs | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| |||
| Naming Shapes |
| ||||
|
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
|
![]() |
| Tags |
| naming, shapes |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
| |
| ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Pushpins from shapes | glennuser | MapPoint 2006/2009 Discussion | 12 | 03-29-2004 08:36 AM |
| Shapes behind roads? | Anonymous | MapPoint 2006/2009 Discussion | 0 | 08-27-2003 10:35 AM |
| Using Shapes as Territories | Anonymous | MapPoint 2006/2009 Discussion | 0 | 08-01-2003 10:14 AM |
| Shapes and Queries | Anonymous | MapPoint 2006/2009 Discussion | 1 | 06-09-2003 06:20 PM |
| Transparent shapes | Anonymous | MapPoint 2006/2009 Discussion | 2 | 06-01-2003 01:59 PM |