├── .gitignore ├── NwLookup.sln ├── NwLookup.v17 ├── Application.cs ├── NwLookup.v17.csproj ├── Properties │ └── AssemblyInfo.cs ├── Snoop │ └── Collectors │ │ ├── CustomCollector.cs │ │ └── ModelItemStreamPass.cs ├── en-US │ ├── NwLookupDefinitions.txt │ └── NwLookupLayout.xaml ├── lib │ ├── Autodesk.Navisworks.Api.dll │ ├── Autodesk.Navisworks.ComApi.dll │ └── Autodesk.Navisworks.Interop.ComApi.dll ├── packages.config └── resources │ ├── mg_16x16.ico │ └── mg_32x32.ico ├── NwLookup.v18 ├── Application.cs ├── NwLookup.v18.csproj ├── Properties │ └── AssemblyInfo.cs ├── Snoop │ └── Collectors │ │ ├── CustomCollector.cs │ │ └── ModelItemStreamPass.cs ├── en-US │ ├── NwLookupDefinitions.txt │ └── NwLookupLayout.xaml ├── lib │ ├── Autodesk.Navisworks.Api.dll │ ├── Autodesk.Navisworks.ComApi.dll │ └── Autodesk.Navisworks.Interop.ComApi.dll ├── packages.config └── resources │ ├── mg_16x16.ico │ └── mg_32x32.ico ├── NwLookup.v19 ├── Application.cs ├── NwLookup.v19.csproj ├── Properties │ └── AssemblyInfo.cs ├── Snoop │ └── Collectors │ │ ├── CustomCollector.cs │ │ └── ModelItemStreamPass.cs ├── en-US │ ├── NwLookupDefinitions.txt │ └── NwLookupLayout.xaml ├── lib │ ├── Autodesk.Navisworks.Api.dll │ ├── Autodesk.Navisworks.ComApi.dll │ └── Autodesk.Navisworks.Interop.ComApi.dll └── resources │ ├── mg_16x16.ico │ └── mg_32x32.ico ├── NwLookup.v20 ├── Application.cs ├── NwLookup.v20.csproj ├── Properties │ └── AssemblyInfo.cs ├── Snoop │ └── Collectors │ │ ├── CustomCollector.cs │ │ └── ModelItemStreamPass.cs ├── en-US │ ├── NwLookupDefinitions.txt │ └── NwLookupLayout.xaml ├── lib │ ├── Autodesk.Navisworks.Api.dll │ ├── Autodesk.Navisworks.ComApi.dll │ └── Autodesk.Navisworks.Interop.ComApi.dll └── resources │ ├── mg_16x16.ico │ └── mg_32x32.ico ├── NwLookup.v21 ├── Application.cs ├── NwLookup.v21.csproj ├── Properties │ └── AssemblyInfo.cs ├── Snoop │ └── Collectors │ │ ├── CustomCollector.cs │ │ └── ModelItemStreamPass.cs ├── en-US │ ├── NwLookupDefinitions.txt │ └── NwLookupLayout.xaml ├── lib │ ├── Autodesk.Navisworks.Api.dll │ ├── Autodesk.Navisworks.ComApi.dll │ └── Autodesk.Navisworks.Interop.ComApi.dll └── resources │ ├── mg_16x16.ico │ └── mg_32x32.ico ├── NwLookup ├── NwLookup.csproj ├── Properties │ ├── AssemblyInfo.cs │ ├── Resources.Designer.cs │ ├── Resources.resx │ ├── Settings.Designer.cs │ └── Settings.settings └── Snoop │ ├── Collectors │ ├── Collector.cs │ ├── DefaultStreamPass.cs │ ├── ICollector.cs │ ├── IMemberStream.cs │ ├── IStreamPass.cs │ ├── MemberStream.cs │ ├── MethodStream.cs │ ├── PropertyStream.cs │ ├── ReflectionUtils.cs │ └── StreamPassBase.cs │ ├── Datas │ ├── Data.cs │ ├── DataArray.cs │ ├── DataFactory.cs │ ├── DefaultData.cs │ ├── ExceptionData.cs │ ├── MethodData.cs │ └── PrimitiveData.cs │ └── Views │ ├── Controls │ └── AutoSizedGridView.cs │ ├── Models │ ├── NotifyViewModelBase.cs │ └── RelayCommand.cs │ ├── SnoopViewModel.cs │ ├── SnoopWindow.xaml │ ├── SnoopWindow.xaml.cs │ ├── TypesViewModel.cs │ ├── TypesWindow.xaml │ └── TypesWindow.xaml.cs ├── NwLookup_Setup ├── Assets │ ├── Banner.bmp │ ├── Licence.md │ ├── Licence.rtf │ ├── Main.bmp │ └── icon.ico ├── Common.wxl ├── Directories.wxs ├── Files.wxs ├── NwLookup.msi ├── NwLookup_Setup.wixproj └── Product.wxs ├── PackageContents.xml ├── README.md ├── Tools ├── Build.events └── ExtraCleanup.targets └── exclude.txt /.gitignore: -------------------------------------------------------------------------------- 1 | ## Ignore Visual Studio temporary files, build results, and 2 | ## files generated by popular Visual Studio add-ons. 3 | 4 | # User-specific files 5 | *.suo 6 | *.user 7 | *.sln.docstates 8 | 9 | # Build results 10 | [Dd]ebug/ 11 | [Dd]ebugPublic/ 12 | [Rr]elease/ 13 | [Rr]eleases/ 14 | x64/ 15 | x86/ 16 | bld/ 17 | [Bb]in/ 18 | [Oo]bj/ 19 | build/ 20 | 21 | # Roslyn cache directories 22 | *.ide/ 23 | .vs/ 24 | 25 | # MSTest test Results 26 | [Tt]est[Rr]esult*/ 27 | [Bb]uild[Ll]og.* 28 | 29 | # NUnit 30 | *.VisualState.xml 31 | TestResult.xml 32 | nunit-*.xml 33 | 34 | # Build Results of an ATL Project 35 | [Dd]ebugPS/ 36 | [Rr]eleasePS/ 37 | dlldata.c 38 | 39 | *_i.c 40 | *_p.c 41 | *_i.h 42 | *.ilk 43 | *.meta 44 | *.obj 45 | *.pch 46 | *.pdb 47 | *.pgc 48 | *.pgd 49 | *.rsp 50 | *.sbr 51 | *.tlb 52 | *.tli 53 | *.tlh 54 | *.tmp 55 | *.tmp_proj 56 | *.log 57 | *.vspscc 58 | *.vssscc 59 | .builds 60 | *.pidb 61 | *.svclog 62 | *.scc 63 | 64 | # Chutzpah Test files 65 | _Chutzpah* 66 | 67 | # Visual C++ cache files 68 | ipch/ 69 | *.aps 70 | *.ncb 71 | *.opensdf 72 | *.sdf 73 | *.cachefile 74 | 75 | # Visual Studio profiler 76 | *.psess 77 | *.vsp 78 | *.vspx 79 | 80 | # TFS 2012 Local Workspace 81 | $tf/ 82 | 83 | # Guidance Automation Toolkit 84 | *.gpState 85 | 86 | # ReSharper is a .NET coding add-in 87 | _ReSharper*/ 88 | *.[Rr]e[Ss]harper 89 | *.DotSettings.user 90 | 91 | # JustCode is a .NET coding addin-in 92 | .JustCode 93 | 94 | # TeamCity is a build add-in 95 | _TeamCity* 96 | 97 | # DotCover is a Code Coverage Tool 98 | *.dotCover 99 | 100 | # NCrunch 101 | _NCrunch_* 102 | .*crunch*.local.xml 103 | 104 | # MightyMoose 105 | *.mm.* 106 | AutoTest.Net/ 107 | 108 | # Web workbench (sass) 109 | .sass-cache/ 110 | 111 | # Installshield output folder 112 | [Ee]xpress/ 113 | 114 | # DocProject is a documentation generator add-in 115 | DocProject/buildhelp/ 116 | DocProject/Help/*.HxT 117 | DocProject/Help/*.HxC 118 | DocProject/Help/*.hhc 119 | DocProject/Help/*.hhk 120 | DocProject/Help/*.hhp 121 | DocProject/Help/Html2 122 | DocProject/Help/html 123 | 124 | # Click-Once directory 125 | publish/ 126 | 127 | # Publish Web Output 128 | *.[Pp]ublish.xml 129 | *.azurePubxml 130 | # TODO: Comment the next line if you want to checkin your web deploy settings 131 | # but database connection strings (with potential passwords) will be unencrypted 132 | *.pubxml 133 | *.publishproj 134 | 135 | # NuGet Packages 136 | *.nupkg 137 | # The packages folder can be ignored because of Package Restore 138 | **/packages/* 139 | # except build/, which is used as an MSBuild target. 140 | !**/packages/build/ 141 | # If using the old MSBuild-Integrated Package Restore, uncomment this: 142 | #!**/packages/repositories.config 143 | Packages.dgml 144 | 145 | # Windows Azure Build Output 146 | csx/ 147 | *.build.csdef 148 | 149 | # Windows Store app package directory 150 | AppPackages/ 151 | 152 | # Others 153 | sql/ 154 | *.Cache 155 | ClientBin/ 156 | [Ss]tyle[Cc]op.* 157 | ~$* 158 | *~ 159 | *.dbmdl 160 | *.dbproj.schemaview 161 | *.pfx 162 | *.publishsettings 163 | node_modules/ 164 | 165 | # RIA/Silverlight projects 166 | Generated_Code/ 167 | 168 | # Backup & report files from converting an old project file 169 | # to a newer Visual Studio version. Backup files are not needed, 170 | # because we have git ;-) 171 | _UpgradeReport_Files/ 172 | Backup*/ 173 | UpgradeLog*.XML 174 | UpgradeLog*.htm 175 | 176 | # SQL Server files 177 | *.mdf 178 | *.ldf 179 | 180 | # Business Intelligence projects 181 | *.rdl.data 182 | *.bim.layout 183 | *.bim_*.settings 184 | 185 | # Microsoft Fakes 186 | FakesAssemblies/ 187 | 188 | # ========================= 189 | # Operating System Files 190 | # ========================= 191 | 192 | # OSX 193 | # ========================= 194 | 195 | .DS_Store 196 | .AppleDouble 197 | .LSOverride 198 | 199 | # Icon must end with two \r 200 | Icon 201 | 202 | 203 | # Thumbnails 204 | ._* 205 | 206 | # Files that might appear on external disk 207 | .Spotlight-V100 208 | .Trashes 209 | 210 | # Directories potentially created on remote AFP share 211 | .AppleDB 212 | .AppleDesktop 213 | Network Trash Folder 214 | Temporary Items 215 | .apdisk 216 | 217 | # Windows 218 | # ========================= 219 | 220 | # Windows image file caches 221 | Thumbs.db 222 | ehthumbs.db 223 | 224 | # Folder config file 225 | Desktop.ini 226 | 227 | # Recycle Bin used on file shares 228 | $RECYCLE.BIN/ 229 | 230 | # Windows Installer files 231 | *.cab 232 | # *.msi 233 | *.msm 234 | *.msp 235 | 236 | #OpenCover output 237 | coverage.xml 238 | 239 | #Msbuild binary log output 240 | output.binlog 241 | 242 | # KDiff3 243 | *_BACKUP_* 244 | *_BASE_* 245 | *_LOCAL_* 246 | *_REMOTE_* 247 | *.orig 248 | 249 | AkavacheSqliteLinkerOverride.cs 250 | NuGetBuild 251 | WiX.Toolset.DummyFile.txt 252 | GitHubVS.sln.DotSettings -------------------------------------------------------------------------------- /NwLookup.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio Version 16 4 | VisualStudioVersion = 16.0.30907.101 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NwLookup.v18", "NwLookup.v18\NwLookup.v18.csproj", "{B0C56007-B6E4-4A89-8E61-D37D2AFE8BE0}" 7 | EndProject 8 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NwLookup", "NwLookup\NwLookup.csproj", "{875544E5-CD02-4E38-8E32-3016EDF47027}" 9 | EndProject 10 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{7E9299A8-446F-4A8A-9FEC-C1B6869FDCE3}" 11 | ProjectSection(SolutionItems) = preProject 12 | PackageContents.xml = PackageContents.xml 13 | EndProjectSection 14 | EndProject 15 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NwLookup.v17", "NwLookup.v17\NwLookup.v17.csproj", "{5D2D6A6B-3BEF-40E9-B151-09B346800648}" 16 | EndProject 17 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NwLookup.v21", "NwLookup.v21\NwLookup.v21.csproj", "{944F3E88-538E-4797-B8D5-42204F60042A}" 18 | EndProject 19 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NwLookup.v19", "NwLookup.v19\NwLookup.v19.csproj", "{1EB9F9F4-C4FE-455F-BA41-950901E38D08}" 20 | EndProject 21 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NwLookup.v20", "NwLookup.v20\NwLookup.v20.csproj", "{D3DB9547-E3D2-443F-84F9-798E3C92FC7F}" 22 | EndProject 23 | Project("{930C7802-8A8C-48F9-8165-68863BCCD9DD}") = "NwLookup_Setup", "NwLookup_Setup\NwLookup_Setup.wixproj", "{0CEA8009-A942-43B4-8E1D-22610289F902}" 24 | EndProject 25 | Global 26 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 27 | Debug|x64 = Debug|x64 28 | Debug|x86 = Debug|x86 29 | Release|x64 = Release|x64 30 | Release|x86 = Release|x86 31 | EndGlobalSection 32 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 33 | {B0C56007-B6E4-4A89-8E61-D37D2AFE8BE0}.Debug|x64.ActiveCfg = Debug|x64 34 | {B0C56007-B6E4-4A89-8E61-D37D2AFE8BE0}.Debug|x64.Build.0 = Debug|x64 35 | {B0C56007-B6E4-4A89-8E61-D37D2AFE8BE0}.Debug|x86.ActiveCfg = Debug|x64 36 | {B0C56007-B6E4-4A89-8E61-D37D2AFE8BE0}.Release|x64.ActiveCfg = Release|x64 37 | {B0C56007-B6E4-4A89-8E61-D37D2AFE8BE0}.Release|x64.Build.0 = Release|x64 38 | {B0C56007-B6E4-4A89-8E61-D37D2AFE8BE0}.Release|x86.ActiveCfg = Release|x64 39 | {875544E5-CD02-4E38-8E32-3016EDF47027}.Debug|x64.ActiveCfg = Debug|x64 40 | {875544E5-CD02-4E38-8E32-3016EDF47027}.Debug|x64.Build.0 = Debug|x64 41 | {875544E5-CD02-4E38-8E32-3016EDF47027}.Debug|x86.ActiveCfg = Debug|x64 42 | {875544E5-CD02-4E38-8E32-3016EDF47027}.Release|x64.ActiveCfg = Release|x64 43 | {875544E5-CD02-4E38-8E32-3016EDF47027}.Release|x64.Build.0 = Release|x64 44 | {875544E5-CD02-4E38-8E32-3016EDF47027}.Release|x86.ActiveCfg = Release|x64 45 | {5D2D6A6B-3BEF-40E9-B151-09B346800648}.Debug|x64.ActiveCfg = Debug|x64 46 | {5D2D6A6B-3BEF-40E9-B151-09B346800648}.Debug|x64.Build.0 = Debug|x64 47 | {5D2D6A6B-3BEF-40E9-B151-09B346800648}.Debug|x86.ActiveCfg = Debug|x64 48 | {5D2D6A6B-3BEF-40E9-B151-09B346800648}.Release|x64.ActiveCfg = Release|x64 49 | {5D2D6A6B-3BEF-40E9-B151-09B346800648}.Release|x64.Build.0 = Release|x64 50 | {5D2D6A6B-3BEF-40E9-B151-09B346800648}.Release|x86.ActiveCfg = Release|x64 51 | {944F3E88-538E-4797-B8D5-42204F60042A}.Debug|x64.ActiveCfg = Debug|x64 52 | {944F3E88-538E-4797-B8D5-42204F60042A}.Debug|x64.Build.0 = Debug|x64 53 | {944F3E88-538E-4797-B8D5-42204F60042A}.Debug|x86.ActiveCfg = Debug|x64 54 | {944F3E88-538E-4797-B8D5-42204F60042A}.Release|x64.ActiveCfg = Release|x64 55 | {944F3E88-538E-4797-B8D5-42204F60042A}.Release|x64.Build.0 = Release|x64 56 | {944F3E88-538E-4797-B8D5-42204F60042A}.Release|x86.ActiveCfg = Release|x64 57 | {1EB9F9F4-C4FE-455F-BA41-950901E38D08}.Debug|x64.ActiveCfg = Debug|x64 58 | {1EB9F9F4-C4FE-455F-BA41-950901E38D08}.Debug|x64.Build.0 = Debug|x64 59 | {1EB9F9F4-C4FE-455F-BA41-950901E38D08}.Debug|x86.ActiveCfg = Debug|x64 60 | {1EB9F9F4-C4FE-455F-BA41-950901E38D08}.Release|x64.ActiveCfg = Release|x64 61 | {1EB9F9F4-C4FE-455F-BA41-950901E38D08}.Release|x64.Build.0 = Release|x64 62 | {1EB9F9F4-C4FE-455F-BA41-950901E38D08}.Release|x86.ActiveCfg = Release|x64 63 | {D3DB9547-E3D2-443F-84F9-798E3C92FC7F}.Debug|x64.ActiveCfg = Debug|x64 64 | {D3DB9547-E3D2-443F-84F9-798E3C92FC7F}.Debug|x64.Build.0 = Debug|x64 65 | {D3DB9547-E3D2-443F-84F9-798E3C92FC7F}.Debug|x86.ActiveCfg = Debug|x64 66 | {D3DB9547-E3D2-443F-84F9-798E3C92FC7F}.Release|x64.ActiveCfg = Release|x64 67 | {D3DB9547-E3D2-443F-84F9-798E3C92FC7F}.Release|x64.Build.0 = Release|x64 68 | {D3DB9547-E3D2-443F-84F9-798E3C92FC7F}.Release|x86.ActiveCfg = Release|x64 69 | {0CEA8009-A942-43B4-8E1D-22610289F902}.Debug|x64.ActiveCfg = Debug|x86 70 | {0CEA8009-A942-43B4-8E1D-22610289F902}.Debug|x86.ActiveCfg = Debug|x86 71 | {0CEA8009-A942-43B4-8E1D-22610289F902}.Debug|x86.Build.0 = Debug|x86 72 | {0CEA8009-A942-43B4-8E1D-22610289F902}.Release|x64.ActiveCfg = Release|x86 73 | {0CEA8009-A942-43B4-8E1D-22610289F902}.Release|x64.Build.0 = Release|x86 74 | {0CEA8009-A942-43B4-8E1D-22610289F902}.Release|x86.ActiveCfg = Release|x86 75 | {0CEA8009-A942-43B4-8E1D-22610289F902}.Release|x86.Build.0 = Release|x86 76 | EndGlobalSection 77 | GlobalSection(SolutionProperties) = preSolution 78 | HideSolutionNode = FALSE 79 | EndGlobalSection 80 | GlobalSection(ExtensibilityGlobals) = postSolution 81 | SolutionGuid = {A5C1E327-5E14-498C-AA68-35E5B6508740} 82 | EndGlobalSection 83 | EndGlobal 84 | -------------------------------------------------------------------------------- /NwLookup.v17/Application.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | using Autodesk.Navisworks.Api; 4 | using Autodesk.Navisworks.Api.Plugins; 5 | 6 | using NwLookup.Snoop.Datas; 7 | using NwLookup.v17.Snoop.Collectors; 8 | 9 | using ComApi = Autodesk.Navisworks.Api.Interop.ComApi; 10 | 11 | namespace NwLookup.v17 12 | { 13 | [Plugin("NwLookup.v17.Application", "AMCC", DisplayName = "Snoop")] 14 | [Strings("NwLookupDefinitions.txt")] 15 | [RibbonLayout("NwLookupLayout.xaml")] 16 | [RibbonTab("ID_NWLOOKUP_TAB")] 17 | [Command("NWLOOKUP_SNOOP_COMMAND", 18 | Icon = "resources\\mg_16x16.ico", 19 | LargeIcon = "resources\\mg_32x32.ico", 20 | CallCanExecute = CallCanExecute.Always, 21 | CanToggle = true, 22 | LoadForCanExecute = true)] 23 | public class Application : CommandHandlerPlugin 24 | { 25 | public override int ExecuteCommand(string name, params string[] parameters) 26 | { 27 | switch (name) 28 | { 29 | case "NWLOOKUP_SNOOP_COMMAND": 30 | NwLookupCommand(); 31 | break; 32 | default: 33 | break; 34 | } 35 | 36 | return 0; 37 | } 38 | 39 | public override CommandState CanExecuteCommand(string name) 40 | { 41 | switch (name) 42 | { 43 | case "NWLOOKUP_SNOOP_COMMAND": 44 | return new CommandState(true); 45 | default: 46 | throw new NotImplementedException( 47 | string.Format("Command with name {0} is not implemented", name) 48 | ); 49 | } 50 | } 51 | 52 | private void NwLookupCommand() 53 | { 54 | // Force loading of the Interop.ComApi assembly so that it will be included when 55 | // the 'Types' call is made in reflection utils 56 | GC.KeepAlive(typeof(ComApi.InwBase)); 57 | Document document = Autodesk.Navisworks.Api.Application.ActiveDocument; 58 | Data data; 59 | if (document.CurrentSelection.SelectedItems.IsEmpty) 60 | data = DataFactory.Create(document); 61 | else 62 | data = DataFactory.Create(document.CurrentSelection.SelectedItems); 63 | data.Snoop(new CustomCollector()); 64 | } 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /NwLookup.v17/NwLookup.v17.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | {5D2D6A6B-3BEF-40E9-B151-09B346800648} 6 | Library 7 | Properties 8 | NwLookup.v17 9 | NwLookup.v17 10 | v4.5.2 11 | 512 12 | true 13 | 2017 14 | 15 | 16 | true 17 | bin\x64\Debug\ 18 | DEBUG;TRACE 19 | full 20 | x64 21 | prompt 22 | MinimumRecommendedRules.ruleset 23 | 7.3 24 | 25 | 26 | bin\x64\Release\ 27 | TRACE 28 | true 29 | pdbonly 30 | x64 31 | prompt 32 | MinimumRecommendedRules.ruleset 33 | 7.3 34 | 35 | 36 | 37 | False 38 | lib\Autodesk.Navisworks.Api.dll 39 | False 40 | 41 | 42 | False 43 | lib\Autodesk.Navisworks.ComApi.dll 44 | False 45 | 46 | 47 | False 48 | False 49 | lib\Autodesk.Navisworks.Interop.ComApi.dll 50 | False 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | ..\packages\System.ValueTuple.4.5.0\lib\netstandard1.0\System.ValueTuple.dll 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | {875544e5-cd02-4e38-8e32-3016edf47027} 82 | NwLookup 83 | 84 | 85 | 86 | 87 | PreserveNewest 88 | 89 | 90 | 91 | 92 | MSBuild:Compile 93 | Designer 94 | PreserveNewest 95 | 96 | 97 | 98 | 99 | PreserveNewest 100 | 101 | 102 | PreserveNewest 103 | 104 | 105 | 106 | 107 | 108 | -------------------------------------------------------------------------------- /NwLookup.v17/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("NwLookup.v17")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("AMCC")] 12 | [assembly: AssemblyProduct("NwLookup.v17")] 13 | [assembly: AssemblyCopyright("Copyright © 2019")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("5D2D6A6B-3BEF-40E9-B151-09B346800648")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /NwLookup.v17/Snoop/Collectors/CustomCollector.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | 3 | using NwLookup.Snoop.Collectors; 4 | 5 | namespace NwLookup.v17.Snoop.Collectors 6 | { 7 | public class CustomCollector : Collector 8 | { 9 | public CustomCollector() 10 | : base(new List{ 11 | new DefaultStreamPass(), 12 | new ModelItemStreamPass() 13 | }) 14 | { } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /NwLookup.v17/Snoop/Collectors/ModelItemStreamPass.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | 3 | using NwLookup.Snoop.Datas; 4 | using NwLookup.Snoop.Collectors; 5 | 6 | using Autodesk.Navisworks.Api; 7 | 8 | using ComApi = Autodesk.Navisworks.Api.Interop.ComApi; 9 | using ComBridge = Autodesk.Navisworks.Api.ComApi.ComApiBridge; 10 | 11 | namespace NwLookup.v17.Snoop.Collectors 12 | { 13 | public class ModelItemStreamPass : StreamPassBase 14 | { 15 | public override bool CanRun(object obj) 16 | => obj is ModelItem; 17 | 18 | public override void Stream(IList datas, object obj) 19 | { 20 | ComApi.InwOaPath path = ComBridge.ToInwOaPath((ModelItem)obj); 21 | StreamInternal(datas, path); 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /NwLookup.v17/en-US/NwLookupDefinitions.txt: -------------------------------------------------------------------------------- 1 | # Local names for ribbon tab, panel, and controls 2 | $utf8 3 | 4 | ID_NWLOOKUP_TAB.DisplayName=NwLookup 5 | 6 | NWLOOKUP_SNOOP_COMMAND.DisplayName=Snoop 7 | -------------------------------------------------------------------------------- /NwLookup.v17/en-US/NwLookupLayout.xaml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | 9 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /NwLookup.v17/lib/Autodesk.Navisworks.Api.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/awmcc90/NwLookup/680444523de9964dc8534e39f0f8d05b58b7ccd2/NwLookup.v17/lib/Autodesk.Navisworks.Api.dll -------------------------------------------------------------------------------- /NwLookup.v17/lib/Autodesk.Navisworks.ComApi.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/awmcc90/NwLookup/680444523de9964dc8534e39f0f8d05b58b7ccd2/NwLookup.v17/lib/Autodesk.Navisworks.ComApi.dll -------------------------------------------------------------------------------- /NwLookup.v17/lib/Autodesk.Navisworks.Interop.ComApi.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/awmcc90/NwLookup/680444523de9964dc8534e39f0f8d05b58b7ccd2/NwLookup.v17/lib/Autodesk.Navisworks.Interop.ComApi.dll -------------------------------------------------------------------------------- /NwLookup.v17/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | -------------------------------------------------------------------------------- /NwLookup.v17/resources/mg_16x16.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/awmcc90/NwLookup/680444523de9964dc8534e39f0f8d05b58b7ccd2/NwLookup.v17/resources/mg_16x16.ico -------------------------------------------------------------------------------- /NwLookup.v17/resources/mg_32x32.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/awmcc90/NwLookup/680444523de9964dc8534e39f0f8d05b58b7ccd2/NwLookup.v17/resources/mg_32x32.ico -------------------------------------------------------------------------------- /NwLookup.v18/Application.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | using Autodesk.Navisworks.Api; 4 | using Autodesk.Navisworks.Api.Plugins; 5 | 6 | using NwLookup.Snoop.Datas; 7 | using NwLookup.v18.Snoop.Collectors; 8 | 9 | using ComApi = Autodesk.Navisworks.Api.Interop.ComApi; 10 | 11 | namespace NwLookup.v18 12 | { 13 | [Plugin("NwLookup.v18.Application", "AMCC", DisplayName = "Snoop")] 14 | [Strings("NwLookupDefinitions.txt")] 15 | [RibbonLayout("NwLookupLayout.xaml")] 16 | [RibbonTab("ID_NWLOOKUP_TAB")] 17 | [Command("NWLOOKUP_SNOOP_COMMAND", 18 | Icon = "resources\\mg_16x16.ico", 19 | LargeIcon = "resources\\mg_32x32.ico", 20 | CallCanExecute = CallCanExecute.Always, 21 | CanToggle = true, 22 | LoadForCanExecute = true)] 23 | public class Application : CommandHandlerPlugin 24 | { 25 | public override int ExecuteCommand(string name, params string[] parameters) 26 | { 27 | switch (name) 28 | { 29 | case "NWLOOKUP_SNOOP_COMMAND": 30 | NwLookupCommand(); 31 | break; 32 | default: 33 | break; 34 | } 35 | 36 | return 0; 37 | } 38 | 39 | public override CommandState CanExecuteCommand(string name) 40 | { 41 | switch (name) 42 | { 43 | case "NWLOOKUP_SNOOP_COMMAND": 44 | return new CommandState(true); 45 | default: 46 | throw new NotImplementedException( 47 | string.Format("Command with name {0} is not implemented", name) 48 | ); 49 | } 50 | } 51 | 52 | private void NwLookupCommand() 53 | { 54 | // Force loading of the Interop.ComApi assembly so that it will be included when 55 | // the 'Types' call is made in reflection utils 56 | GC.KeepAlive(typeof(ComApi.InwBase)); 57 | Document document = Autodesk.Navisworks.Api.Application.ActiveDocument; 58 | Data data; 59 | if (document.CurrentSelection.SelectedItems.IsEmpty) 60 | data = DataFactory.Create(document); 61 | else 62 | data = DataFactory.Create(document.CurrentSelection.SelectedItems); 63 | data.Snoop(new CustomCollector()); 64 | } 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /NwLookup.v18/NwLookup.v18.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | {B0C56007-B6E4-4A89-8E61-D37D2AFE8BE0} 6 | Library 7 | Properties 8 | NwLookup.v18 9 | NwLookup.v18 10 | v4.5.2 11 | 512 12 | true 13 | 2018 14 | 15 | 16 | true 17 | bin\x64\Debug\ 18 | DEBUG;TRACE 19 | full 20 | x64 21 | prompt 22 | MinimumRecommendedRules.ruleset 23 | 7.3 24 | 25 | 26 | bin\x64\Release\ 27 | TRACE 28 | true 29 | pdbonly 30 | x64 31 | prompt 32 | MinimumRecommendedRules.ruleset 33 | 7.3 34 | 35 | 36 | 37 | False 38 | lib\Autodesk.Navisworks.Api.dll 39 | False 40 | 41 | 42 | False 43 | lib\Autodesk.Navisworks.ComApi.dll 44 | False 45 | 46 | 47 | False 48 | False 49 | lib\Autodesk.Navisworks.Interop.ComApi.dll 50 | False 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | ..\packages\System.ValueTuple.4.5.0\lib\netstandard1.0\System.ValueTuple.dll 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | {875544e5-cd02-4e38-8e32-3016edf47027} 82 | NwLookup 83 | 84 | 85 | 86 | 87 | PreserveNewest 88 | 89 | 90 | 91 | 92 | MSBuild:Compile 93 | Designer 94 | PreserveNewest 95 | 96 | 97 | 98 | 99 | PreserveNewest 100 | 101 | 102 | PreserveNewest 103 | 104 | 105 | 106 | 107 | 108 | -------------------------------------------------------------------------------- /NwLookup.v18/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("NwLookup.v18")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("AMCC")] 12 | [assembly: AssemblyProduct("NwLookup.v18")] 13 | [assembly: AssemblyCopyright("Copyright © 2019")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("B1782B9E-6BB4-47E4-81E5-003C37B2399B")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /NwLookup.v18/Snoop/Collectors/CustomCollector.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | 3 | using NwLookup.Snoop.Collectors; 4 | 5 | namespace NwLookup.v18.Snoop.Collectors 6 | { 7 | public class CustomCollector : Collector 8 | { 9 | public CustomCollector() 10 | : base(new List{ 11 | new DefaultStreamPass(), 12 | new ModelItemStreamPass() 13 | }) { } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /NwLookup.v18/Snoop/Collectors/ModelItemStreamPass.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | 3 | using NwLookup.Snoop.Datas; 4 | using NwLookup.Snoop.Collectors; 5 | 6 | using Autodesk.Navisworks.Api; 7 | 8 | using ComApi = Autodesk.Navisworks.Api.Interop.ComApi; 9 | using ComBridge = Autodesk.Navisworks.Api.ComApi.ComApiBridge; 10 | 11 | namespace NwLookup.v18.Snoop.Collectors 12 | { 13 | public class ModelItemStreamPass : StreamPassBase 14 | { 15 | public override bool CanRun(object obj) 16 | => obj is ModelItem; 17 | 18 | public override void Stream(IList datas, object obj) 19 | { 20 | ComApi.InwOaPath path = ComBridge.ToInwOaPath((ModelItem)obj); 21 | StreamInternal(datas, path); 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /NwLookup.v18/en-US/NwLookupDefinitions.txt: -------------------------------------------------------------------------------- 1 | # Local names for ribbon tab, panel, and controls 2 | $utf8 3 | 4 | ID_NWLOOKUP_TAB.DisplayName=NwLookup 5 | 6 | NWLOOKUP_SNOOP_COMMAND.DisplayName=Snoop 7 | -------------------------------------------------------------------------------- /NwLookup.v18/en-US/NwLookupLayout.xaml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | 9 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /NwLookup.v18/lib/Autodesk.Navisworks.Api.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/awmcc90/NwLookup/680444523de9964dc8534e39f0f8d05b58b7ccd2/NwLookup.v18/lib/Autodesk.Navisworks.Api.dll -------------------------------------------------------------------------------- /NwLookup.v18/lib/Autodesk.Navisworks.ComApi.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/awmcc90/NwLookup/680444523de9964dc8534e39f0f8d05b58b7ccd2/NwLookup.v18/lib/Autodesk.Navisworks.ComApi.dll -------------------------------------------------------------------------------- /NwLookup.v18/lib/Autodesk.Navisworks.Interop.ComApi.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/awmcc90/NwLookup/680444523de9964dc8534e39f0f8d05b58b7ccd2/NwLookup.v18/lib/Autodesk.Navisworks.Interop.ComApi.dll -------------------------------------------------------------------------------- /NwLookup.v18/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | -------------------------------------------------------------------------------- /NwLookup.v18/resources/mg_16x16.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/awmcc90/NwLookup/680444523de9964dc8534e39f0f8d05b58b7ccd2/NwLookup.v18/resources/mg_16x16.ico -------------------------------------------------------------------------------- /NwLookup.v18/resources/mg_32x32.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/awmcc90/NwLookup/680444523de9964dc8534e39f0f8d05b58b7ccd2/NwLookup.v18/resources/mg_32x32.ico -------------------------------------------------------------------------------- /NwLookup.v19/Application.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | using Autodesk.Navisworks.Api; 4 | using Autodesk.Navisworks.Api.Plugins; 5 | 6 | using NwLookup.Snoop.Datas; 7 | using NwLookup.v19.Snoop.Collectors; 8 | 9 | using ComApi = Autodesk.Navisworks.Api.Interop.ComApi; 10 | 11 | namespace NwLookup.v19 12 | { 13 | [Plugin("NwLookup.v19.Application", "AMCC", DisplayName = "Snoop")] 14 | [Strings("NwLookupDefinitions.txt")] 15 | [RibbonLayout("NwLookupLayout.xaml")] 16 | [RibbonTab("ID_NWLOOKUP_TAB")] 17 | [Command("NWLOOKUP_SNOOP_COMMAND", 18 | Icon = "resources\\mg_16x16.ico", 19 | LargeIcon = "resources\\mg_32x32.ico", 20 | CallCanExecute = CallCanExecute.Always, 21 | CanToggle = true, 22 | LoadForCanExecute = true)] 23 | public class Application : CommandHandlerPlugin 24 | { 25 | public override int ExecuteCommand(string name, params string[] parameters) 26 | { 27 | switch (name) 28 | { 29 | case "NWLOOKUP_SNOOP_COMMAND": 30 | NwLookupCommand(); 31 | break; 32 | 33 | default: 34 | break; 35 | } 36 | 37 | return 0; 38 | } 39 | 40 | public override CommandState CanExecuteCommand(string name) 41 | { 42 | switch (name) 43 | { 44 | case "NWLOOKUP_SNOOP_COMMAND": 45 | return new CommandState(true); 46 | 47 | default: 48 | throw new NotImplementedException( 49 | string.Format("Command with name {0} is not implemented", name) 50 | ); 51 | } 52 | } 53 | 54 | private void NwLookupCommand() 55 | { 56 | // Force loading of the Interop.ComApi assembly so that it will be included when 57 | // the 'Types' call is made in reflection utils 58 | GC.KeepAlive(typeof(ComApi.InwBase)); 59 | Document document = Autodesk.Navisworks.Api.Application.ActiveDocument; 60 | Data data; 61 | if (document.CurrentSelection.SelectedItems.IsEmpty) 62 | data = DataFactory.Create(document); 63 | else 64 | data = DataFactory.Create(document.CurrentSelection.SelectedItems); 65 | data.Snoop(new CustomCollector()); 66 | } 67 | } 68 | } -------------------------------------------------------------------------------- /NwLookup.v19/NwLookup.v19.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | {1EB9F9F4-C4FE-455F-BA41-950901E38D08} 6 | Library 7 | Properties 8 | NwLookup.v19 9 | NwLookup.v19 10 | v4.6 11 | 512 12 | true 13 | 2019 14 | 15 | 16 | 17 | true 18 | bin\x64\Debug\ 19 | DEBUG;TRACE 20 | full 21 | x64 22 | prompt 23 | MinimumRecommendedRules.ruleset 24 | 7.3 25 | 26 | 27 | bin\x64\Release\ 28 | TRACE 29 | true 30 | pdbonly 31 | x64 32 | prompt 33 | MinimumRecommendedRules.ruleset 34 | 7.3 35 | 36 | 37 | 38 | lib\Autodesk.Navisworks.Api.dll 39 | False 40 | 41 | 42 | lib\Autodesk.Navisworks.ComApi.dll 43 | False 44 | 45 | 46 | lib\Autodesk.Navisworks.Interop.ComApi.dll 47 | True 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | ..\packages\System.ValueTuple.4.5.0\lib\netstandard1.0\System.ValueTuple.dll 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | {1d20bc34-0d74-48d4-8f93-ccf080f50e17} 76 | NwLookup 77 | 78 | 79 | 80 | 81 | PreserveNewest 82 | 83 | 84 | 85 | 86 | MSBuild:Compile 87 | Designer 88 | PreserveNewest 89 | 90 | 91 | 92 | 93 | PreserveNewest 94 | 95 | 96 | PreserveNewest 97 | 98 | 99 | 100 | 101 | 102 | -------------------------------------------------------------------------------- /NwLookup.v19/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("NwLookup.v19")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("AMCC")] 12 | [assembly: AssemblyProduct("NwLookup.v19")] 13 | [assembly: AssemblyCopyright("Copyright © 2020")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("7173bb97-d5fb-43e8-b347-6d9c5f204877")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("2019.0.0.0")] 36 | [assembly: AssemblyFileVersion("2019.0.0.0")] -------------------------------------------------------------------------------- /NwLookup.v19/Snoop/Collectors/CustomCollector.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | 3 | using NwLookup.Snoop.Collectors; 4 | 5 | namespace NwLookup.v19.Snoop.Collectors 6 | { 7 | public class CustomCollector : Collector 8 | { 9 | public CustomCollector() 10 | : base(new List{ 11 | new DefaultStreamPass(), 12 | new ModelItemStreamPass() 13 | }) 14 | { } 15 | } 16 | } -------------------------------------------------------------------------------- /NwLookup.v19/Snoop/Collectors/ModelItemStreamPass.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | 3 | using NwLookup.Snoop.Datas; 4 | using NwLookup.Snoop.Collectors; 5 | 6 | using Autodesk.Navisworks.Api; 7 | 8 | using ComApi = Autodesk.Navisworks.Api.Interop.ComApi; 9 | using ComBridge = Autodesk.Navisworks.Api.ComApi.ComApiBridge; 10 | 11 | namespace NwLookup.v19.Snoop.Collectors 12 | { 13 | public class ModelItemStreamPass : StreamPassBase 14 | { 15 | public override bool CanRun(object obj) 16 | => obj is ModelItem; 17 | 18 | public override void Stream(IList datas, object obj) 19 | { 20 | ComApi.InwOaPath path = ComBridge.ToInwOaPath((ModelItem)obj); 21 | StreamInternal(datas, path); 22 | } 23 | } 24 | } -------------------------------------------------------------------------------- /NwLookup.v19/en-US/NwLookupDefinitions.txt: -------------------------------------------------------------------------------- 1 | # Local names for ribbon tab, panel, and controls 2 | $utf8 3 | 4 | ID_NWLOOKUP_TAB.DisplayName=NwLookup 5 | 6 | NWLOOKUP_SNOOP_COMMAND.DisplayName=Snoop 7 | -------------------------------------------------------------------------------- /NwLookup.v19/en-US/NwLookupLayout.xaml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | 9 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /NwLookup.v19/lib/Autodesk.Navisworks.Api.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/awmcc90/NwLookup/680444523de9964dc8534e39f0f8d05b58b7ccd2/NwLookup.v19/lib/Autodesk.Navisworks.Api.dll -------------------------------------------------------------------------------- /NwLookup.v19/lib/Autodesk.Navisworks.ComApi.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/awmcc90/NwLookup/680444523de9964dc8534e39f0f8d05b58b7ccd2/NwLookup.v19/lib/Autodesk.Navisworks.ComApi.dll -------------------------------------------------------------------------------- /NwLookup.v19/lib/Autodesk.Navisworks.Interop.ComApi.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/awmcc90/NwLookup/680444523de9964dc8534e39f0f8d05b58b7ccd2/NwLookup.v19/lib/Autodesk.Navisworks.Interop.ComApi.dll -------------------------------------------------------------------------------- /NwLookup.v19/resources/mg_16x16.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/awmcc90/NwLookup/680444523de9964dc8534e39f0f8d05b58b7ccd2/NwLookup.v19/resources/mg_16x16.ico -------------------------------------------------------------------------------- /NwLookup.v19/resources/mg_32x32.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/awmcc90/NwLookup/680444523de9964dc8534e39f0f8d05b58b7ccd2/NwLookup.v19/resources/mg_32x32.ico -------------------------------------------------------------------------------- /NwLookup.v20/Application.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | using Autodesk.Navisworks.Api; 4 | using Autodesk.Navisworks.Api.Plugins; 5 | 6 | using NwLookup.Snoop.Datas; 7 | using NwLookup.v20.Snoop.Collectors; 8 | 9 | using ComApi = Autodesk.Navisworks.Api.Interop.ComApi; 10 | 11 | namespace NwLookup.v20 12 | { 13 | [Plugin("NwLookup.v20.Application", "AMCC", DisplayName = "Snoop")] 14 | [Strings("NwLookupDefinitions.txt")] 15 | [RibbonLayout("NwLookupLayout.xaml")] 16 | [RibbonTab("ID_NWLOOKUP_TAB")] 17 | [Command("NWLOOKUP_SNOOP_COMMAND", 18 | Icon = "resources\\mg_16x16.ico", 19 | LargeIcon = "resources\\mg_32x32.ico", 20 | CallCanExecute = CallCanExecute.Always, 21 | CanToggle = true, 22 | LoadForCanExecute = true)] 23 | public class Application : CommandHandlerPlugin 24 | { 25 | public override int ExecuteCommand(string name, params string[] parameters) 26 | { 27 | switch (name) 28 | { 29 | case "NWLOOKUP_SNOOP_COMMAND": 30 | NwLookupCommand(); 31 | break; 32 | 33 | default: 34 | break; 35 | } 36 | 37 | return 0; 38 | } 39 | 40 | public override CommandState CanExecuteCommand(string name) 41 | { 42 | switch (name) 43 | { 44 | case "NWLOOKUP_SNOOP_COMMAND": 45 | return new CommandState(true); 46 | 47 | default: 48 | throw new NotImplementedException( 49 | string.Format("Command with name {0} is not implemented", name) 50 | ); 51 | } 52 | } 53 | 54 | private void NwLookupCommand() 55 | { 56 | // Force loading of the Interop.ComApi assembly so that it will be included when 57 | // the 'Types' call is made in reflection utils 58 | GC.KeepAlive(typeof(ComApi.InwBase)); 59 | Document document = Autodesk.Navisworks.Api.Application.ActiveDocument; 60 | Data data; 61 | if (document.CurrentSelection.SelectedItems.IsEmpty) 62 | data = DataFactory.Create(document); 63 | else 64 | data = DataFactory.Create(document.CurrentSelection.SelectedItems); 65 | data.Snoop(new CustomCollector()); 66 | } 67 | } 68 | } -------------------------------------------------------------------------------- /NwLookup.v20/NwLookup.v20.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | {D3DB9547-E3D2-443F-84F9-798E3C92FC7F} 6 | Library 7 | Properties 8 | NwLookup.v20 9 | NwLookup.v20 10 | v4.7 11 | 512 12 | true 13 | 2020 14 | 15 | 16 | 17 | true 18 | bin\x64\Debug\ 19 | DEBUG;TRACE 20 | full 21 | x64 22 | prompt 23 | MinimumRecommendedRules.ruleset 24 | 7.3 25 | 26 | 27 | bin\x64\Release\ 28 | TRACE 29 | true 30 | pdbonly 31 | x64 32 | prompt 33 | MinimumRecommendedRules.ruleset 34 | 7.3 35 | 36 | 37 | 38 | lib\Autodesk.Navisworks.Api.dll 39 | False 40 | 41 | 42 | lib\Autodesk.Navisworks.ComApi.dll 43 | False 44 | 45 | 46 | lib\Autodesk.Navisworks.Interop.ComApi.dll 47 | True 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | ..\packages\System.ValueTuple.4.5.0\lib\netstandard1.0\System.ValueTuple.dll 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | {578afb41-2213-4b76-bd63-7ccfae1e0b06} 76 | NwLookup 77 | 78 | 79 | 80 | 81 | PreserveNewest 82 | 83 | 84 | 85 | 86 | MSBuild:Compile 87 | Designer 88 | PreserveNewest 89 | 90 | 91 | 92 | 93 | PreserveNewest 94 | 95 | 96 | PreserveNewest 97 | 98 | 99 | 100 | 101 | 102 | -------------------------------------------------------------------------------- /NwLookup.v20/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("NwLookup.v20")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("AMCC")] 12 | [assembly: AssemblyProduct("NwLookup.v20")] 13 | [assembly: AssemblyCopyright("Copyright © 2020")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("b71f6701-2f78-4864-904c-ca81db613287")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("2020.0.0.0")] 36 | [assembly: AssemblyFileVersion("2020.0.0.0")] -------------------------------------------------------------------------------- /NwLookup.v20/Snoop/Collectors/CustomCollector.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | 3 | using NwLookup.Snoop.Collectors; 4 | 5 | namespace NwLookup.v20.Snoop.Collectors 6 | { 7 | public class CustomCollector : Collector 8 | { 9 | public CustomCollector() 10 | : base(new List{ 11 | new DefaultStreamPass(), 12 | new ModelItemStreamPass() 13 | }) 14 | { } 15 | } 16 | } -------------------------------------------------------------------------------- /NwLookup.v20/Snoop/Collectors/ModelItemStreamPass.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | 3 | using NwLookup.Snoop.Datas; 4 | using NwLookup.Snoop.Collectors; 5 | 6 | using Autodesk.Navisworks.Api; 7 | 8 | using ComApi = Autodesk.Navisworks.Api.Interop.ComApi; 9 | using ComBridge = Autodesk.Navisworks.Api.ComApi.ComApiBridge; 10 | 11 | namespace NwLookup.v20.Snoop.Collectors 12 | { 13 | public class ModelItemStreamPass : StreamPassBase 14 | { 15 | public override bool CanRun(object obj) 16 | => obj is ModelItem; 17 | 18 | public override void Stream(IList datas, object obj) 19 | { 20 | ComApi.InwOaPath path = ComBridge.ToInwOaPath((ModelItem)obj); 21 | StreamInternal(datas, path); 22 | } 23 | } 24 | } -------------------------------------------------------------------------------- /NwLookup.v20/en-US/NwLookupDefinitions.txt: -------------------------------------------------------------------------------- 1 | # Local names for ribbon tab, panel, and controls 2 | $utf8 3 | 4 | ID_NWLOOKUP_TAB.DisplayName=NwLookup 5 | 6 | NWLOOKUP_SNOOP_COMMAND.DisplayName=Snoop 7 | -------------------------------------------------------------------------------- /NwLookup.v20/en-US/NwLookupLayout.xaml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | 9 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /NwLookup.v20/lib/Autodesk.Navisworks.Api.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/awmcc90/NwLookup/680444523de9964dc8534e39f0f8d05b58b7ccd2/NwLookup.v20/lib/Autodesk.Navisworks.Api.dll -------------------------------------------------------------------------------- /NwLookup.v20/lib/Autodesk.Navisworks.ComApi.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/awmcc90/NwLookup/680444523de9964dc8534e39f0f8d05b58b7ccd2/NwLookup.v20/lib/Autodesk.Navisworks.ComApi.dll -------------------------------------------------------------------------------- /NwLookup.v20/lib/Autodesk.Navisworks.Interop.ComApi.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/awmcc90/NwLookup/680444523de9964dc8534e39f0f8d05b58b7ccd2/NwLookup.v20/lib/Autodesk.Navisworks.Interop.ComApi.dll -------------------------------------------------------------------------------- /NwLookup.v20/resources/mg_16x16.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/awmcc90/NwLookup/680444523de9964dc8534e39f0f8d05b58b7ccd2/NwLookup.v20/resources/mg_16x16.ico -------------------------------------------------------------------------------- /NwLookup.v20/resources/mg_32x32.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/awmcc90/NwLookup/680444523de9964dc8534e39f0f8d05b58b7ccd2/NwLookup.v20/resources/mg_32x32.ico -------------------------------------------------------------------------------- /NwLookup.v21/Application.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | using Autodesk.Navisworks.Api; 4 | using Autodesk.Navisworks.Api.Plugins; 5 | 6 | using NwLookup.Snoop.Datas; 7 | using NwLookup.v21.Snoop.Collectors; 8 | 9 | using ComApi = Autodesk.Navisworks.Api.Interop.ComApi; 10 | 11 | namespace NwLookup.v21 12 | { 13 | [Plugin("NwLookup.v21.Application", "AMCC", DisplayName = "Snoop")] 14 | [Strings("NwLookupDefinitions.txt")] 15 | [RibbonLayout("NwLookupLayout.xaml")] 16 | [RibbonTab("ID_NWLOOKUP_TAB")] 17 | [Command("NWLOOKUP_SNOOP_COMMAND", 18 | Icon = "resources\\mg_16x16.ico", 19 | LargeIcon = "resources\\mg_32x32.ico", 20 | CallCanExecute = CallCanExecute.Always, 21 | CanToggle = true, 22 | LoadForCanExecute = true)] 23 | public class Application : CommandHandlerPlugin 24 | { 25 | public override int ExecuteCommand(string name, params string[] parameters) 26 | { 27 | switch (name) 28 | { 29 | case "NWLOOKUP_SNOOP_COMMAND": 30 | NwLookupCommand(); 31 | break; 32 | default: 33 | break; 34 | } 35 | 36 | return 0; 37 | } 38 | 39 | public override CommandState CanExecuteCommand(string name) 40 | { 41 | switch (name) 42 | { 43 | case "NWLOOKUP_SNOOP_COMMAND": 44 | return new CommandState(true); 45 | default: 46 | throw new NotImplementedException( 47 | string.Format("Command with name {0} is not implemented", name) 48 | ); 49 | } 50 | } 51 | 52 | private void NwLookupCommand() 53 | { 54 | // Force loading of the Interop.ComApi assembly so that it will be included when 55 | // the 'Types' call is made in reflection utils 56 | GC.KeepAlive(typeof(ComApi.InwBase)); 57 | Document document = Autodesk.Navisworks.Api.Application.ActiveDocument; 58 | Data data; 59 | if (document.CurrentSelection.SelectedItems.IsEmpty) 60 | data = DataFactory.Create(document); 61 | else 62 | data = DataFactory.Create(document.CurrentSelection.SelectedItems); 63 | data.Snoop(new CustomCollector()); 64 | } 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /NwLookup.v21/NwLookup.v21.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | {944F3E88-538E-4797-B8D5-42204F60042A} 6 | Library 7 | Properties 8 | NwLookup.v21 9 | NwLookup.v21 10 | v4.8 11 | 512 12 | true 13 | 2021 14 | 15 | 16 | true 17 | bin\x64\Debug\ 18 | DEBUG;TRACE 19 | full 20 | x64 21 | prompt 22 | MinimumRecommendedRules.ruleset 23 | 7.3 24 | 25 | 26 | bin\x64\Release\ 27 | TRACE 28 | true 29 | pdbonly 30 | x64 31 | prompt 32 | MinimumRecommendedRules.ruleset 33 | 7.3 34 | 35 | 36 | 37 | lib\Autodesk.Navisworks.Api.dll 38 | False 39 | 40 | 41 | lib\Autodesk.Navisworks.ComApi.dll 42 | False 43 | False 44 | 45 | 46 | lib\Autodesk.Navisworks.Interop.ComApi.dll 47 | False 48 | False 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | ..\packages\System.ValueTuple.4.5.0\lib\netstandard1.0\System.ValueTuple.dll 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | {875544e5-cd02-4e38-8e32-3016edf47027} 77 | NwLookup 78 | 79 | 80 | 81 | 82 | PreserveNewest 83 | 84 | 85 | 86 | 87 | MSBuild:Compile 88 | Designer 89 | PreserveNewest 90 | 91 | 92 | 93 | 94 | PreserveNewest 95 | 96 | 97 | PreserveNewest 98 | 99 | 100 | 101 | 102 | 103 | -------------------------------------------------------------------------------- /NwLookup.v21/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("NwLookup.v21")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("AMCC")] 12 | [assembly: AssemblyProduct("NwLookup.v21")] 13 | [assembly: AssemblyCopyright("Copyright © 2020")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("05D23269-0506-406C-A534-42BC67FDF148")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("2021.0.0.0")] 36 | [assembly: AssemblyFileVersion("2021.0.0.0")] 37 | -------------------------------------------------------------------------------- /NwLookup.v21/Snoop/Collectors/CustomCollector.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | 3 | using NwLookup.Snoop.Collectors; 4 | 5 | namespace NwLookup.v21.Snoop.Collectors 6 | { 7 | public class CustomCollector : Collector 8 | { 9 | public CustomCollector() 10 | : base(new List{ 11 | new DefaultStreamPass(), 12 | new ModelItemStreamPass() 13 | }) { } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /NwLookup.v21/Snoop/Collectors/ModelItemStreamPass.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | 3 | using NwLookup.Snoop.Datas; 4 | using NwLookup.Snoop.Collectors; 5 | 6 | using Autodesk.Navisworks.Api; 7 | 8 | using ComApi = Autodesk.Navisworks.Api.Interop.ComApi; 9 | using ComBridge = Autodesk.Navisworks.Api.ComApi.ComApiBridge; 10 | 11 | namespace NwLookup.v21.Snoop.Collectors 12 | { 13 | public class ModelItemStreamPass : StreamPassBase 14 | { 15 | public override bool CanRun(object obj) 16 | => obj is ModelItem; 17 | 18 | public override void Stream(IList datas, object obj) 19 | { 20 | ComApi.InwOaPath path = ComBridge.ToInwOaPath((ModelItem)obj); 21 | StreamInternal(datas, path); 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /NwLookup.v21/en-US/NwLookupDefinitions.txt: -------------------------------------------------------------------------------- 1 | # Local names for ribbon tab, panel, and controls 2 | $utf8 3 | 4 | ID_NWLOOKUP_TAB.DisplayName=NwLookup 5 | 6 | NWLOOKUP_SNOOP_COMMAND.DisplayName=Snoop 7 | -------------------------------------------------------------------------------- /NwLookup.v21/en-US/NwLookupLayout.xaml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | 9 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /NwLookup.v21/lib/Autodesk.Navisworks.Api.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/awmcc90/NwLookup/680444523de9964dc8534e39f0f8d05b58b7ccd2/NwLookup.v21/lib/Autodesk.Navisworks.Api.dll -------------------------------------------------------------------------------- /NwLookup.v21/lib/Autodesk.Navisworks.ComApi.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/awmcc90/NwLookup/680444523de9964dc8534e39f0f8d05b58b7ccd2/NwLookup.v21/lib/Autodesk.Navisworks.ComApi.dll -------------------------------------------------------------------------------- /NwLookup.v21/lib/Autodesk.Navisworks.Interop.ComApi.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/awmcc90/NwLookup/680444523de9964dc8534e39f0f8d05b58b7ccd2/NwLookup.v21/lib/Autodesk.Navisworks.Interop.ComApi.dll -------------------------------------------------------------------------------- /NwLookup.v21/resources/mg_16x16.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/awmcc90/NwLookup/680444523de9964dc8534e39f0f8d05b58b7ccd2/NwLookup.v21/resources/mg_16x16.ico -------------------------------------------------------------------------------- /NwLookup.v21/resources/mg_32x32.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/awmcc90/NwLookup/680444523de9964dc8534e39f0f8d05b58b7ccd2/NwLookup.v21/resources/mg_32x32.ico -------------------------------------------------------------------------------- /NwLookup/NwLookup.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | Debug 6 | AnyCPU 7 | {875544E5-CD02-4E38-8E32-3016EDF47027} 8 | library 9 | NwLookup 10 | NwLookup 11 | v4.5.2 12 | 512 13 | {60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} 14 | 4 15 | true 16 | 17 | 18 | 19 | true 20 | bin\x64\Debug\ 21 | DEBUG;TRACE 22 | full 23 | x64 24 | 7.3 25 | prompt 26 | MinimumRecommendedRules.ruleset 27 | 28 | 29 | bin\x64\Release\ 30 | TRACE 31 | true 32 | pdbonly 33 | x64 34 | prompt 35 | MinimumRecommendedRules.ruleset 36 | 37 | 38 | 39 | 40 | 41 | 42 | False 43 | ..\packages\System.ValueTuple.4.5.0\lib\portable-net40+sl4+win8+wp8\System.ValueTuple.dll 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 4.0 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | SnoopWindow.xaml 81 | 82 | 83 | 84 | Code 85 | 86 | 87 | True 88 | True 89 | Resources.resx 90 | 91 | 92 | True 93 | Settings.settings 94 | True 95 | 96 | 97 | 98 | TypesWindow.xaml 99 | 100 | 101 | ResXFileCodeGenerator 102 | Resources.Designer.cs 103 | 104 | 105 | SettingsSingleFileGenerator 106 | Settings.Designer.cs 107 | 108 | 109 | 110 | 111 | Designer 112 | MSBuild:Compile 113 | 114 | 115 | Designer 116 | MSBuild:Compile 117 | 118 | 119 | 120 | 121 | 122 | -------------------------------------------------------------------------------- /NwLookup/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Resources; 3 | using System.Runtime.CompilerServices; 4 | using System.Runtime.InteropServices; 5 | using System.Windows; 6 | 7 | // General Information about an assembly is controlled through the following 8 | // set of attributes. Change these attribute values to modify the information 9 | // associated with an assembly. 10 | [assembly: AssemblyTitle("NwLookup")] 11 | [assembly: AssemblyDescription("")] 12 | [assembly: AssemblyConfiguration("")] 13 | [assembly: AssemblyCompany("")] 14 | [assembly: AssemblyProduct("NwLookup")] 15 | [assembly: AssemblyCopyright("Copyright © 2019")] 16 | [assembly: AssemblyTrademark("")] 17 | [assembly: AssemblyCulture("")] 18 | 19 | // Setting ComVisible to false makes the types in this assembly not visible 20 | // to COM components. If you need to access a type in this assembly from 21 | // COM, set the ComVisible attribute to true on that type. 22 | [assembly: ComVisible(false)] 23 | 24 | //In order to begin building localizable applications, set 25 | //CultureYouAreCodingWith in your .csproj file 26 | //inside a . For example, if you are using US english 27 | //in your source files, set the to en-US. Then uncomment 28 | //the NeutralResourceLanguage attribute below. Update the "en-US" in 29 | //the line below to match the UICulture setting in the project file. 30 | 31 | //[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)] 32 | 33 | 34 | [assembly:ThemeInfo( 35 | ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located 36 | //(used if a resource is not found in the page, 37 | // or application resource dictionaries) 38 | ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located 39 | //(used if a resource is not found in the page, 40 | // app, or any theme specific resource dictionaries) 41 | )] 42 | 43 | 44 | // Version information for an assembly consists of the following four values: 45 | // 46 | // Major Version 47 | // Minor Version 48 | // Build Number 49 | // Revision 50 | // 51 | // You can specify all the values or you can default the Build and Revision Numbers 52 | // by using the '*' as shown below: 53 | // [assembly: AssemblyVersion("1.0.*")] 54 | [assembly: AssemblyVersion("1.0.0.0")] 55 | [assembly: AssemblyFileVersion("1.0.0.0")] 56 | -------------------------------------------------------------------------------- /NwLookup/Properties/Resources.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.42000 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace NwLookup.Properties { 12 | using System; 13 | 14 | 15 | /// 16 | /// A strongly-typed resource class, for looking up localized strings, etc. 17 | /// 18 | // This class was auto-generated by the StronglyTypedResourceBuilder 19 | // class via a tool like ResGen or Visual Studio. 20 | // To add or remove a member, edit your .ResX file then rerun ResGen 21 | // with the /str option, or rebuild your VS project. 22 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "15.0.0.0")] 23 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 24 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 25 | internal class Resources { 26 | 27 | private static global::System.Resources.ResourceManager resourceMan; 28 | 29 | private static global::System.Globalization.CultureInfo resourceCulture; 30 | 31 | [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] 32 | internal Resources() { 33 | } 34 | 35 | /// 36 | /// Returns the cached ResourceManager instance used by this class. 37 | /// 38 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 39 | internal static global::System.Resources.ResourceManager ResourceManager { 40 | get { 41 | if (object.ReferenceEquals(resourceMan, null)) { 42 | global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("NwLookup.Properties.Resources", typeof(Resources).Assembly); 43 | resourceMan = temp; 44 | } 45 | return resourceMan; 46 | } 47 | } 48 | 49 | /// 50 | /// Overrides the current thread's CurrentUICulture property for all 51 | /// resource lookups using this strongly typed resource class. 52 | /// 53 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 54 | internal static global::System.Globalization.CultureInfo Culture { 55 | get { 56 | return resourceCulture; 57 | } 58 | set { 59 | resourceCulture = value; 60 | } 61 | } 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /NwLookup/Properties/Resources.resx: -------------------------------------------------------------------------------- 1 |  2 | 3 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | text/microsoft-resx 107 | 108 | 109 | 2.0 110 | 111 | 112 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 113 | 114 | 115 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 116 | 117 | -------------------------------------------------------------------------------- /NwLookup/Properties/Settings.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.42000 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace NwLookup.Properties { 12 | 13 | 14 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 15 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "15.9.0.0")] 16 | internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { 17 | 18 | private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); 19 | 20 | public static Settings Default { 21 | get { 22 | return defaultInstance; 23 | } 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /NwLookup/Properties/Settings.settings: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /NwLookup/Snoop/Collectors/Collector.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | 4 | using NwLookup.Snoop.Datas; 5 | 6 | namespace NwLookup.Snoop.Collectors 7 | { 8 | public class Collector : ICollector 9 | { 10 | private IList Passes { get; } 11 | 12 | public Collector(IList passes) 13 | => Passes = passes; 14 | 15 | public Collector() 16 | : this(new List()) { } 17 | 18 | public void AddPass(IStreamPass pass) 19 | => Passes.Add(pass); 20 | 21 | public void Stream(IList datas, object obj) 22 | { 23 | foreach (IStreamPass pass in Passes) 24 | if (pass.CanRun(obj)) 25 | pass.Stream(datas, obj); 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /NwLookup/Snoop/Collectors/DefaultStreamPass.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | 3 | using NwLookup.Snoop.Datas; 4 | 5 | namespace NwLookup.Snoop.Collectors 6 | { 7 | public class DefaultStreamPass : StreamPassBase 8 | { 9 | public override bool CanRun(object obj) 10 | => true; 11 | 12 | public override void Stream(IList datas, object obj) 13 | => StreamInternal(datas, obj); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /NwLookup/Snoop/Collectors/ICollector.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | 3 | using NwLookup.Snoop.Datas; 4 | 5 | namespace NwLookup.Snoop.Collectors 6 | { 7 | public interface ICollector 8 | { 9 | void Stream(IList datas, object obj); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /NwLookup/Snoop/Collectors/IMemberStream.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | 4 | namespace NwLookup.Snoop.Collectors 5 | { 6 | public interface IMemberStream 7 | { 8 | void Stream(IList types); 9 | void Stream(Type type); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /NwLookup/Snoop/Collectors/IStreamPass.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | 4 | using NwLookup.Snoop.Datas; 5 | 6 | namespace NwLookup.Snoop.Collectors 7 | { 8 | public interface IStreamPass 9 | { 10 | bool CanRun(object obj); 11 | void Stream(IList datas, object obj); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /NwLookup/Snoop/Collectors/MemberStream.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | 4 | using NwLookup.Snoop.Datas; 5 | 6 | namespace NwLookup.Snoop.Collectors 7 | { 8 | public abstract class MemberStream : IMemberStream 9 | { 10 | protected IList Datas { get; } 11 | protected object Object { get; } 12 | 13 | public MemberStream(IList datas, object obj) 14 | => (Datas, Object) = (datas, obj); 15 | 16 | public void Stream(IList types) 17 | { 18 | foreach (Type type in types) 19 | Stream(type); 20 | } 21 | 22 | public abstract void Stream(Type type); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /NwLookup/Snoop/Collectors/MethodStream.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Reflection; 3 | using System.Collections.Generic; 4 | using System.Runtime.ExceptionServices; 5 | 6 | using NwLookup.Snoop.Datas; 7 | 8 | namespace NwLookup.Snoop.Collectors 9 | { 10 | public class MethodStream : MemberStream 11 | { 12 | public MethodStream(IList datas, object obj) 13 | : base(datas, obj) { } 14 | 15 | [HandleProcessCorruptedStateExceptions] 16 | public override void Stream(Type type) 17 | { 18 | var infos = ReflectionUtils.GetMethodInfo(type); 19 | foreach (MethodInfo info in infos) 20 | { 21 | try 22 | { 23 | //object value = info.Invoke(Object, null); 24 | //Datas.Add(DataFactory.Create(info, info.ReturnType, value)); 25 | Datas.Add(DataFactory.Create(info, Object)); 26 | } 27 | catch (Exception) 28 | { } 29 | } 30 | } 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /NwLookup/Snoop/Collectors/PropertyStream.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Reflection; 3 | using System.Collections.Generic; 4 | using System.Runtime.ExceptionServices; 5 | 6 | using NwLookup.Snoop.Datas; 7 | 8 | namespace NwLookup.Snoop.Collectors 9 | { 10 | public class PropertyStream : MemberStream 11 | { 12 | public PropertyStream(IList datas, object obj) 13 | : base(datas, obj) { } 14 | 15 | [HandleProcessCorruptedStateExceptions] 16 | public override void Stream(Type type) 17 | { 18 | var infos = ReflectionUtils.GetPropertyInfo(type); 19 | foreach (PropertyInfo info in infos) 20 | { 21 | try 22 | { 23 | object value = info.GetValue(Object); 24 | Datas.Add(DataFactory.Create(info, info.PropertyType, value)); 25 | } 26 | catch (Exception) 27 | { } 28 | } 29 | } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /NwLookup/Snoop/Collectors/ReflectionUtils.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.IO; 3 | using System.Linq; 4 | using System.Reflection; 5 | using System.Collections.Generic; 6 | using System.Runtime.InteropServices; 7 | 8 | namespace NwLookup.Snoop.Collectors 9 | { 10 | public static class ReflectionUtils 11 | { 12 | private static Type[] _types = null; 13 | public static Type[] Types 14 | { 15 | get 16 | { 17 | if (_types == null) 18 | { 19 | var baseDirectory = Path.GetDirectoryName(AppDomain.CurrentDomain.BaseDirectory); 20 | _types = AppDomain.CurrentDomain.GetAssemblies() 21 | .Where(x => !x.IsDynamic && !string.IsNullOrWhiteSpace(x.Location)) 22 | .Where(x => Path.GetDirectoryName(x.Location) == baseDirectory) 23 | .Where(x => x.GetName().Name.ToLower().Contains("navisworks")) 24 | .SelectMany(x => x.GetTypes()) 25 | .ToArray(); 26 | } 27 | return _types; 28 | } 29 | } 30 | 31 | public static bool IsValidType(Type type, Type objType) 32 | => objType.IsSubclassOf(type) || objType == type || type.IsAssignableFrom(objType); 33 | 34 | public static IList GetTypes(object obj) 35 | { 36 | if (Marshal.IsComObject(obj)) 37 | { 38 | string comObjectType = Microsoft.VisualBasic.Information.TypeName(obj); 39 | return Types.Where(x => x.Name == comObjectType).ToArray(); 40 | } 41 | else 42 | return Types.Where(x => IsValidType(x, obj.GetType())).ToArray(); 43 | } 44 | 45 | public static bool IsPrimitive(Type type) 46 | => type.IsPrimitive || type.IsValueType || type == typeof(string); 47 | 48 | private static BindingFlags ALLOWED_FLAGS 49 | => BindingFlags.Instance | BindingFlags.Public | BindingFlags.DeclaredOnly; 50 | 51 | public static PropertyInfo[] GetPropertyInfo(Type type) 52 | => type 53 | .GetProperties(ALLOWED_FLAGS) 54 | .Where(x => x.GetMethod != null) 55 | .OrderBy(x => x.Name) 56 | .ToArray(); 57 | 58 | private static bool IsValidMethod(MethodInfo info) 59 | => !(info.IsSpecialName || info.DeclaringType == null || info.GetParameters().Any() || info.ReturnType == typeof(void)); 60 | 61 | public static MethodInfo[] GetMethodInfo(Type type) 62 | => type 63 | .GetMethods(ALLOWED_FLAGS) 64 | .Where(x => IsValidMethod(x)) 65 | .OrderBy(x => x.Name) 66 | .ToArray(); 67 | } 68 | } 69 | -------------------------------------------------------------------------------- /NwLookup/Snoop/Collectors/StreamPassBase.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | 4 | using NwLookup.Snoop.Datas; 5 | 6 | namespace NwLookup.Snoop.Collectors 7 | { 8 | public abstract class StreamPassBase : IStreamPass 9 | { 10 | public abstract bool CanRun(object obj); 11 | 12 | public abstract void Stream(IList datas, object obj); 13 | 14 | protected void StreamInternal(IList datas, object obj) 15 | { 16 | IList types = ReflectionUtils.GetTypes(obj); 17 | 18 | if (types.Count == 0) 19 | return; 20 | 21 | IMemberStream[] streams = new IMemberStream[] 22 | { 23 | new PropertyStream(datas, obj), 24 | new MethodStream(datas, obj) 25 | }; 26 | foreach (IMemberStream stream in streams) 27 | stream.Stream(types); 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /NwLookup/Snoop/Datas/Data.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | using NwLookup.Snoop.Collectors; 4 | using NwLookup.Snoop.Views; 5 | 6 | namespace NwLookup.Snoop.Datas 7 | { 8 | public abstract class Data 9 | { 10 | public string Label { get; } 11 | 12 | public object Value { get; } 13 | 14 | public Data(string label, object value) 15 | => (Label, Value) = (label, value); 16 | 17 | public virtual Type Type 18 | => Value?.GetType(); 19 | 20 | public virtual string ValueString 21 | => Value == null ? "null" : Value.ToString(); 22 | 23 | public virtual bool CanSnoop 24 | => Value != null; 25 | 26 | public override string ToString() 27 | => string.Format("{0}: {1}", Label, ValueString); 28 | 29 | public virtual void Snoop(ICollector collector) 30 | { 31 | if (CanSnoop) 32 | { 33 | SnoopWindow window = new SnoopWindow(collector, this); 34 | window.ShowDialog(); 35 | } 36 | } 37 | 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /NwLookup/Snoop/Datas/DataArray.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections; 3 | using System.Collections.Generic; 4 | 5 | namespace NwLookup.Snoop.Datas 6 | { 7 | public class DataArray : Data 8 | { 9 | public List Array { get; } = new List(); 10 | 11 | public Type InnerType 12 | => CanSnoop ? Array[0].GetType() : null; 13 | 14 | public int Length 15 | => Array.Count; 16 | 17 | public DataArray(string label, IEnumerable value) 18 | : base(label, value) 19 | { 20 | IEnumerator iter = value.GetEnumerator(); 21 | while (iter.MoveNext()) 22 | Array.Add(iter.Current); 23 | } 24 | 25 | public override string ValueString 26 | => string.Format("{0}[{1}]", InnerType, Length); 27 | 28 | public override bool CanSnoop 29 | => base.CanSnoop && Length > 0; 30 | 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /NwLookup/Snoop/Datas/DataFactory.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections; 3 | using System.Reflection; 4 | 5 | using NwLookup.Snoop.Collectors; 6 | 7 | namespace NwLookup.Snoop.Datas 8 | { 9 | public static class DataFactory 10 | { 11 | public static Data Create(object obj) 12 | { 13 | if (obj != null) 14 | { 15 | Type type = obj.GetType(); 16 | if (ReflectionUtils.IsPrimitive(type)) 17 | return new PrimitiveData(obj.ToString(), obj); 18 | // The expected type could be 'object' in the case of the com interface objects 19 | // in which case we also need to check the actual type of the return value 20 | // for the pressence of an array 21 | else if (typeof(IEnumerable).IsAssignableFrom(type) || type.IsArray) 22 | return new DataArray(obj.ToString(), obj as IEnumerable); 23 | else 24 | return new DefaultData(obj.ToString(), obj); 25 | } 26 | return new DefaultData("null", obj); 27 | } 28 | 29 | public static Data Create(MemberInfo info, Type expectedType, object returnValue) 30 | { 31 | // Strings are technically char arrays so we should check this first befor 32 | // moving on to checking if the expected type or the returned object type 33 | // is an array. This is purely a quality of life adjustment 34 | if (ReflectionUtils.IsPrimitive(expectedType)) 35 | return new PrimitiveData(info.Name, returnValue); 36 | // The expected type could be 'object' in the case of the com interface objects 37 | // in which case we also need to check the actual type of the return value 38 | // for the pressence of an array 39 | else if (typeof(IEnumerable).IsAssignableFrom(expectedType) 40 | || (returnValue != null && returnValue.GetType().IsArray)) 41 | return new DataArray(info.Name, returnValue as IEnumerable); 42 | else 43 | return new DefaultData(info.Name, returnValue); 44 | } 45 | 46 | public static Data Create(MethodInfo info, object target) 47 | => new MethodData(info, target); 48 | 49 | public static Data Create(MemberInfo info, Type expectedType, Exception e) 50 | => new ExceptionData(info.Name, e); 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /NwLookup/Snoop/Datas/DefaultData.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace NwLookup.Snoop.Datas 4 | { 5 | public class DefaultData : Data 6 | { 7 | public DefaultData(string label, object obj) 8 | : base(label, obj) { } 9 | 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /NwLookup/Snoop/Datas/ExceptionData.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace NwLookup.Snoop.Datas 4 | { 5 | public class ExceptionData : Data 6 | { 7 | public ExceptionData(string label, Exception e) 8 | : base(label, e) { } 9 | 10 | public override string ValueString 11 | => "Exception"; 12 | 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /NwLookup/Snoop/Datas/MethodData.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Reflection; 3 | 4 | using NwLookup.Snoop.Collectors; 5 | using NwLookup.Snoop.Views; 6 | 7 | namespace NwLookup.Snoop.Datas 8 | { 9 | public class MethodData : Data 10 | { 11 | private MethodInfo Info { get; } 12 | 13 | public MethodData(MethodInfo info, object target) 14 | : base(info.Name, target) => (Info) = info; 15 | 16 | public override Type Type 17 | => Info.ReturnType; 18 | 19 | public override string ValueString 20 | => string.Format("{0}", Type); 21 | 22 | public override string ToString() 23 | => string.Format("{0}: {1}", Info.Name, ValueString); 24 | 25 | private object Invoke() 26 | { 27 | try 28 | { 29 | return Info.Invoke(Value, null); 30 | } 31 | catch (Exception) 32 | { 33 | return null; 34 | } 35 | } 36 | 37 | public override void Snoop(ICollector collector) 38 | { 39 | if (CanSnoop) 40 | { 41 | object value = Invoke(); 42 | if (value != null) 43 | { 44 | Data data = DataFactory.Create(Info, Info.ReturnType, value); 45 | SnoopWindow window = new SnoopWindow(collector, data); 46 | window.ShowDialog(); 47 | } 48 | } 49 | } 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /NwLookup/Snoop/Datas/PrimitiveData.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace NwLookup.Snoop.Datas 4 | { 5 | public class PrimitiveData : Data 6 | { 7 | public PrimitiveData(string label, object type) 8 | : base(label, type) { } 9 | 10 | public override bool CanSnoop 11 | => false; 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /NwLookup/Snoop/Views/Controls/AutoSizedGridView.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Windows.Controls; 3 | 4 | namespace NwLookup.Snoop.Views.Controls 5 | { 6 | public class AutoSizedGridView : GridView 7 | { 8 | /* AutoSizedGridView class created from resources found at: 9 | * https://stackoverflow.com/a/15745082/7015777 */ 10 | protected override void PrepareItem(ListViewItem item) 11 | { 12 | foreach (GridViewColumn column in Columns) 13 | { 14 | // Setting NaN for the column width automatically determines the required 15 | // width enough to hold the content completely. 16 | 17 | // If the width is NaN, first set it to ActualWidth temporarily. 18 | if (double.IsNaN(column.Width)) 19 | column.Width = column.ActualWidth; 20 | 21 | // Finally, set the column with to NaN. This raises the property change 22 | // event and re computes the width. 23 | column.Width = double.NaN; 24 | } 25 | base.PrepareItem(item); 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /NwLookup/Snoop/Views/Models/NotifyViewModelBase.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.ComponentModel; 3 | using System.Runtime.CompilerServices; 4 | 5 | namespace NwLookup.Snoop.Views.Models 6 | { 7 | public abstract class NotifyViewModelBase : INotifyPropertyChanged 8 | { 9 | public event PropertyChangedEventHandler PropertyChanged; 10 | protected void OnPropertyChanged([CallerMemberName] string propertyName="") 11 | { 12 | PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName)); 13 | } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /NwLookup/Snoop/Views/Models/RelayCommand.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Windows.Input; 3 | 4 | namespace NwLookup.Snoop.Views.Models 5 | { 6 | public class RelayCommand : ICommand 7 | { 8 | #region Fields 9 | 10 | readonly Action _execute = null; 11 | readonly Predicate _canExecute = null; 12 | 13 | #endregion 14 | 15 | #region Constructors 16 | 17 | /// 18 | /// Initializes a new instance of . 19 | /// 20 | /// Delegate to execute when Execute is called on the command. This can be null to just hook up a CanExecute delegate. 21 | /// will always return true. 22 | public RelayCommand(Action execute) 23 | : this(execute, null) { } 24 | 25 | /// 26 | /// Creates a new command. 27 | /// 28 | /// The execution logic. 29 | /// The execution status logic. 30 | public RelayCommand(Action execute, Predicate canExecute) 31 | { 32 | _execute = execute ?? throw new ArgumentNullException("execute"); 33 | _canExecute = canExecute; 34 | } 35 | 36 | #endregion 37 | 38 | #region ICommand Members 39 | 40 | /// 41 | ///Defines the method that determines whether the command can execute in its current state. 42 | /// 43 | ///Data used by the command. If the command does not require data to be passed, this object can be set to null. 44 | /// 45 | ///true if this command can be executed; otherwise, false. 46 | /// 47 | public bool CanExecute(object parameter) 48 | { 49 | return _canExecute == null ? true : _canExecute((T)parameter); 50 | } 51 | 52 | /// 53 | ///Occurs when changes occur that affect whether or not the command should execute. 54 | /// 55 | public event EventHandler CanExecuteChanged 56 | { 57 | add { CommandManager.RequerySuggested += value; } 58 | remove { CommandManager.RequerySuggested -= value; } 59 | } 60 | 61 | /// 62 | ///Defines the method to be called when the command is invoked. 63 | /// 64 | ///Data used by the command. If the command does not require data to be passed, this object can be set to . 65 | public void Execute(object parameter) 66 | { 67 | _execute((T)parameter); 68 | } 69 | 70 | #endregion 71 | } 72 | } 73 | -------------------------------------------------------------------------------- /NwLookup/Snoop/Views/SnoopViewModel.cs: -------------------------------------------------------------------------------- 1 | using System.Windows.Input; 2 | using System.Threading.Tasks; 3 | using System.Collections.ObjectModel; 4 | 5 | using NwLookup.Snoop.Datas; 6 | using NwLookup.Snoop.Collectors; 7 | using NwLookup.Snoop.Views.Models; 8 | 9 | namespace NwLookup.Snoop.Views 10 | { 11 | public class SnoopViewModel : NotifyViewModelBase 12 | { 13 | private ObservableCollection _objects = null; 14 | public ObservableCollection Objects 15 | { 16 | get { return _objects; } 17 | set 18 | { 19 | if (_objects != value) 20 | { 21 | _objects = value; 22 | OnPropertyChanged(); 23 | if (_objects != null && _objects.Count > 0) 24 | SelectedObject = _objects[0]; 25 | } 26 | } 27 | } 28 | 29 | private object _selectedObject = null; 30 | public object SelectedObject 31 | { 32 | get { return _selectedObject; } 33 | set 34 | { 35 | if (_selectedObject != value) 36 | { 37 | _selectedObject = value; 38 | OnPropertyChanged(); 39 | Snoop(_selectedObject); 40 | } 41 | } 42 | } 43 | 44 | public ObservableCollection Datas { get; } = new ObservableCollection(); 45 | 46 | private Data _selectedData = null; 47 | public Data SelectedData 48 | { 49 | get { return _selectedData; } 50 | set 51 | { 52 | if (_selectedData != value) 53 | { 54 | _selectedData = value; 55 | OnPropertyChanged(); 56 | _selectedData.Snoop(Collector); 57 | } 58 | } 59 | } 60 | 61 | private ICommand _typesCommand = null; 62 | public ICommand TypesCommand 63 | { 64 | get 65 | { 66 | if (_typesCommand == null) 67 | { 68 | _typesCommand = new RelayCommand( 69 | (window) => 70 | { 71 | TypesWindow typesWindow = new TypesWindow(); 72 | typesWindow.ShowDialog(); 73 | } 74 | ); 75 | } 76 | return _closeCommand; 77 | } 78 | } 79 | 80 | private ICommand _closeCommand = null; 81 | public ICommand CloseCommand 82 | { 83 | get 84 | { 85 | if (_closeCommand == null) 86 | { 87 | _closeCommand = new RelayCommand( 88 | (window) => { window.Close(); } 89 | ); 90 | } 91 | return _closeCommand; 92 | } 93 | } 94 | 95 | private ICollector Collector { get; } 96 | 97 | public SnoopViewModel(ICollector collector, Data data) 98 | { 99 | Collector = collector; 100 | if (data is DataArray) 101 | Objects = new ObservableCollection(((DataArray)data).Array); 102 | else 103 | Objects = new ObservableCollection() { data.Value }; 104 | } 105 | 106 | private void Snoop(object obj) 107 | { 108 | Datas.Clear(); 109 | Task.Factory.StartNew(() => 110 | { 111 | Collector.Stream(Datas, obj); 112 | }, System.Threading.CancellationToken.None, TaskCreationOptions.None, TaskScheduler.FromCurrentSynchronizationContext()); 113 | } 114 | } 115 | } 116 | -------------------------------------------------------------------------------- /NwLookup/Snoop/Views/SnoopWindow.xaml: -------------------------------------------------------------------------------- 1 |  10 | 11 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 42 | 43 | 44 | 46 | 47 | 48 | 50 | 51 | 58 | 59 | 60 | 61 | 62 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | -------------------------------------------------------------------------------- /NwLookup/Snoop/Views/SnoopWindow.xaml.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Windows; 3 | using System.Windows.Interop; 4 | using System.Runtime.InteropServices; 5 | 6 | using NwLookup.Snoop.Collectors; 7 | using NwLookup.Snoop.Datas; 8 | 9 | namespace NwLookup.Snoop.Views 10 | { 11 | public partial class SnoopWindow : Window 12 | { 13 | public SnoopWindow(ICollector collector, Data data) 14 | { 15 | InitializeComponent(); 16 | SourceInitialized += ExportWindow_SourceInitialized; 17 | DataContext = new SnoopViewModel(collector, data); 18 | } 19 | 20 | private void Types_Click(object sender, RoutedEventArgs e) 21 | { 22 | TypesWindow window = new TypesWindow(); 23 | window.ShowDialog(); 24 | } 25 | 26 | private void Exit_Click(object sender, RoutedEventArgs e) 27 | { 28 | Close(); 29 | } 30 | 31 | [DllImport("user32.dll")] 32 | private static extern int GetWindowLong(IntPtr hWnd, int nIndex); 33 | [DllImport("user32.dll")] 34 | private static extern int SetWindowLong(IntPtr hWnd, int nIndex, int dwNewLong); 35 | 36 | private const int GWL_STYLE = -16; 37 | private const int WS_MAXIMIZEBOX = 0x10000; 38 | private const int WS_MINIMIZEBOX = 0x20000; 39 | 40 | private void ExportWindow_SourceInitialized(object sender, EventArgs e) 41 | { 42 | var hwnd = new WindowInteropHelper((Window)sender).Handle; 43 | var value = GetWindowLong(hwnd, GWL_STYLE); 44 | SetWindowLong(hwnd, GWL_STYLE, (int)((int)(value & ~WS_MAXIMIZEBOX) & ~WS_MINIMIZEBOX)); 45 | } 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /NwLookup/Snoop/Views/TypesViewModel.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Linq; 3 | using System.Threading; 4 | using System.Threading.Tasks; 5 | using System.Collections.Generic; 6 | using System.Collections.ObjectModel; 7 | 8 | using NwLookup.Snoop.Collectors; 9 | using NwLookup.Snoop.Views.Models; 10 | 11 | namespace NwLookup.Snoop.Views 12 | { 13 | public class TypesViewModel : NotifyViewModelBase 14 | { 15 | private string _search; 16 | public string Search 17 | { 18 | get { return _search; } 19 | set 20 | { 21 | _search = value; 22 | OnPropertyChanged(); 23 | GetResults(_search); 24 | } 25 | } 26 | 27 | private List _orderedTypes { get; } 28 | public ObservableCollection Types { get; } 29 | 30 | public TypesViewModel() 31 | { 32 | _orderedTypes = ReflectionUtils.Types.OrderBy(x => x.ToString()).ToList(); 33 | Types = new ObservableCollection(_orderedTypes); 34 | } 35 | 36 | private void GetResults(string search) 37 | { 38 | Types.Clear(); 39 | Task.Factory.StartNew(() => 40 | { 41 | return _orderedTypes.Where(x => x.ToString().StartsWith(search)); 42 | }).ContinueWith(task => 43 | { 44 | //add the results to the source collection 45 | foreach (Type type in task.Result) 46 | Types.Add(type); 47 | }, CancellationToken.None, TaskContinuationOptions.None, TaskScheduler.FromCurrentSynchronizationContext()); 48 | } 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /NwLookup/Snoop/Views/TypesWindow.xaml: -------------------------------------------------------------------------------- 1 |  9 | 10 | 11 | 12 | 13 | 14 | 15 | 17 | 18 | 19 | 21 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /NwLookup/Snoop/Views/TypesWindow.xaml.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Windows; 3 | 4 | namespace NwLookup.Snoop.Views 5 | { 6 | public partial class TypesWindow : Window 7 | { 8 | public TypesWindow() 9 | { 10 | InitializeComponent(); 11 | DataContext = new TypesViewModel(); 12 | } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /NwLookup_Setup/Assets/Banner.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/awmcc90/NwLookup/680444523de9964dc8534e39f0f8d05b58b7ccd2/NwLookup_Setup/Assets/Banner.bmp -------------------------------------------------------------------------------- /NwLookup_Setup/Assets/Licence.md: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2020 awmcc90 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /NwLookup_Setup/Assets/Licence.rtf: -------------------------------------------------------------------------------- 1 | {\rtf1\ansi\deff0\nouicompat{\fonttbl{\f0\fnil\fcharset0 Courier New;}} 2 | {\*\generator Riched20 10.0.18362}\viewkind4\uc1 3 | \pard\f0\fs22\lang6153 MIT License\par 4 | \par 5 | Copyright (c) 2020 awmcc90\par 6 | \par 7 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\par 8 | \par 9 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\par 10 | \par 11 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\par 12 | \par 13 | } 14 | -------------------------------------------------------------------------------- /NwLookup_Setup/Assets/Main.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/awmcc90/NwLookup/680444523de9964dc8534e39f0f8d05b58b7ccd2/NwLookup_Setup/Assets/Main.bmp -------------------------------------------------------------------------------- /NwLookup_Setup/Assets/icon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/awmcc90/NwLookup/680444523de9964dc8534e39f0f8d05b58b7ccd2/NwLookup_Setup/Assets/icon.ico -------------------------------------------------------------------------------- /NwLookup_Setup/Common.wxl: -------------------------------------------------------------------------------- 1 | 2 | 3 | Navisworks Lookup 4 | 5 | 1033 6 | 7 | Navisworks Lookup Plugin 8 | Navisworks,Lookup,plugin,addin 9 | Comments 10 | 11 | A newer version of this plugin is already installed. 12 | -------------------------------------------------------------------------------- /NwLookup_Setup/Directories.wxs: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | -------------------------------------------------------------------------------- /NwLookup_Setup/Files.wxs: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | -------------------------------------------------------------------------------- /NwLookup_Setup/NwLookup.msi: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/awmcc90/NwLookup/680444523de9964dc8534e39f0f8d05b58b7ccd2/NwLookup_Setup/NwLookup.msi -------------------------------------------------------------------------------- /NwLookup_Setup/NwLookup_Setup.wixproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Debug 5 | x86 6 | 3.10 7 | 0cea8009-a942-43b4-8e1d-22610289f902 8 | 2.0 9 | NwLookup 10 | Package 11 | 12 | 13 | bin\$(Configuration)\ 14 | obj\$(Configuration)\ 15 | Debug 16 | 17 | 18 | bin\$(Configuration)\ 19 | obj\$(Configuration)\ 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | $(WixExtDir)\WixUIExtension.dll 29 | WixUIExtension 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | NwLookup.v17 38 | {5d2d6a6b-3bef-40e9-b151-09b346800648} 39 | True 40 | True 41 | Binaries;Content;Satellites 42 | INSTALLFOLDER 43 | 44 | 45 | NwLookup.v18 46 | {b0c56007-b6e4-4a89-8e61-d37d2afe8be0} 47 | True 48 | True 49 | Binaries;Content;Satellites 50 | INSTALLFOLDER 51 | 52 | 53 | NwLookup.v19 54 | {1eb9f9f4-c4fe-455f-ba41-950901e38d08} 55 | True 56 | True 57 | Binaries;Content;Satellites 58 | INSTALLFOLDER 59 | 60 | 61 | NwLookup.v20 62 | {d3db9547-e3d2-443f-84f9-798e3c92fc7f} 63 | True 64 | True 65 | Binaries;Content;Satellites 66 | INSTALLFOLDER 67 | 68 | 69 | NwLookup.v21 70 | {944f3e88-538e-4797-b8d5-42204f60042a} 71 | True 72 | True 73 | Binaries;Content;Satellites 74 | INSTALLFOLDER 75 | 76 | 77 | NwLookup 78 | {875544e5-cd02-4e38-8e32-3016edf47027} 79 | True 80 | True 81 | Binaries;Content;Satellites 82 | INSTALLFOLDER 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 98 | -------------------------------------------------------------------------------- /NwLookup_Setup/Product.wxs: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 16 | 17 | 18 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | icon.ico 33 | https://github.com/awmcc90/NwLookup 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | -------------------------------------------------------------------------------- /PackageContents.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # NwLookup 2 | A Navisworks object inspector similar to AppInfo published in the Navisworks SDK but with easy extensibility and included COM Interop inspection for ModelItems. This project is very similar and loosely based on the Revit Lookup project which provides similar functionality but for the Revit family of software. 3 | 4 | As an added benefit NwLookup provides a baseline structure for how to create an addin for the Navisworks family of software. Multiple versions of the addin targeting different versions of Navisworks are included and wrapped together in a bundle package which serves as one source for all the addin requirements. 5 | 6 | It is my preference to keep this project both as lightweight and flexible as possible. All the common components including base inspection streams, collectors, views, and data objects are under the NwLookup base project. All subsequent target versions (NwLookup.v*) will incorporate this project which should reduce the number of changes required when updating. 7 | 8 | # Build 9 | Build requires Visual Studio to be run as administrator given the build events attempt to create directories under the ProgramData folder ($(ProgramData)\Autodesk\ApplicationPlugins\NwLookup.bundle\). 10 | 11 | Additionlly, the projects .csproj have been manually modified to include build events which apply to all projects. A custom macro `TargetYear` has been created for each project and is used in the build events to create the correct directories for each plugin version. 12 | 13 | All specific versions need to include the following at the end: 14 | ``` 15 | 16 | ... 17 | 18 | 19 | 20 | ``` 21 | This, in conjunction with updating the `TargetYear`, will ensure that everything works as expected when building. 22 | 23 | Note: This (and all other addins under ApplicationPlugins) will not run unless the package ends in ".bundle". Case DOES matter; ".Bundle" or any variation will not work. 24 | 25 | Note: Target version of Navisworks can be found by right clicking on the Autodesk.Navisworks.Api.dll selecting Properties -> Details and looking at the Product Version. All versions follow the form (YEAR - 3), so 2018 is Nw15, 2017 is Nw14 and so on. This is incredibly confusing. 26 | 27 | # Usage 28 | There are some important usage notes to keep in mind when using this project. 29 | 1. Certain methods are available for invocation as part of the baseline information gathering on objects. These methods are not invoked UNLESS you click on them to inspect. It is up to you to ensure that no unwanted document changes are made when selecting a method to invoke. 30 | 2. All instance property information is included in the base inspection and is invoked prior to viewing as to be easily available. 31 | 3. If no model items are selected then the ActiveDocument will be the inspection target. This allows you to also inspect the ActiveDocument.State which could very easily let you damage or change the active document. If you are unsure about what you are doing when inspecting objects (specifically invoking methods) then I would recommend researching the topic first or if nothing else creating a copy of the document and inspecting that instead. 32 | 33 | # StreamPass 34 | Stream passes are high level passes that you want the collector to perform for certain objects. `StreamPassBase` should always be extended when creating a new Stream Pass as it provides the base methods for reflecting and acquiring method and property information. 35 | 36 | An example of an extension `IStreamPass` can be seen in the `ModelItemStreamPass` class located in each version of NwLookup.v*. This pass checks to see if the target object is a `ModelItem` and if it is then it converts it to `ComApi.InwOaPath` and performs inspection on that object as well. 37 | 38 | -------------------------------------------------------------------------------- /Tools/Build.events: -------------------------------------------------------------------------------- 1 | 2 | 3 | rd /s /q "$(ProgramData)\Autodesk\ApplicationPlugins\NwLookup.bundle\Contents\$(TargetYear)\" 4 | xcopy "$(TargetDir)*.*" "$(ProgramData)\Autodesk\ApplicationPlugins\NwLookup.bundle\Contents\$(TargetYear)\" /Y /I /E /EXCLUDE:$(SolutionDir)exclude.txt 5 | copy "$(SolutionDir)PackageContents.xml" "$(ProgramData)\Autodesk\ApplicationPlugins\NwLookup.bundle\" /Y 6 | 7 | -------------------------------------------------------------------------------- /Tools/ExtraCleanup.targets: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /exclude.txt: -------------------------------------------------------------------------------- 1 | .pdb 2 | System.ValueTuple.xml --------------------------------------------------------------------------------