Hi Ian,
>I have a project that includes taking co-ordinates from an email message
>and creating points for these objects in MapInfo. The point creation
>process needs to happen outside of MapInfo, so when you open the map the
>latest points are already there.
As you say the points need to be there when the map is opened, so it isn't
specificaly necessary for the MAP/DAT files to be created outside of MI Pro.
I think it would be easier to have MI Pro simply create the points on
start-up.
If you can put the co-ordinates as a text file which will always have the
same structure, then you can write a workspace file which will behave as a
macro, and create points from this text file each time it is called.
Start with a blank MI Pro and open the MapBasic window, next open the text
file containing your co-ordinates. Then follow the normal procedure for
creating points. The MapBasic window should be filling with text.
Save the text to a new file, and then using a text editor, write a workspace
file from this text script.
You will need to add the MapBasic create point statements into the text file
and some lines to define it as a MI Pro workspace, then save it as a *.WOR
file and bingo, you have a macro which will execute everytime the workspace
file is opened. All you have to do is to ensure the text file containing the
co-ordinates is in the same place and has the same structure.
Here is an example of a text file:
---
"Descrip" "easting" "northing"
"pt1" 391577 224369
"pt2" 391577 223154
"pt3" 391462 222084
"pt4" 391491 220551
---
And here is the workspace macro:
---
!Workspace
!Version 600
!Charset WindowsLatin1
Register Table "delme.txt" TYPE ASCII Delimiter 9 Titles Charset
"WindowsLatin1" Into "delme.TAB"
Open Table "delme.TAB" as delme
Create Map For delme CoordSys Earth Projection 8, 79, "m", -2, 49,
0.9996012717, 400000, -100000 Bounds (-7845061.1011, -15524202.1641)
(8645061.1011, 4470074.53373)
Update delme set obj = createpoint(easting, northing)
Map From delme
Position (0.0520833,0.0520833) Units "in"
Width 4.125 Units "in" Height 2.21875 Units "in"
Set Window FrontWindow() ScrollBars Off Autoscroll On
Set Map
CoordSys Earth Projection 8, 79, "m", -2, 49, 0.9996012717, 400000,
-100000
Center (391519.5012,222460.0007)
Zoom 7.988728353 Units "km"
Preserve Zoom Display Zoom
Distance Units "km" Area Units "sq km" XY Units "m"
---
Hope this helps.
Blaine
_________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.
_______________________________________________________________________
List hosting provided by Directions Magazine | www.directionsmag.com |
To unsubscribe, send e-mail to [EMAIL PROTECTED] and
put "unsubscribe MapInfo-L" in the message body.