Skip to content

Commit

Permalink
Disable RebarBendingDetail TagText
Browse files Browse the repository at this point in the history
  • Loading branch information
Nice3point committed Apr 30, 2024
1 parent 934b9bc commit d795c49
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 1 deletion.
5 changes: 4 additions & 1 deletion source/RevitLookup/Core/ComponentModel/DescriptorMap.cs
Original file line number Diff line number Diff line change
Expand Up @@ -84,11 +84,15 @@ public static Descriptor FindDescriptor(object obj, Type type)
APIObject when type is null || type == typeof(APIObject) => new ApiObjectDescriptor(),

//IDisposables
View value when type == typeof(View) => new ViewDescriptor(value),
HostObject value when type is null || type == typeof(HostObject) => new HostObjectDescriptor(value),
RevitLinkType value when type is null || type == typeof(RevitLinkType) => new RevitLinkTypeDescriptor(value),
FamilyInstance value when type is null || type == typeof(FamilyInstance) => new FamilyInstanceDescriptor(value),
Panel value when type == typeof(Panel) => new PanelDescriptor(value),
SpatialElement value when type is null || type == typeof(SpatialElement) => new SpatialElementDescriptor(value),
#if REVIT2025_OR_GREATER
IndependentTag value when type is null || type == typeof(IndependentTag) => new IndependentTagDescriptor(value),
#endif
MEPSystem value when type is null || type == typeof(MEPSystem) => new MepSystemDescriptor(value),
Element value when type is null || type == typeof(Element) => new ElementDescriptor(value),
Document value when type is null || type == typeof(Document) => new DocumentDescriptor(value),
Expand All @@ -112,7 +116,6 @@ public static Descriptor FindDescriptor(object obj, Type type)
AssetProperty value when type is null || type == typeof(AssetProperty) => new AssetPropertyDescriptor(value),
BasePoint value when type == typeof(BasePoint) => new BasePointDescriptor(value),
InternalOrigin value when type == typeof(InternalOrigin) => new InternalOriginDescriptor(value),
View value when type == typeof(View) => new ViewDescriptor(value),
ViewSchedule value when type == typeof(ViewSchedule) => new ViewScheduleDescriptor(value),
ScheduleDefinition value when type == typeof(ScheduleDefinition) => new ScheduleDefinitionDescriptor(value),
TableData value when type == typeof(TableData) => new TableDataDescriptor(value),
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
// Copyright 2003-2024 by Autodesk, Inc.
//
// Permission to use, copy, modify, and distribute this software in
// object code form for any purpose and without fee is hereby granted,
// provided that the above copyright notice appears in all copies and
// that both that copyright notice and the limited warranty and
// restricted rights notice below appear in all supporting
// documentation.
//
// AUTODESK PROVIDES THIS PROGRAM "AS IS" AND WITH ALL FAULTS.
// AUTODESK SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTY OF
// MERCHANTABILITY OR FITNESS FOR A PARTICULAR USE. AUTODESK, INC.
// DOES NOT WARRANT THAT THE OPERATION OF THE PROGRAM WILL BE
// UNINTERRUPTED OR ERROR FREE.
//
// Use, duplication, or disclosure by the U.S. Government is subject to
// restrictions set forth in FAR 52.227-19 (Commercial Computer
// Software - Restricted Rights) and DFAR 252.227-7013(c)(1)(ii)
// (Rights in Technical Data and Computer Software), as applicable.

using System.Reflection;
#if REVIT2025_OR_GREATER
using Autodesk.Revit.DB.Structure;
#endif
using RevitLookup.Core.Contracts;
using RevitLookup.Core.Objects;

namespace RevitLookup.Core.ComponentModel.Descriptors;

public sealed class IndependentTagDescriptor(IndependentTag tag) : ElementDescriptor(tag), IDescriptorResolver
{
public new ResolveSet Resolve(Document context, string target, ParameterInfo[] parameters)
{
return target switch
{
#if REVIT2025_OR_GREATER
nameof(IndependentTag.TagText) when RebarBendingDetail.IsBendingDetail(tag) => ResolveSet.Append(new NotSupportedException("RebarBendingDetail not supported")),
#endif
_ => null
};
}
}

0 comments on commit d795c49

Please sign in to comment.