Message 1 of 4
AppearanceAssetElements can' be Delete
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I am trying to create a simple utility to clean up Families. Things like deleting all materials and Fill patterns. These work as expected, but for some reason, even after deleting the materials, the AppearanceAssetElement's are not allowed to be deleted.
I have validated that I am getting the assets, and they should not be linked to anything else, and they have no dependent elements either. Is there something I am missing as to why these can't be deleted, but can be "purged" from the model?
using(FilteredElementCollector collector = new FilteredElementCollector(doc).OfClass(typeof(AppearanceAssetElement)))
{
foreach(AppearanceAssetElement asset in collector.ToElements())
{
try
{
doc.Delete(asset.Id);
}
catch(Exception ex)
{
continue;
}
}
}
I eleven attempted to use the GetSubelements() and DeleteSubelements() methods on the Asset class, but those did not return any elements either.
My quick test and results in Dynamo for show: