public void ApplySetting(EarthworkBlocking blocking, List <ElementId> elementIds) { if (elementIds == null || elementIds.Count == 0) { return; } using (var transaction = new Transaction(blocking.Doc, "EarthworkBlocking." + nameof(ApplySetting))) { OverrideGraphicSettings setting = GetOverrideGraphicSettings(blocking.Doc); transaction.Start(); //元素可见性 if (IsVisible) { blocking.View3D.UnhideElements(elementIds); } else { blocking.View3D.HideElements(elementIds); } //元素表面填充物配置 foreach (var elementId in elementIds) { ApplySetting(blocking.View3D, elementId, setting); } transaction.Commit(); } }
/// <summary> /// 解除对元素增加的节点的配置 /// </summary> /// <param name="element"></param> public void DeapplySetting(EarthworkBlocking blocking, List <ElementId> elementIds) { using (var transaction = new Transaction(blocking.Doc, "EarthworkBlocking." + nameof(DeapplySetting))) { OverrideGraphicSettings setting = GetOverrideGraphicSettings(blocking.Doc); transaction.Start(); //元素可见性 blocking.View3D.UnhideElements(elementIds); //元素表面填充物配置 foreach (var elementId in elementIds) { DeapplySetting(blocking.View3D, elementId); } transaction.Commit(); } }