Hi
How can I export selected feature in Layer to Shapefile in VB.NET
This is example how it can export in ArcGIS desktop
https://gis.stackexchange.com/questions/121057/arcmap-vb-net-export-map-to-shp-error
Hi,
You can do it using geoprocessing Feature Class To Shapefile tool.
Geoprocessing API reference is here
I found the solutionis there any expert who can helpneed to be able to apply a filter from Layer and determine the file name that will be savedand know when Geoprocessing has finished processing
This is sample from RawMcGee which I found in the discussion
protected async Task<string> ConvertShp(string layerpath, string outpath) { if (!System.IO.Directory.Exists(outpath)) System.IO.Directory.CreateDirectory(outpath); var valueArray = await QueuedTask.Run(() => { //input layers list should contain the path of each layer name, i.e. if the root node is "Mapping" and the layer name is "gs_points", path is "Mapping\\gs_points". List<string> inlayers = new List<string>(); inlayers.Add(layerpath); //outpath is just the folder to save the shapefiles in return Geoprocessing.MakeValueArray(inlayers, outpath); }); // to let the GP tool run asynchronously without blocking the main thread // use the GPThread option of GPExecuteToolFlasgs // GPExecuteToolFlags flags = GPExecuteToolFlags.GPThread; // instruct the tool run non-blocking GPThread IGPResult gpResult = await Geoprocessing.ExecuteToolAsync("FeatureClassToShapefile_conversion", valueArray, null, null, null, flags); return string.IsNullOrEmpty(gpResult.ReturnValue) ? $@"Error in gp tool: {gpResult.ErrorMessages}" : $@"Ok: {gpResult.ReturnValue}"; }
Thanks
Angemeldete Mitglieder können Beiträge verfassen, Updates folgen und mehr. Neu hier? Registriere ein kostenloses Konto.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.