Message 1 of 5
Purge Line Patterns
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I can return all Line Patterns and IDs with:
FilteredElementCollector collector = newFilteredElementCollector(doc);
IList<Element> elems = collector.OfClass(typeof(LinePatternElement)).ToElements();
then process elems to select ones to purge, and add to:
IList <ElementId> idsToDelete = newList<ElementId>();
then delete by element iD:
tr.Start();
// all at once
// doc.Delete(idsToDelete);
// or
foreach (ElementId eid in idsToDelete)
{
doc.Delete(eid);
}
tr.Commit();
However the elements (Line Patterns) are not being deleted from the document. Any thoughts? Thanks, Dale
______________
Yes, I'm Satoshi.