MapPoint Forums

MapForums

Community of VE/MapPoint Users and Developers




Copying multiple shapes

This is a discussion on Copying multiple shapes within the MapPoint 2006/2009 Discussion forums, part of the Map Forums category; We have 3 seperate maps that each contain a set of pushpins and around each pushpin is drawn a shape ...


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

Register Blogs FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 04-21-2004
Senior Member
Green Belt
 
Join Date: Sep 2003
Posts: 103
Copying multiple shapes

We have 3 seperate maps that each contain a set of pushpins and around each pushpin is drawn a shape (catchment area).
I am trying to merge these 3 maps into 1 and I can import all of the ushpins from each map ok.
Where i'm having trouble is copying the shapes into the single map, I can copy them one at a time but this isn't really practical as there are over 10,000 of these. Is it possible to copy multiple shapes from one map to another, if not through mappoint then programaticaly through vb.

I really could do with some help on this, going through 10,000 of them one at a time is going to be a nightmare!
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 04-21-2004
Eric Frost's Avatar
Senior Member
Black Belt
 
Join Date: Jul 1992
Posts: 2,304
Blog Entries: 1
Dazzer,

There's a mif/mid exporter, it's not perfect but it would allow you to get the shapes out programmatically, manipulate them as text or with a GIS program, and re-import them.

Walt Cygan wrote the mif/mid exporter, it is here:
http://www.mp2kmag.com/importersub01.asp
There's also a compiled version in one of the old newsletters, look for "three new utilities".

You may encounter some errors, but it should give you a good starting point.

Eric
__________________
~ Now taking orders for MapPoint 2009 ~
~
~ Upgrade to MapForums Plus membership ~
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 04-21-2004
Senior Member
Black Belt
 
Join Date: Jul 2002
Posts: 5,138
Excellent, thanks for your help

I'll have a look at this and see what I can do with it.

Thanks again for your help
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 04-21-2004
Junior Member
Yellow Belt
 
Join Date: Feb 2003
Posts: 28
I had to copy a bunch of shapes (freeform lines) that had been hand-drawn to represent areas on the map. You should be able to adapt this to your needs or use it as a start. MapPoint is nice in that the shapes paste to the same location from which they were copied.

'** g_App is a reference to the current application **
Private Sub btnCopyAllShapes_Click()
Dim oSrcApp As mappoint.Application
Dim oSrcMap As mappoint.Map
Dim oTargMap As mappoint.Map
Dim oShape As mappoint.Shape
Dim sFiles() As String
Dim i As Integer

'set current map as target
Set oTargMap = g_App.ActiveMap

On Error GoTo ErrorHandler
'get source map
With CmnDlg
.Flags = cdlOFNLongNames Or cdlOFNExplorer
.DialogTitle = "Select Target Map:"
.CancelError = True
.Filter = "MapPoint Files (*.ptm)|*.ptm"
.ShowOpen
End With
If Len(CmnDlg.FileName) > 0 Or Not IsNull(CmnDlg.FileName) Then
'set up target files
Set oSrcApp = CreateObject("MapPoint.Application")
Set oSrcMap = oTargApp.OpenMap(CmnDlg.FileName)
'make the application visible so the user can compare shapes and locations
oSrcApp.UserControl = True
oSrcApp.Visible = True

'copy shapes to target files
For Each oShape In oSrcMap.Shapes
'either add the type of shape to copy or remove completely to get all shapes
'I was only looking for particular shapes
If oShape.Type = geoAutoShape Or geoFreeform Then
'copy from source
oShape.Copy
'paste to target
oTargMap.Paste
End If
Next
End If


Exit_:
'set focus back to target app
If IsObject(oTargApp) Then
oTargApp.Activate
End If
'dereference everything
Set oTargApp = Nothing
Set oTargMap = Nothing
Set oSrcMap = Nothing
Set oShape = Nothing

'close form
Unload Me
Exit Sub

ErrorHandler:
If Err.Number <> CancelErr Then
MsgBox Err.Number & " " & Err.Description & vbCrLf _
& "Sub: btnCopy"
Err.Clear
End If
GoTo Exit_
End Sub
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 04-22-2004
Senior Member
Green Belt
 
Join Date: Sep 2003
Posts: 103
I think this solution is what I had in mind, it just depends how long it takes with 10,000+ shapes but I shouldn't think it would take that long.

The mif/mid exporter is interesting I'll have a look at this as well, could be useful for something else.

Thanks both for your help
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


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
Copying from MP2002 to Word 2002 Anonymous MapPoint 2006/2009 Discussion 2 01-27-2005 03:35 PM
problems copying map legends jjn27 MapPoint 2006/2009 Discussion 1 01-02-2005 11:02 PM
Copying the legend to paint or MS PowerPoint jdfreese MapPoint 2006/2009 Discussion 1 10-20-2004 04:39 PM
Copying Worksheet with Combo Box Anonymous MapPoint 2006/2009 Discussion 0 07-20-2004 04:13 PM
Copying location from one map to another in code. Anonymous MapPoint 2006/2009 Discussion 1 03-09-2004 09:05 AM


All times are GMT -5. The time now is 01:49 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

Manchester Airport Flights
Looking for information about Manchester Airport flights? At Holiday Hypermarket we can show you where to look and how to book.

Travel Agent
Travel Counsellors was voted UK's Best Travel Agent at the Guardian Unlimited travel awards.

Holiday Jamaica
What springs to mind when you hear the word Jamaica? Bob Marley and Rum? Think again. Book a low cost holiday in Jamaica to explore this island for yourself.

Dubai Holidays
Dubai holidays provide you with exotic sights, desert safaris and superb cuisine. There is an extensive range of things to do and see!

Turkey
Before booking a holiday to Turkey check out the ULookUBook travel guide. Find out about the rich culture in Turkey before you go there to help you to make the most of your holiday.

Inclusive Holidays
At Travel.co.uk travel comparison will help you plan the perfect inclusive holidays.

Cheap Holidays to Florida
Cash strapped? Get info on cheap holidays to Florida at On The Beach.


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