命名空间调整
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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();
|
||||
// }
|
||||
//}
|
||||
}
|
||||
@@ -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;
|
||||
|
||||
@@ -533,7 +533,11 @@ public static class SpatialExtensions
|
||||
|
||||
return list;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <param name="curve"></param>
|
||||
/// <returns></returns>
|
||||
public static ElementOrientation GetElementOrientation(this Curve curve)
|
||||
{
|
||||
var num = 0.0001;
|
||||
|
||||
@@ -9,9 +9,7 @@
|
||||
<Import_RootNamespace>ShrlAlgoToolkit.Revit</Import_RootNamespace>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="$(MSBuildThisFileDirectory)Assists\BuiltEnumDictionary.cs" />
|
||||
<Compile Include="$(MSBuildThisFileDirectory)Assists\CategoryAssist.cs" />
|
||||
<Compile Include="$(MSBuildThisFileDirectory)Assists\DMUAssist.cs" />
|
||||
<Compile Include="$(MSBuildThisFileDirectory)Assists\DuplicateTypeNamesHandler.cs" />
|
||||
<Compile Include="$(MSBuildThisFileDirectory)Assists\RevitCommandEndedMonitor.cs" />
|
||||
<Compile Include="$(MSBuildThisFileDirectory)Extensions\ReferenceExtensions.cs" />
|
||||
|
||||
Reference in New Issue
Block a user