命名空间调整

This commit is contained in:
GG Z
2025-09-04 22:39:00 +08:00
parent 85435fb676
commit 36234cb529
58 changed files with 933 additions and 2241 deletions

View File

@@ -1,71 +0,0 @@
using Autodesk.Revit.DB;
namespace ShrlAlgoToolkit.Revit.Assists
{
public static class BuiltEnumDictionary
{
#if REVIT2025
public static string ToLabel(this ForgeTypeId source)
{
if (ParameterUtils.IsBuiltInParameter(source)) return LabelUtils.GetLabelForBuiltInParameter(source);
if (ParameterUtils.IsBuiltInGroup(source)) return LabelUtils.GetLabelForGroup(source);
if (UnitUtils.IsUnit(source)) return LabelUtils.GetLabelForUnit(source);
if (UnitUtils.IsSymbol(source)) return LabelUtils.GetLabelForSymbol(source);
if (SpecUtils.IsSpec(source)) return LabelUtils.GetLabelForSpec(source);
return LabelUtils.GetLabelForDiscipline(source);
}
#endif
public static Dictionary<T, string> GetBuiltInDictionary<T>()
where T : Enum
{
var dict = new Dictionary<T, string>();
foreach (object enumItem in Enum.GetValues(typeof(T)))
{
string name = string.Empty;
switch (enumItem)
{
#if REVIT2020
case BuiltInCategory category:
name = LabelUtils.GetLabelFor(category);
break;
#endif
case BuiltInParameter param:
name = LabelUtils.GetLabelFor(param);
break;
#if REVIT2018 || REVIT2020
case ParameterType type:
name = LabelUtils.GetLabelFor(type);
break;
case BuiltInParameterGroup group:
name = LabelUtils.GetLabelFor(group);
break;
case UnitType unitType:
name = LabelUtils.GetLabelFor(unitType);
break;
case DisplayUnitType displayUnitType:
name = LabelUtils.GetLabelFor(displayUnitType);
break;
case UnitSymbolType symbolType:
name = LabelUtils.GetLabelFor(symbolType);
break;
#endif
case ElementType elementType:
name = elementType.Name;
break;
case Element element:
name = element.Name;
break;
}
#if REVIT2025
if (enumItem is ForgeTypeId forgeTypeId)
{
var label = LabelUtils.GetLabelForBuiltInParameter(forgeTypeId);
}
#endif
dict.Add((T)enumItem, name);
}
return dict;
}
}
}

View File

@@ -1,40 +0,0 @@
using Autodesk.Revit.DB;
namespace ShrlAlgoToolkit.Revit.Assists
{
/// <summary>
/// 动态模型更新
/// </summary>
/// <typeparam name="T"></typeparam>
public static class DMUAssist
{
public static void AddTrigger(this IUpdater updater, Document document, ElementFilter filter, ChangeType change)
{
UpdaterRegistry.AddTrigger(updater.GetUpdaterId(), document, filter, change);
}
}
//internal class test
//{
// private readonly ChangeType change = null;
// private readonly ICollection<ElementId> elements = null;
// private readonly uiApplication uiApplication = null;
// private Guid guid = new();
// public void MyMethod()
// {
// var guid = new Guid();
// Updater updater = new Updater
// {
// addinID = null,
// Guid = guid
// };
// DMUAssist<Updater> dynamicModel =
// new DMUAssist<Updater>(uiApplication, elements, change);
// dynamicModel.UseUpdater();
// }
//}
}

View File

@@ -10,7 +10,13 @@ namespace ShrlAlgoToolkit.Revit.Assists;
public class ParameterAssist
{
/// <summary>
///
/// </summary>
/// <param name="file"></param>
/// <param name="groupname"></param>
/// <param name="paramname"></param>
/// <returns></returns>
private static ExternalDefinition GetSharedParameter(DefinitionFile file, string groupname, string paramname)
{
var myGroups = file.Groups;