1

I am working with ArcObjects and ESRI for the first time, and I am trying to do what is probably a simple task.

I have a map control in VBA that is associated with a mxd.

I have a table with XY data, and XY data is non-spatial, but the XY is in the same coordinate system as the mxd.

I can get the XY data into a ITable, but I cannot seem to get the ISpatialReference from the map control.

I would like to create a symbolized layer from the non-spatial coordinates, and add it to the map control.

Any samples in VBA of how to do this would be very appreciated.

Thanks again for you time and patience.

asked Mar 4, 2011 at 22:58
1
  • Not being a programmer made this a esoteric task to me. I have now learned how to implement the multiple interfaces for the AOs, and this makes life easier ;) I can now do what I want with the control I think. At this point it probably would have been easier to have become a Comp Sci major instead of a Geo major. I am finding no one in my class of geographers really can describe how to program. Commented Mar 5, 2011 at 4:36

1 Answer 1

2

To get the spatial Reference form the map, you can use the following code:

dim pmXDoc as IMxDocument
set pmXDoc =ThisDocument
dim pMap as IMap
set pMap=pmXDoc.FocusMap
dim pSR as ISpatialReference
set pSR=pMap.SpatialReference

Here is a sample, which shows how you can make an XY event layer, once you have table in a ITable:

http://resources.esri.com/help/9.3/arcgisengine/ArcObjects/esriGeoDatabase/Create_XYEventSource.htm

answered Mar 5, 2011 at 6:45
1
  • If this answer has solved your query, I'll request you to mark it as the accepted answer. This will help others in the future, who stumble upon this question. Commented Mar 7, 2011 at 4:02

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.