you can find the sketchlines with the TTT (temporary transaction trick)
StringBuilder sb = new StringBuilder();
Dictionary<Floor, List<ModelCurve>> dict_SketchLines = new Dictionary<Floor, List<ModelCurve>>();
Document doc = revit.Application.ActiveUIDocument.Document;
List<Element> _floors = new FilteredElementCollector(doc)
.OfClass(typeof(Floor))
.ToList();
foreach (Element e in _floors)
{
Floor f = e as Floor;
List<ElementId> _deleted = null;
using (Transaction t = new Transaction(doc, "temp"))
{
t.Start();
_deleted = doc.Delete(e.Id).ToList();
t.RollBack();
}
bool SketchLinesFound = false;
List<ModelCurve> _sketchCurves = new List<ModelCurve>();
foreach (var id in _deleted)
{
// find modelcurves. these are the lines in the bounderysketch
ModelCurve mc = doc.GetElement(id) as ModelCurve;
if (mc != null)
{
_sketchCurves.Add(mc);
SketchLinesFound = true;
}
else
{
if (SketchLinesFound) break;
}
}
dict_SketchLines.Add(f, _sketchCurves);
}
foreach (Floor key in dict_SketchLines.Keys)
{
List<ModelCurve> _curves = dict_SketchLines[key];
sb.AppendLine(string.Format("floor {0} has sketchlines:", key.Id));
foreach (ModelCurve mc in _curves)
{
sb.AppendLine(string.Format(" {0} <{1}>", mc.GetType(), mc.Id));
sb.AppendLine(string.Format(" <{0} -- {1}>", mc.GeometryCurve.GetEndPoint(0), mc.GeometryCurve.GetEndPoint(1)));
}
sb.AppendLine();
}
TaskDialog.Show("debug", sb.ToString());