| | |
| | | RemoveElements(removeIds);
|
| | | ModifyElements(modifiedIds);
|
| | |
|
| | | UpdateLinkerInfo(doc);
|
| | | AddUnhandledElements();
|
| | | GlobalResource.InstancePanel.UpdateForm();
|
| | | }
|
| | | catch (Exception ex)
|
| | |
| | | {
|
| | | return new List<Element>();
|
| | | }
|
| | | //FilteredElementCollector collector = null;
|
| | | //foreach (Category cate in doc.Settings.Categories)
|
| | | //{
|
| | | // if (cate.CategoryType != CategoryType.Model)
|
| | | // {
|
| | | // continue;
|
| | | // }
|
| | | // var subCollector = new FilteredElementCollector(doc);
|
| | | // subCollector.OfCategory((BuiltInCategory)(cate.Id.IntegerValue));
|
| | | // subCollector.WhereElementIsNotElementType();
|
| | | // if (collector == null)
|
| | | // {
|
| | | // collector = subCollector;
|
| | | // }
|
| | | // else
|
| | | // {
|
| | | // collector.UnionWith(subCollector);
|
| | | // }
|
| | | //}
|
| | | //
|
| | | |
| | | var collector1 = new FilteredElementCollector(doc).
|
| | | OfCategory(BuiltInCategory.OST_PipeCurves).
|
| | | WhereElementIsNotElementType();
|
| | |
| | | return elements1;
|
| | | }
|
| | |
|
| | | public static void AddUnhandledElementsToCache()
|
| | | public static void AddUnhandledElements()
|
| | | {
|
| | | var elements = GlobalResource.CurrentDocument.GetModelElements();
|
| | | foreach (var element in elements)
|
| | |
| | | {
|
| | | continue;
|
| | | }
|
| | | RevitMepCategoryService.MatchElement(element);
|
| | | RevitMepCategoryService.AddToCache(element);
|
| | | }
|
| | | UpdateLinkerInfo(GlobalResource.CurrentDocument);
|
| | | }
|
| | |
|
| | | public static void UpdataDocumentCache(this Document doc)
|
| | | {
|
| | | if (doc.GetHashCode() != GlobalResource.CurrentDocument.GetHashCode())
|
| | | {
|
| | | GlobalResource.CurrentDocument = doc;
|
| | | GlobalResource.RevitModels = new Dictionary<RevitType, ObservableCollection<ElementModel>>();
|
| | | }
|
| | | AddUnhandledElements();
|
| | | }
|
| | | }
|
| | | }
|