Skip to content

Commit

Permalink
catching up
Browse files Browse the repository at this point in the history
  • Loading branch information
NeVeSpl committed May 19, 2024
1 parent 0a756f4 commit a55d7ef
Show file tree
Hide file tree
Showing 7 changed files with 97 additions and 5 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
using System.Collections.Generic;
using Autodesk.Revit.DB;
using RevitDBExplorer.Domain.DataModel.Members;
using RevitDBExplorer.Domain.DataModel.Members.Base;

// (c) Revit Database Explorer https://github.com/NeVeSpl/RevitDBExplorer/blob/main/license.md

namespace RevitDBExplorer.Domain.DataModel.MembersOverrides
{
internal class RevitLinkType_Overrides : IHaveMembersOverrides
{
public IEnumerable<IMemberOverride> GetOverrides() =>
[
MemberOverride<RevitLinkType>.ByFunc((document, element) => RevitLinkType.IsLoaded(document, element.Id)),
];
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
using System.Collections.Generic;
using Autodesk.Revit.DB;
using RevitDBExplorer.Domain.DataModel.Members;
using RevitDBExplorer.Domain.DataModel.Members.Base;

// (c) Revit Database Explorer https://github.com/NeVeSpl/RevitDBExplorer/blob/main/license.md

namespace RevitDBExplorer.Domain.DataModel.MembersOverrides
{
internal class ViewSchedule_Overrides : IHaveMembersOverrides
{
public IEnumerable<IMemberOverride> GetOverrides() =>
[
MemberOverride<ViewSchedule>.ByFunc((document, target) => ViewSchedule.GetValidCategoriesForSchedule()),
MemberOverride<ViewSchedule>.ByFunc((document, target) => ViewSchedule.GetValidCategoriesForKeySchedule()),
MemberOverride<ViewSchedule>.ByFunc((document, target) => ViewSchedule.GetValidCategoriesForMaterialTakeoff()),
MemberOverride<ViewSchedule>.ByFunc((document, target) => ViewSchedule.GetValidFamiliesForNoteBlock(document)),
];
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,22 @@ internal class Category_Templates : IHaveMemberTemplates
public IEnumerable<ISnoopableMemberTemplate> GetTemplates() =>
[
#if R2022_MIN
MemberTemplate<Category>.Create((doc, category) => ParameterFilterUtilities.GetFilterableParametersInCommon(doc, new[] { category.Id } )),
#endif
MemberTemplate<Category>.Create((doc, category) => ParameterFilterUtilities.GetFilterableParametersInCommon(doc, new[] { category.Id } )),
#endif
MemberTemplate<Category>.Create((doc, category) => doc.ActiveView.CanCategoryBeHidden(category.Id), kind: MemberKind.AsArgument),
MemberTemplate<Category>.Create((doc, category) => doc.ActiveView.CanCategoryBeHiddenTemporary(category.Id), kind: MemberKind.AsArgument),
MemberTemplate<Category>.Create((doc, category) => doc.ActiveView.GetCategoryHidden(category.Id), kind: MemberKind.AsArgument),
MemberTemplate<Category>.Create((doc, category) => doc.ActiveView.GetCategoryOverrides(category.Id), kind: MemberKind.AsArgument),
MemberTemplate<Category>.Create((doc, category) => doc.ActiveView.IsCategoryOverridable(category.Id), kind: MemberKind.AsArgument),
#if R2022_MIN
MemberTemplate<Category>.Create((doc, category) => doc.ActiveView.GetColorFillSchemeId(category.Id), kind: MemberKind.AsArgument),
#endif


MemberTemplate<Category>.Create((doc, category) => ViewSchedule.IsValidCategoryForKeySchedule(category.Id)),
MemberTemplate<Category>.Create((doc, category) => ViewSchedule.IsValidCategoryForKeySchedule(category.Id)),
MemberTemplate<Category>.Create((doc, category) => ViewSchedule.IsValidCategoryForMaterialTakeoff(category.Id)),
MemberTemplate<Category>.Create((doc, category) => ViewSchedule.IsValidFamilyForNoteBlock(doc, category.Id)),
];
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
using System.Collections.Generic;
using Autodesk.Revit.DB;
using RevitDBExplorer.Domain.DataModel.Members;
using RevitDBExplorer.Domain.DataModel.Members.Base;

// (c) Revit Database Explorer https://github.com/NeVeSpl/RevitDBExplorer/blob/main/license.md

namespace RevitDBExplorer.Domain.DataModel.MembersTemplates
{
internal class ParameterFilterElement_Templates : IHaveMemberTemplates
{
public IEnumerable<ISnoopableMemberTemplate> GetTemplates() =>
[

MemberTemplate<ParameterFilterElement>.Create((doc, target) => doc.ActiveView.GetFilterOverrides(target.Id), kind: MemberKind.AsArgument),
MemberTemplate<SelectionFilterElement>.Create((doc, target) => doc.ActiveView.GetFilterOverrides(target.Id), kind: MemberKind.AsArgument),
MemberTemplate<ParameterFilterElement>.Create((doc, target) => doc.ActiveView.GetFilterVisibility(target.Id), kind: MemberKind.AsArgument),
MemberTemplate<SelectionFilterElement>.Create((doc, target) => doc.ActiveView.GetFilterVisibility(target.Id), kind: MemberKind.AsArgument),
MemberTemplate<ParameterFilterElement>.Create((doc, target) => doc.ActiveView.GetIsFilterEnabled(target.Id), kind: MemberKind.AsArgument),
MemberTemplate<SelectionFilterElement>.Create((doc, target) => doc.ActiveView.GetIsFilterEnabled(target.Id), kind: MemberKind.AsArgument),
MemberTemplate<ParameterFilterElement>.Create((doc, target) => doc.ActiveView.IsFilterApplied(target.Id), kind: MemberKind.AsArgument),
MemberTemplate<SelectionFilterElement>.Create((doc, target) => doc.ActiveView.IsFilterApplied(target.Id), kind: MemberKind.AsArgument),
];
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public IEnumerable<ISnoopableMemberTemplate> GetTemplates() =>
MemberTemplate<Parameter>.Create((doc, parameter) => UnitFormatUtils.Format(doc.GetUnits(), parameter.Definition.GetDataType(), parameter.AsDouble(), false), x => UnitUtils.IsMeasurableSpec(x.Definition?.GetDataType())),
#endif
MemberTemplate<Parameter>.Create((doc, target) => GlobalParametersManager.IsValidGlobalParameter(doc, target.Id)),
MemberTemplate<Parameter>.Create((doc, target) => doc.FamilyManager.GetAssociatedFamilyParameter(target)),
MemberTemplate<Parameter>.Create((doc, target) => doc.FamilyManager.GetAssociatedFamilyParameter(target), kind: MemberKind.AsArgument),
];
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
using System.Collections.Generic;
using Autodesk.Revit.DB;
using RevitDBExplorer.Domain.DataModel.Members;
using RevitDBExplorer.Domain.DataModel.Members.Base;

// (c) Revit Database Explorer https://github.com/NeVeSpl/RevitDBExplorer/blob/main/license.md

namespace RevitDBExplorer.Domain.DataModel.MembersTemplates
{
internal class ViewSchedule_Templates : IHaveMemberTemplates
{
public IEnumerable<ISnoopableMemberTemplate> GetTemplates() =>
[
MemberTemplate<ViewSchedule>.Create((document, target) => TableView.GetAvailableParameters(document, target.Definition.CategoryId), kind: MemberKind.StaticMethod),
];
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@ internal class View_Templates : IHaveMemberTemplates
{
public IEnumerable<ISnoopableMemberTemplate> GetTemplates() =>
[
MemberTemplate<View>.Create((document, target) => SpatialFieldManager.GetSpatialFieldManager(target), kind: MemberKind.StaticMethod),
MemberTemplate<ViewSchedule>.Create((document, target) => TableView.GetAvailableParameters(document, target.Definition.CategoryId), kind: MemberKind.StaticMethod),
MemberTemplate<View>.Create((document, target) => SpatialFieldManager.GetSpatialFieldManager(target), kind: MemberKind.StaticMethod),
];
}
}

0 comments on commit a55d7ef

Please sign in to comment.