Community of VE/MapPoint Users and Developers
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 ...
| |||||||
| Register | Blogs | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| |||
| Copying multiple shapes 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! |
| ||||
|
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
__________________ |
| |||
|
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 |
| |||
|
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 |
![]() |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
| |
| ||||
| 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 |
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.