优化更新
This commit is contained in:
@@ -138,6 +138,10 @@ public static class CollectorAssist
|
||||
&& e is not Panel
|
||||
&& e is not Mullion
|
||||
&& e is not RevitLinkInstance)).Select(e => e.Id).ToList();
|
||||
if (li.Count == 0)
|
||||
{
|
||||
return new FilteredElementCollector(doc);
|
||||
}
|
||||
return new FilteredElementCollector(doc, li);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,9 +1,7 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.Diagnostics;
|
||||
using System.Reflection;
|
||||
|
||||
using Autodesk.Revit.DB;
|
||||
using Autodesk.Revit.UI;
|
||||
|
||||
namespace Sai.Toolkit.Revit.Assist;
|
||||
|
||||
@@ -29,7 +27,7 @@ public static class DebugAssist
|
||||
/// <param name="doc"></param>
|
||||
/// <param name="geoms"></param>
|
||||
/// <returns></returns>
|
||||
public static ElementId CreateTransientGeometries(this Document doc, params GeometryObject[] geoms)
|
||||
public static ElementId CreateTransientElements(this Document doc, params GeometryObject[] geoms)
|
||||
{
|
||||
var list = new List<GeometryObject>(geoms);
|
||||
var method = GenerateTransientDisplayMethod();
|
||||
|
||||
@@ -65,9 +65,9 @@ public static class ElementAssist
|
||||
/// <summary>
|
||||
/// 获取标高
|
||||
/// </summary>
|
||||
/// <param name="model"></param>
|
||||
/// <param name="element"></param>
|
||||
/// <returns></returns>
|
||||
public static ElementId GetLevelId(this Element model)
|
||||
public static ElementId GetLevelId(this Element element)
|
||||
{
|
||||
// 定义需要检查的参数列表
|
||||
var parametersToCheck = new BuiltInParameter[]
|
||||
@@ -84,7 +84,7 @@ public static class ElementAssist
|
||||
// 依次检查每个参数
|
||||
foreach (var param in parametersToCheck)
|
||||
{
|
||||
var baseLevelId = model.get_Parameter(param)?.AsElementId();
|
||||
var baseLevelId = element.get_Parameter(param)?.AsElementId();
|
||||
if (baseLevelId != ElementId.InvalidElementId && baseLevelId != null)
|
||||
{
|
||||
return baseLevelId;
|
||||
@@ -92,7 +92,7 @@ public static class ElementAssist
|
||||
}
|
||||
|
||||
//最后检查楼板或族基准标高
|
||||
return model.LevelId;
|
||||
return element.LevelId;
|
||||
}
|
||||
/// <summary>
|
||||
/// 转换类型
|
||||
|
||||
@@ -82,7 +82,9 @@ public class ElementInLinkOrCurrentDocument : ISelectionFilter
|
||||
&& e is not Panel;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// dwg块选择过滤
|
||||
/// </summary>
|
||||
public class DwgBlockSelection : ISelectionFilter
|
||||
{
|
||||
private Element e;
|
||||
|
||||
@@ -1,7 +1,4 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using System.Reflection;
|
||||
|
||||
using Autodesk.Revit.UI;
|
||||
|
||||
@@ -37,8 +34,26 @@ namespace Sai.Toolkit.Revit.Helpers
|
||||
}
|
||||
dictionary.Add(id, shortcutItem);
|
||||
List<UIFrameworkServices.ShortcutItem> list = dictionary.Select((KeyValuePair<string, UIFrameworkServices.ShortcutItem> e) => e.Value).ToList<UIFrameworkServices.ShortcutItem>();
|
||||
this.SaveShortcuts(list);
|
||||
this.ArmCommands();
|
||||
|
||||
/* 项目“Sai.RvKits (net481)”的未合并的更改
|
||||
在此之前:
|
||||
this.SaveShortcuts(list);
|
||||
this.ArmCommands();
|
||||
在此之后:
|
||||
SaveShortcuts(list);
|
||||
this.ArmCommands();
|
||||
*/
|
||||
KeyboardShortcutService.SaveShortcuts(list);
|
||||
|
||||
/* 项目“Sai.RvKits (net481)”的未合并的更改
|
||||
在此之前:
|
||||
this.ArmCommands();
|
||||
return true;
|
||||
在此之后:
|
||||
ArmCommands();
|
||||
return true;
|
||||
*/
|
||||
KeyboardShortcutService.ArmCommands();
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
@@ -71,8 +86,26 @@ namespace Sai.Toolkit.Revit.Helpers
|
||||
}
|
||||
dictionary.Add(item.Key, shortcutItem);
|
||||
List<UIFrameworkServices.ShortcutItem> list = dictionary.Select((KeyValuePair<string, UIFrameworkServices.ShortcutItem> e) => e.Value).ToList<UIFrameworkServices.ShortcutItem>();
|
||||
this.SaveShortcuts(list);
|
||||
this.ArmCommands();
|
||||
|
||||
/* 项目“Sai.RvKits (net481)”的未合并的更改
|
||||
在此之前:
|
||||
this.SaveShortcuts(list);
|
||||
this.ArmCommands();
|
||||
在此之后:
|
||||
SaveShortcuts(list);
|
||||
this.ArmCommands();
|
||||
*/
|
||||
KeyboardShortcutService.SaveShortcuts(list);
|
||||
|
||||
/* 项目“Sai.RvKits (net481)”的未合并的更改
|
||||
在此之前:
|
||||
this.ArmCommands();
|
||||
return true;
|
||||
在此之后:
|
||||
ArmCommands();
|
||||
return true;
|
||||
*/
|
||||
KeyboardShortcutService.ArmCommands();
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -155,8 +188,26 @@ namespace Sai.Toolkit.Revit.Helpers
|
||||
{
|
||||
dictionary.Remove(id);
|
||||
List<UIFrameworkServices.ShortcutItem> list = dictionary.Select((KeyValuePair<string, UIFrameworkServices.ShortcutItem> e) => e.Value).ToList<UIFrameworkServices.ShortcutItem>();
|
||||
this.SaveShortcuts(list);
|
||||
this.ArmCommands();
|
||||
|
||||
/* 项目“Sai.RvKits (net481)”的未合并的更改
|
||||
在此之前:
|
||||
this.SaveShortcuts(list);
|
||||
this.ArmCommands();
|
||||
在此之后:
|
||||
SaveShortcuts(list);
|
||||
this.ArmCommands();
|
||||
*/
|
||||
KeyboardShortcutService.SaveShortcuts(list);
|
||||
|
||||
/* 项目“Sai.RvKits (net481)”的未合并的更改
|
||||
在此之前:
|
||||
this.ArmCommands();
|
||||
return true;
|
||||
在此之后:
|
||||
ArmCommands();
|
||||
return true;
|
||||
*/
|
||||
KeyboardShortcutService.ArmCommands();
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
@@ -214,7 +265,7 @@ namespace Sai.Toolkit.Revit.Helpers
|
||||
/// <summary>
|
||||
/// 加载命令
|
||||
/// </summary>
|
||||
public void LoadCommands()
|
||||
public static void LoadCommands()
|
||||
{
|
||||
ShortcutsHelper.LoadCommands();
|
||||
}
|
||||
@@ -228,7 +279,7 @@ namespace Sai.Toolkit.Revit.Helpers
|
||||
/// <summary>
|
||||
/// 应用更改
|
||||
/// </summary>
|
||||
private void ArmCommands()
|
||||
private static void ArmCommands()
|
||||
{
|
||||
ShortcutsHelper.ArmCommands();
|
||||
}
|
||||
@@ -244,7 +295,7 @@ namespace Sai.Toolkit.Revit.Helpers
|
||||
/// 保存ShortcutItems
|
||||
/// </summary>
|
||||
/// <param name="shortcutList"></param>
|
||||
private void SaveShortcuts(ICollection<UIFrameworkServices.ShortcutItem> shortcutList)
|
||||
private static void SaveShortcuts(ICollection<UIFrameworkServices.ShortcutItem> shortcutList)
|
||||
{
|
||||
ShortcutsHelper.SaveShortcuts(shortcutList);
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user