diff --git a/Helper/HelperGdb.cs b/Helper/HelperGdb.cs index 85d35ca..b681650 100644 --- a/Helper/HelperGdb.cs +++ b/Helper/HelperGdb.cs @@ -1325,10 +1325,19 @@ namespace OliviaAddInPro.Helper return false; } List ids = new List(); - + ///////////////////////////////////////////////////////// //Añade a la lista los ids que cumplen el filtro espacial - using (RowCursor cursor = fc.Search(filter)) + try + { + ids = fc.Select(filter, SelectionType.ObjectID, SelectionOption.Normal).GetObjectIDs().ToList(); + } + catch + { + ids = new List(); + } + + /*using (RowCursor cursor = fc.Search(filter)) { while (cursor.MoveNext() && !cps.Getcancelled()) { @@ -1337,7 +1346,7 @@ namespace OliviaAddInPro.Helper ids.Add(feature.GetObjectID()); } } - } + }*/ if (ids.Count <= 0) { OutStr = "Error al aplicar filtro espacial en exportación"; @@ -1675,7 +1684,9 @@ namespace OliviaAddInPro.Helper if (ids.Count <= 0) return string.Empty; - string ids_str = "("; + //string ids_str = "("+; + return ObjectId+" IN (" + String.Join(",", ids) + ")"; + /* bool first = true; foreach (long i in ids) { @@ -1688,9 +1699,9 @@ namespace OliviaAddInPro.Helper ids_str += "," + i.ToString(); } //el último - ids_str += ")"; - string whereClause = ObjectId + " IN " + ids_str; //Cambiar id a otro sitio - return whereClause; + ids_str += ")";*/ + //string whereClause = ObjectId + " IN " + ids_str; //Cambiar id a otro sitio + //return whereClause; /*string consulta, orstr; consulta = string.Empty;