Kelly asked “Is it possible to delete points within a range of elevation values?”
Yes!
public void deleteTopoPointsByElevation()
{
Document doc = this.ActiveUIDocument.Document;
UIDocument uidoc = new UIDocument(doc);
double min = 20;
double max = 30;
TopographySurface topo = doc.GetElement(uidoc.Selection.PickObject(ObjectType.Element)) as TopographySurface;
IList<XYZ> pointsToDelete = new List<XYZ>();
foreach (XYZ pt in topo.GetPoints())
{
if (pt.Z > min && pt.Z < max)
pointsToDelete.Add(pt);
}
using (TopographyEditScope tes = new TopographyEditScope(doc, "Topo Edit Scope"))
{
tes.Start(topo.Id);
using (Transaction t = new Transaction(doc, "Update Topo"))
{
t.Start();
topo.DeletePoints(pointsToDelete);
t.Commit();
}
tes.Commit(new myFailuresPreprocessor());
}
}
public class myFailuresPreprocessor : IFailuresPreprocessor
{
public FailureProcessingResult PreprocessFailures(FailuresAccessor failuresAccessor)
{
return FailureProcessingResult.Continue;
}
}