MapPoint Forums

MapForums

Community of VE/MapPoint Users and Developers




find records inside existing shape with VBA

This is a discussion on find records inside existing shape with VBA within the MapPoint 2006/2009 Discussion forums, part of the Map Forums category; I want to use the queryshape function on an existing shape of the map. The map will have several shapes ...


Go Back   MapPoint Forums > Map Forums > MapPoint 2006/2009 Discussion

Register Blogs FAQ Members List Calendar Search Today's Posts Mark Forums Read



Click here to register

Reply

 

LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 08-25-2006
Junior Member
White Belt
 
Join Date: Aug 2006
Posts: 8
find records inside existing shape with VBA

I want to use the queryshape function on an existing shape of the map. The map will have several shapes and a dataset and plotted waypoints. I can find the waypoints, dataset, return records etc. But how do I go about finding the shape that the waypoint/records are located in. I have tried all kinds of stuff with no luck! Queryshape is based on locations so . . . can you return the shape that a given location ie x,y or long/lat resides in so as to use queryshape to return records in the next step or just how can it be done. ANYONE ? ? ?

Last edited by chas; 08-25-2006 at 02:51 PM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #2 (permalink)  
Old 08-25-2006
Senior Member
Black Belt
 
Join Date: Nov 2004
Posts: 2,105
Hi,

I'm not sure I understeand your question. QueryShape returns records that are _in_ the shape. Is that what you want ? If not, can you repeat your question in simple English? (I'm not English spoken) because now your question it is a little confusing..

Last edited by Wilfried; 08-25-2006 at 03:56 PM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #3 (permalink)  
Old 08-28-2006
Junior Member
White Belt
 
Join Date: Aug 2006
Posts: 8
Ok I'll try again

I have an exisiting map with several ploygons around several dataset records in each ploygon. How can I access each ploygon(shape) and return the records that are in it.

The queryshape function will do it but it requires locations of shape edges/vertices? i think. I have tried programicly naming the shapes . . no luck. and several other things.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #4 (permalink)  
Old 08-28-2006
Senior Member
Black Belt
 
Join Date: Nov 2004
Posts: 2,105
Hi,

This shows the pushpins in a shape:

Code:
    Loc = MP.ActiveMap.GetLocation(Lat, Lon, Alt);
    Shape s = MP.ActiveMap.Shapes.AddShape(GeoAutoShapeType.geoShapeRadius, Loc, 100, 100);
    s.Line.Weight = 0;
    s.Select();
    object o = 1;
    Recordset rs = MP.ActiveMap.DataSets.get_Item(ref o).QueryShape(s);
    rs.MoveFirst();
    while (!rs.EOF) {
        // here we have all pushpins
        rs.MoveNext();
    }
This move pushpins in a shape to a new 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) {
        // here we have all pushpins
        rs.MoveNext();
    }
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #5 (permalink)  
Old 08-28-2006
Junior Member
White Belt
 
Join Date: Aug 2006
Posts: 8
more more

But the shapes are existing. I don't want to add shapes just return the existing shapes. Shapes will be created by user before accessing the map.

Last edited by chas; 08-28-2006 at 01:08 PM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #6 (permalink)  
Old 08-28-2006
Winwaed's Avatar
Mapping-Tools.com
Red Belt
 
Join Date: Feb 2004
Posts: 848
Blog Entries: 7
You should be able to iterate through the Shapes collection?
Wilfried adds a new shape to this collection so he knows which one he is working with.

Iterate through the shapes, testing each against the pin(s).


Richard
__________________
Winwaed Software Technology LLC
http://www.winwaed.com
See http://www.mapping-tools.com for MapPoint Tools
Pre-Order MapPoint 2009 today: http://www.mapping-tools.com/mappoint2009
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Reply

Tags
existing, find, inside, records, shape, vba


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads

Thread Thread Starter Forum Replies Last Post
Is a location inside a Route? giaarcix MapPoint 2006/2009 Discussion 2 08-01-2006 01:36 PM
Does an object reside in my Shape or Shape boundaries? hotrdd MapPoint 2006/2009 Discussion 1 08-04-2005 09:51 PM
How do you add records to an existing dataset? stephenmillington MapPoint 2006/2009 Discussion 0 09-07-2004 04:24 AM
Display Records that Mappoint Can't find Anonymous MapPoint 2006/2009 Discussion 2 01-05-2004 10:20 AM
Exporting places inside a selection to Excel Pat Lee MapPoint 2006/2009 Discussion 2 06-09-2003 09:10 AM


All times are GMT -5. The time now is 04:29 AM.


Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0
MP2K Magazine
Visitor Map

Val d'Isere
For a ski holiday destination renowned for combining great skiing with a vibrant nightlife, book a holiday to Val d'Isere. Holiday Hypermarket brings you the latest great deals.

City Breaks
Book a city break with Travel Counsellors. A personal travel advisor will help you make the most of your city break.

Holidays Thailand
Holidays in Thailand are hugely diverse with wonderful luxury resorts and beaches but also some lovely forested mountains with interesting hill tribes. See dealchecker.co.uk.

Holidays in Egypt
A holiday in Egypt will stimulate your mind, captivate your heart and spark your senses. Visit this exceptional country, book today!

Portugal
As well as providing some great weather Portugal has much to offer culturally. There are numerous museums, monuments and places of historical interest to explore. Despite the rich history there is a buzzing nightlife and great shopping too.

Family activity holidays
Family holidays can be full of fun activity. Check out your options at Travel.co.uk

Holidays in Goa
Want to know more about Indian culture? Visit On The Beach for information on holidays in Goa.


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 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52