Quantcast
Channel: Forums - ArcObjects SDKs
Viewing all articles
Browse latest Browse all 1374

Set Spatial Reference for a a XY event source layer

$
0
0
I have an XY event source layer, added to ArcMap with the option File > Add Data > Add XY Data, but when trying to change the spatial reference of this layer with ArcObjects I get a E_NOINTERFACE error.

The code snippet that manages the change of the spatial reference is like:

Code:

Dim spatialRef As ISpatialReference = ...
Dim geoDataset As IGeoDataset = fl.FeatureClass

Dim geoDatasetSchemaEdit As IGeoDatasetSchemaEdit = geoDataset
If (geoDatasetSchemaEdit.CanAlterSpatialReference) Then
        geoDatasetSchemaEdit.AlterSpatialReference(spatialRef)
End If

Previous code works fine for other type of layers. Also from the ArcMap UI is possible to change the spatial reference of an XY event source layer, so I guess should be possible with ArcObjects.

I found these related posts: http://forums.arcgis.com/threads/746...nterface-error and http://forums.arcgis.com/threads/760...tial+reference, but didn't succeed.

Any idea how can be change the spatial reference of XY event source layers with ArcObjects?

Thanks in advance.

Viewing all articles
Browse latest Browse all 1374

Trending Articles