File tree Expand file tree Collapse file tree 6 files changed +82
-4
lines changed
Expand file tree Collapse file tree 6 files changed +82
-4
lines changed Original file line number Diff line number Diff line change @@ -32,6 +32,9 @@ public enum Selector
3232 LoadedApplications ,
3333 ExternalServices ,
3434 VisibleInView ,
35+ UIApplication ,
36+ UIDocument ,
37+ UIView ,
3538 }
3639
3740 internal static class SelectorFactory
@@ -71,6 +74,9 @@ private static ISelector CreateSelector(Selector selector)
7174 Selector . LoadedApplications => new SnoopLoadedApplications ( ) ,
7275 Selector . ExternalServices => new SnoopExternalServices ( ) ,
7376 Selector . VisibleInView => new SnoopVisibleInView ( ) ,
77+ Selector . UIApplication => new SnoopUIApplication ( ) ,
78+ Selector . UIDocument => new SnoopUIDocument ( ) ,
79+ Selector . UIView => new SnoopUIView ( ) ,
7480 _ => throw new NotImplementedException ( )
7581 } ; ;
7682 return result ;
Original file line number Diff line number Diff line change 1+ using System . Collections . Generic ;
2+ using Autodesk . Revit . UI ;
3+ using RevitDBExplorer . Domain . DataModel ;
4+ using RevitDBExplorer . Domain . Selectors . Base ;
5+
6+ // (c) Revit Database Explorer https://github.com/NeVeSpl/RevitDBExplorer/blob/main/license.md
7+
8+ namespace RevitDBExplorer . Domain . Selectors
9+ {
10+ internal class SnoopUIApplication : ISelector
11+ {
12+ public InfoAboutSource Info { get ; } = new ( "UIApplication" ) ;
13+
14+
15+ public IEnumerable < SnoopableObject > Snoop ( UIApplication app )
16+ {
17+ yield return new SnoopableObject ( null , app ) ;
18+ }
19+ }
20+ }
Original file line number Diff line number Diff line change 1+ using System . Collections . Generic ;
2+ using Autodesk . Revit . UI ;
3+ using RevitDBExplorer . Domain . DataModel ;
4+ using RevitDBExplorer . Domain . Selectors . Base ;
5+
6+ // (c) Revit Database Explorer https://github.com/NeVeSpl/RevitDBExplorer/blob/main/license.md
7+
8+ namespace RevitDBExplorer . Domain . Selectors
9+ {
10+ internal class SnoopUIDocument : ISelector
11+ {
12+ public InfoAboutSource Info { get ; } = new ( "UIDocument" ) ;
13+
14+
15+ public IEnumerable < SnoopableObject > Snoop ( UIApplication app )
16+ {
17+ var document = app ? . ActiveUIDocument ;
18+
19+ if ( document == null ) yield break ;
20+
21+ yield return new SnoopableObject ( null , document ) ;
22+ }
23+ }
24+ }
Original file line number Diff line number Diff line change 1+ using System . Collections . Generic ;
2+ using System . Linq ;
3+ using Autodesk . Revit . UI ;
4+ using RevitDBExplorer . Domain . DataModel ;
5+ using RevitDBExplorer . Domain . Selectors . Base ;
6+
7+ // (c) Revit Database Explorer https://github.com/NeVeSpl/RevitDBExplorer/blob/main/license.md
8+
9+ namespace RevitDBExplorer . Domain . Selectors
10+ {
11+ internal class SnoopUIView : ISelector
12+ {
13+ public InfoAboutSource Info { get ; } = new ( "UIView" ) ;
14+
15+
16+ public IEnumerable < SnoopableObject > Snoop ( UIApplication app )
17+ {
18+ var views = app ? . ActiveUIDocument ? . GetOpenUIViews ( ) ;
19+ var view = views ? . Where ( x => x . ViewId == app . ActiveUIDocument . ActiveGraphicalView ? . Id ) . FirstOrDefault ( ) ;
20+
21+ if ( view == null ) yield break ;
22+
23+ yield return new SnoopableObject ( null , view ) ;
24+ }
25+ }
26+ }
Original file line number Diff line number Diff line change 143143 <MenuItem Header =" Snoop application" InputGestureText =" commandData.Application.Application" Click =" SelectorButton_Click" Tag =" Application" />
144144 <MenuItem Header =" Snoop document" InputGestureText =" commandData.Application.ActiveUIDocument.Document" Click =" SelectorButton_Click" Tag =" ActiveDocument" />
145145 <MenuItem Header =" Snoop active view" InputGestureText =" commandData.Application.ActiveUIDocument.Document.ActiveView" Click =" SelectorButton_Click" Tag =" ActiveView" />
146+ <Separator />
147+ <MenuItem Header =" Snoop ui application" InputGestureText =" commandData.Application" Click =" SelectorButton_Click" Tag =" UIApplication" />
148+ <MenuItem Header =" Snoop ui document" InputGestureText =" commandData.Application.ActiveUIDocument" Click =" SelectorButton_Click" Tag =" UIDocument" />
149+ <MenuItem Header =" Snoop active ui view" InputGestureText =" commandData.Application.ActiveUIDocument.GetOpenUIViews()" Click =" SelectorButton_Click" Tag =" UIView" />
146150 </ContextMenu >
147151 </Button .ContextMenu>
148152 </Button >
Original file line number Diff line number Diff line change 180180 <None Include =" ..\..\RevitDBExplorer.addin" >
181181 <Link >RevitDBExplorer.addin</Link >
182182 <CopyToOutputDirectory >Always</CopyToOutputDirectory >
183- </None >
184- <None Include =" Domain\DataModel\MembersOverrides\RebarConstraintsManager\RebarConstraintsManager_GetConstraintCandidatesForHandle.cs" />
183+ </None >
185184 <None Include =" Domain\Selectors\SnoopDependentElements.cs" />
186185 </ItemGroup >
187186 <ItemGroup >
188187 <Compile Remove =" obj\*.*" />
189188 </ItemGroup >
190- <ItemGroup >
191- <Compile Remove =" Domain\DataModel\MembersOverrides\RebarConstraintsManager\RebarConstraintsManager_GetConstraintCandidatesForHandle.cs" />
189+ <ItemGroup >
192190 <Compile Remove =" Domain\Selectors\SnoopDependentElements.cs" />
193191 </ItemGroup >
194192 <ItemGroup >
You can’t perform that action at this time.
0 commit comments