Andreas Sch�lzel wrote:
> I'm reading coordinates from a textfile into a Visual Basic application
> from which I run an instance of MapInfo through automation:
>
> I set the projection as follows:
> 1.
> msg = "Create Map For " & MapNameArray(MyType, 2, BrowserNo) & " CoordSys
> Earth Projection 8, 104, "
> msg = msg & Chr(34) & "m" & Chr(34) & ", -177, 0, 0.9996, 500000, 0 Bounds
> (-7745844.29597, -9997964.94324) (8745844.29597, 9997964.94324)"
> MIDetail(BrowserNo).Do msg 'That command maps the tables
>
> 2. I create an index on the fields
>
> msg = "Create Index On "
> msg = msg & MapNameArray(TableType, 2, BrowserNo) & " (" & "X_m" & ")"
> MIDetail(BrowserNo).Do msg
> msg = "Create Index On "
> msg = msg & MapNameArray(TableType, 2, BrowserNo) & " (" & "Y_m" & ")"
> MIDetail(BrowserNo).Do msg
>
Here's where you missed a step:
msg = "Set CoordSys Table " & MapNameArray(MyType, 2, BrowserNo)
MIDetail(BrowserNo).Do msg
>
> 3. And read the coordinates into the fileds and ceate the points
>
> xcoord = InfoJunc(i).JuncX
> ycoord = InfoJunc(i).JuncY
>
> 'That's supposed to create a point
> msg = "Insert Into "
> msg = msg & MapNameArray(TableType, 2, BrowserNo) & " (" & "obj" &
> ") "
> msg = msg & "Values (CreatePoint("
> msg = msg & xcoord & "," & ycoord & "))"
> MIDetail(BrowserNo).Do msg
Routines that take or return specific coordinate values don't use the
projection
of any table or window, they use something the "current coordinate system".
Before you can create objects using specific coordinate values, you must set
the current coordinate system with a "set Coordsys" statement.
HTH
Spencer
----------------------------------------------------------------------
To unsubscribe from this list, send e-mail to [EMAIL PROTECTED] and put
"unsubscribe MAPINFO-L" in the message body, or contact [EMAIL PROTECTED]