File tree Expand file tree Collapse file tree 4 files changed +128
-0
lines changed
sources/RevitDBExplorer/Domain/DataModel/MemberAccessors/MepSection Expand file tree Collapse file tree 4 files changed +128
-0
lines changed Original file line number Diff line number Diff line change 1+ using System . Collections . Generic ;
2+ using System . Linq . Expressions ;
3+ using Autodesk . Revit . DB ;
4+ using Autodesk . Revit . DB . Mechanical ;
5+
6+ // (c) Revit Database Explorer https://github.com/NeVeSpl/RevitDBExplorer/blob/main/license.md
7+
8+ namespace RevitDBExplorer . Domain . DataModel . MemberAccessors
9+ {
10+ internal class MepSection_GetCoefficient : MemberAccessorByType < MEPSection > , ICanCreateMemberAccessor
11+ {
12+ public IEnumerable < LambdaExpression > GetHandledMembers ( ) { yield return ( MEPSection x ) => x . GetCoefficient ( null ) ; }
13+
14+
15+ protected override bool CanBeSnoooped ( Document document , MEPSection value ) => value . GetElementIds ( ) . Count > 0 ;
16+
17+ protected override string GetLabel ( Document document , MEPSection value )
18+ {
19+ return Labeler . GetLabelForCollection ( "double" , value . GetElementIds ( ) . Count ) ;
20+ }
21+
22+ protected override IEnumerable < SnoopableObject > Snooop ( Document document , MEPSection value )
23+ {
24+ foreach ( var id in value . GetElementIds ( ) )
25+ {
26+ yield return SnoopableObject . CreateKeyValuePair ( document , id , value . GetCoefficient ( id ) ) ;
27+ }
28+ }
29+ }
30+ }
Original file line number Diff line number Diff line change 1+ using System . Collections . Generic ;
2+ using System . Linq . Expressions ;
3+ using Autodesk . Revit . DB ;
4+ using Autodesk . Revit . DB . Mechanical ;
5+
6+ // (c) Revit Database Explorer https://github.com/NeVeSpl/RevitDBExplorer/blob/main/license.md
7+
8+ namespace RevitDBExplorer . Domain . DataModel . MemberAccessors . MepSection
9+ {
10+
11+ internal class MepSection_GetPressureDrop : MemberAccessorByType < MEPSection > , ICanCreateMemberAccessor
12+ {
13+ public IEnumerable < LambdaExpression > GetHandledMembers ( ) { yield return ( MEPSection x ) => x . GetPressureDrop ( null ) ; }
14+
15+
16+ protected override bool CanBeSnoooped ( Document document , MEPSection value ) => value . GetElementIds ( ) . Count > 0 ;
17+
18+ protected override string GetLabel ( Document document , MEPSection value )
19+ {
20+ return Labeler . GetLabelForCollection ( "double" , value . GetElementIds ( ) . Count ) ;
21+ }
22+
23+ protected override IEnumerable < SnoopableObject > Snooop ( Document document , MEPSection value )
24+ {
25+ foreach ( var id in value . GetElementIds ( ) )
26+ {
27+ yield return SnoopableObject . CreateKeyValuePair ( document , id , value . GetPressureDrop ( id ) ) ;
28+ }
29+ }
30+ }
31+ }
Original file line number Diff line number Diff line change 1+ using System . Collections . Generic ;
2+ using System . Linq . Expressions ;
3+ using Autodesk . Revit . DB ;
4+ using Autodesk . Revit . DB . Mechanical ;
5+
6+ // (c) Revit Database Explorer https://github.com/NeVeSpl/RevitDBExplorer/blob/main/license.md
7+
8+ namespace RevitDBExplorer . Domain . DataModel . MemberAccessors . MepSection
9+ {
10+
11+ internal class MepSection_GetSegmentLength : MemberAccessorByType < MEPSection > , ICanCreateMemberAccessor
12+ {
13+ public IEnumerable < LambdaExpression > GetHandledMembers ( ) { yield return ( MEPSection x ) => x . GetSegmentLength ( null ) ; }
14+
15+
16+ protected override bool CanBeSnoooped ( Document document , MEPSection value ) => value . GetElementIds ( ) . Count > 0 ;
17+
18+ protected override string GetLabel ( Document document , MEPSection value )
19+ {
20+ return Labeler . GetLabelForCollection ( "double" , null ) ;
21+ }
22+
23+ protected override IEnumerable < SnoopableObject > Snooop ( Document document , MEPSection value )
24+ {
25+ foreach ( var id in value . GetElementIds ( ) )
26+ {
27+ var element = document . GetElement ( id ) ;
28+ if ( element is FamilyInstance ) continue ;
29+ yield return SnoopableObject . CreateKeyValuePair ( document , id , value . GetSegmentLength ( id ) ) ;
30+ }
31+ }
32+ }
33+ }
Original file line number Diff line number Diff line change 1+ using System . Collections . Generic ;
2+ using System . Linq . Expressions ;
3+ using Autodesk . Revit . DB ;
4+ using Autodesk . Revit . DB . Mechanical ;
5+ using Autodesk . Revit . DB . Plumbing ;
6+
7+ // (c) Revit Database Explorer https://github.com/NeVeSpl/RevitDBExplorer/blob/main/license.md
8+
9+ namespace RevitDBExplorer . Domain . DataModel . MemberAccessors . MepSection
10+ {
11+
12+ internal class MepSection_IsMain : MemberAccessorByType < MEPSection > , ICanCreateMemberAccessor
13+ {
14+ public IEnumerable < LambdaExpression > GetHandledMembers ( ) { yield return ( MEPSection x ) => x . IsMain ( null ) ; }
15+
16+
17+ protected override bool CanBeSnoooped ( Document document , MEPSection value ) => value . GetElementIds ( ) . Count > 0 ;
18+
19+ protected override string GetLabel ( Document document , MEPSection value )
20+ {
21+ return Labeler . GetLabelForCollection ( "bool" , null ) ;
22+ }
23+
24+ protected override IEnumerable < SnoopableObject > Snooop ( Document document , MEPSection value )
25+ {
26+ foreach ( var id in value . GetElementIds ( ) )
27+ {
28+ var element = document . GetElement ( id ) ;
29+ if ( element is not FamilyInstance ) continue ;
30+ yield return SnoopableObject . CreateKeyValuePair ( document , id , value . IsMain ( id ) ) ;
31+ }
32+ }
33+ }
34+ }
You can’t perform that action at this time.
0 commit comments