View Single Post

  #9 (permalink)  
Old 01-16-2005
Wilfried Wilfried is offline
Senior Member
Black Belt
 
Join Date: Nov 2004
Posts: 2,112
Hi,

I did a litte additional research and tought to put it here as it can benefit you and others.

First of all this dataset where pushpins are added has the name 'My Pushpins". I found this like this:

Code:
            MapPoint.DataSets ds = MP.ActiveMap.DataSets;
            foreach (MapPoint.DataSet d in ds)
                Console.WriteLine(d.Name);
This means that you can access the selected pushpins by dataset name. Maybee it is also safer ? Or is index 1 always the 'My Pushpins" dataset ? Should be nice if someone canclarify this. Anyway as this you access it by name:

Code:
            o = "My Pushpins";
            rs = MP.ActiveMap.DataSets.get_Item(ref o).QueryShape(s);
            rs.MoveFirst();
            while (!rs.EOF) {
                rs.MoveNext();
            }
You can also create a new dataset and move the selected pushpins in it, like this. Note that they are deleted form the old dataset.

Code:
            MapPoint.DataSet InCircle = MP.ActiveMap.DataSets.AddPushpinSet("In circle");
            rs.MoveFirst();
            while (!rs.EOF) {
                rs.Pushpin.MoveTo(InCircle);
                rs.MoveNext();
            }
            o = "In circle";
            rs = MP.ActiveMap.DataSets.get_Item(ref o).QueryShape(s);
            rs.MoveFirst();
            while (!rs.EOF) {
                rs.MoveNext();
            }
Reply With Quote