Select to view content in your preferred language

Save layer file of previous version

3620
1
Jump to solution
07-16-2014 01:14 AM
Ranga_Tolapi
Frequent Contributor

How to save layer file of previous version using ArcObjects Java API from ArcGIS 10.2? I was using the below code, but no option available to specify the layer file version.

ILayerFile layerFile = new LayerFile();

layerFile.esri_new(fileName);

layerFile.replaceContents(layer);

layerFile.save();

0 Kudos
1 Solution

Accepted Solutions
Ranga_Tolapi
Frequent Contributor

Here we go...

LayerFile layerFile = new LayerFile();

layerFile.esri_new(fileName);

layerFile.replaceContents(layer);

layerFile.setDocumentVersion(esriArcGISVersion.esriArcGISVersion93)

layerFile.save();

When saving a layer to a previous version, keep in mind that older versions of ArcGIS may be unable to access newer data sources in the current release. For example, a layer that points to an ArcGIS 10.2.2 geodatabase will not work in earlier versions of ArcGIS.

Source: ArcGIS Help (10.2, 10.2.1, and 10.2.2)

View solution in original post

0 Kudos
1 Reply
Ranga_Tolapi
Frequent Contributor

Here we go...

LayerFile layerFile = new LayerFile();

layerFile.esri_new(fileName);

layerFile.replaceContents(layer);

layerFile.setDocumentVersion(esriArcGISVersion.esriArcGISVersion93)

layerFile.save();

When saving a layer to a previous version, keep in mind that older versions of ArcGIS may be unable to access newer data sources in the current release. For example, a layer that points to an ArcGIS 10.2.2 geodatabase will not work in earlier versions of ArcGIS.

Source: ArcGIS Help (10.2, 10.2.1, and 10.2.2)

0 Kudos