Skip to content

Commit

Permalink
Merge pull request awmcc90#3 from Coolicky/master
Browse files Browse the repository at this point in the history
Added Manage 2020 & 2019 Versions
  • Loading branch information
awmcc90 authored Jan 27, 2021
2 parents 0be044c + 118355e commit 6804445
Show file tree
Hide file tree
Showing 38 changed files with 956 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ $RECYCLE.BIN/

# Windows Installer files
*.cab
*.msi
# *.msi
*.msm
*.msp

Expand Down
39 changes: 37 additions & 2 deletions NwLookup.sln
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
VisualStudioVersion = 15.0.28307.168
# Visual Studio Version 16
VisualStudioVersion = 16.0.30907.101
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NwLookup.v18", "NwLookup.v18\NwLookup.v18.csproj", "{B0C56007-B6E4-4A89-8E61-D37D2AFE8BE0}"
EndProject
Expand All @@ -16,28 +16,63 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NwLookup.v17", "NwLookup.v1
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NwLookup.v21", "NwLookup.v21\NwLookup.v21.csproj", "{944F3E88-538E-4797-B8D5-42204F60042A}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NwLookup.v19", "NwLookup.v19\NwLookup.v19.csproj", "{1EB9F9F4-C4FE-455F-BA41-950901E38D08}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NwLookup.v20", "NwLookup.v20\NwLookup.v20.csproj", "{D3DB9547-E3D2-443F-84F9-798E3C92FC7F}"
EndProject
Project("{930C7802-8A8C-48F9-8165-68863BCCD9DD}") = "NwLookup_Setup", "NwLookup_Setup\NwLookup_Setup.wixproj", "{0CEA8009-A942-43B4-8E1D-22610289F902}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|x64 = Debug|x64
Debug|x86 = Debug|x86
Release|x64 = Release|x64
Release|x86 = Release|x86
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{B0C56007-B6E4-4A89-8E61-D37D2AFE8BE0}.Debug|x64.ActiveCfg = Debug|x64
{B0C56007-B6E4-4A89-8E61-D37D2AFE8BE0}.Debug|x64.Build.0 = Debug|x64
{B0C56007-B6E4-4A89-8E61-D37D2AFE8BE0}.Debug|x86.ActiveCfg = Debug|x64
{B0C56007-B6E4-4A89-8E61-D37D2AFE8BE0}.Release|x64.ActiveCfg = Release|x64
{B0C56007-B6E4-4A89-8E61-D37D2AFE8BE0}.Release|x64.Build.0 = Release|x64
{B0C56007-B6E4-4A89-8E61-D37D2AFE8BE0}.Release|x86.ActiveCfg = Release|x64
{875544E5-CD02-4E38-8E32-3016EDF47027}.Debug|x64.ActiveCfg = Debug|x64
{875544E5-CD02-4E38-8E32-3016EDF47027}.Debug|x64.Build.0 = Debug|x64
{875544E5-CD02-4E38-8E32-3016EDF47027}.Debug|x86.ActiveCfg = Debug|x64
{875544E5-CD02-4E38-8E32-3016EDF47027}.Release|x64.ActiveCfg = Release|x64
{875544E5-CD02-4E38-8E32-3016EDF47027}.Release|x64.Build.0 = Release|x64
{875544E5-CD02-4E38-8E32-3016EDF47027}.Release|x86.ActiveCfg = Release|x64
{5D2D6A6B-3BEF-40E9-B151-09B346800648}.Debug|x64.ActiveCfg = Debug|x64
{5D2D6A6B-3BEF-40E9-B151-09B346800648}.Debug|x64.Build.0 = Debug|x64
{5D2D6A6B-3BEF-40E9-B151-09B346800648}.Debug|x86.ActiveCfg = Debug|x64
{5D2D6A6B-3BEF-40E9-B151-09B346800648}.Release|x64.ActiveCfg = Release|x64
{5D2D6A6B-3BEF-40E9-B151-09B346800648}.Release|x64.Build.0 = Release|x64
{5D2D6A6B-3BEF-40E9-B151-09B346800648}.Release|x86.ActiveCfg = Release|x64
{944F3E88-538E-4797-B8D5-42204F60042A}.Debug|x64.ActiveCfg = Debug|x64
{944F3E88-538E-4797-B8D5-42204F60042A}.Debug|x64.Build.0 = Debug|x64
{944F3E88-538E-4797-B8D5-42204F60042A}.Debug|x86.ActiveCfg = Debug|x64
{944F3E88-538E-4797-B8D5-42204F60042A}.Release|x64.ActiveCfg = Release|x64
{944F3E88-538E-4797-B8D5-42204F60042A}.Release|x64.Build.0 = Release|x64
{944F3E88-538E-4797-B8D5-42204F60042A}.Release|x86.ActiveCfg = Release|x64
{1EB9F9F4-C4FE-455F-BA41-950901E38D08}.Debug|x64.ActiveCfg = Debug|x64
{1EB9F9F4-C4FE-455F-BA41-950901E38D08}.Debug|x64.Build.0 = Debug|x64
{1EB9F9F4-C4FE-455F-BA41-950901E38D08}.Debug|x86.ActiveCfg = Debug|x64
{1EB9F9F4-C4FE-455F-BA41-950901E38D08}.Release|x64.ActiveCfg = Release|x64
{1EB9F9F4-C4FE-455F-BA41-950901E38D08}.Release|x64.Build.0 = Release|x64
{1EB9F9F4-C4FE-455F-BA41-950901E38D08}.Release|x86.ActiveCfg = Release|x64
{D3DB9547-E3D2-443F-84F9-798E3C92FC7F}.Debug|x64.ActiveCfg = Debug|x64
{D3DB9547-E3D2-443F-84F9-798E3C92FC7F}.Debug|x64.Build.0 = Debug|x64
{D3DB9547-E3D2-443F-84F9-798E3C92FC7F}.Debug|x86.ActiveCfg = Debug|x64
{D3DB9547-E3D2-443F-84F9-798E3C92FC7F}.Release|x64.ActiveCfg = Release|x64
{D3DB9547-E3D2-443F-84F9-798E3C92FC7F}.Release|x64.Build.0 = Release|x64
{D3DB9547-E3D2-443F-84F9-798E3C92FC7F}.Release|x86.ActiveCfg = Release|x64
{0CEA8009-A942-43B4-8E1D-22610289F902}.Debug|x64.ActiveCfg = Debug|x86
{0CEA8009-A942-43B4-8E1D-22610289F902}.Debug|x86.ActiveCfg = Debug|x86
{0CEA8009-A942-43B4-8E1D-22610289F902}.Debug|x86.Build.0 = Debug|x86
{0CEA8009-A942-43B4-8E1D-22610289F902}.Release|x64.ActiveCfg = Release|x86
{0CEA8009-A942-43B4-8E1D-22610289F902}.Release|x64.Build.0 = Release|x86
{0CEA8009-A942-43B4-8E1D-22610289F902}.Release|x86.ActiveCfg = Release|x86
{0CEA8009-A942-43B4-8E1D-22610289F902}.Release|x86.Build.0 = Release|x86
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
68 changes: 68 additions & 0 deletions NwLookup.v19/Application.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
using System;

using Autodesk.Navisworks.Api;
using Autodesk.Navisworks.Api.Plugins;

using NwLookup.Snoop.Datas;
using NwLookup.v19.Snoop.Collectors;

using ComApi = Autodesk.Navisworks.Api.Interop.ComApi;

namespace NwLookup.v19
{
[Plugin("NwLookup.v19.Application", "AMCC", DisplayName = "Snoop")]
[Strings("NwLookupDefinitions.txt")]
[RibbonLayout("NwLookupLayout.xaml")]
[RibbonTab("ID_NWLOOKUP_TAB")]
[Command("NWLOOKUP_SNOOP_COMMAND",
Icon = "resources\\mg_16x16.ico",
LargeIcon = "resources\\mg_32x32.ico",
CallCanExecute = CallCanExecute.Always,
CanToggle = true,
LoadForCanExecute = true)]
public class Application : CommandHandlerPlugin
{
public override int ExecuteCommand(string name, params string[] parameters)
{
switch (name)
{
case "NWLOOKUP_SNOOP_COMMAND":
NwLookupCommand();
break;

default:
break;
}

return 0;
}

public override CommandState CanExecuteCommand(string name)
{
switch (name)
{
case "NWLOOKUP_SNOOP_COMMAND":
return new CommandState(true);

default:
throw new NotImplementedException(
string.Format("Command with name {0} is not implemented", name)
);
}
}

private void NwLookupCommand()
{
// Force loading of the Interop.ComApi assembly so that it will be included when
// the 'Types' call is made in reflection utils
GC.KeepAlive(typeof(ComApi.InwBase));
Document document = Autodesk.Navisworks.Api.Application.ActiveDocument;
Data data;
if (document.CurrentSelection.SelectedItems.IsEmpty)
data = DataFactory.Create(document);
else
data = DataFactory.Create(document.CurrentSelection.SelectedItems);
data.Snoop(new CustomCollector());
}
}
}
102 changes: 102 additions & 0 deletions NwLookup.v19/NwLookup.v19.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<ProjectGuid>{1EB9F9F4-C4FE-455F-BA41-950901E38D08}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>NwLookup.v19</RootNamespace>
<AssemblyName>NwLookup.v19</AssemblyName>
<TargetFrameworkVersion>v4.6</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<Deterministic>true</Deterministic>
<TargetYear>2019</TargetYear>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\x64\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<DebugType>full</DebugType>
<PlatformTarget>x64</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
<LangVersion>7.3</LangVersion>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
<OutputPath>bin\x64\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<Optimize>true</Optimize>
<DebugType>pdbonly</DebugType>
<PlatformTarget>x64</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
<LangVersion>7.3</LangVersion>
</PropertyGroup>
<ItemGroup>
<Reference Include="Autodesk.Navisworks.Api">
<HintPath>lib\Autodesk.Navisworks.Api.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="Autodesk.Navisworks.ComApi">
<HintPath>lib\Autodesk.Navisworks.ComApi.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="Autodesk.Navisworks.Interop.ComApi">
<HintPath>lib\Autodesk.Navisworks.Interop.ComApi.dll</HintPath>
<EmbedInteropTypes>True</EmbedInteropTypes>
</Reference>
<Reference Include="Microsoft.VisualBasic" />
<Reference Include="PresentationCore" />
<Reference Include="PresentationFramework" />
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Drawing" />
<Reference Include="System.ValueTuple, Version=4.0.3.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\packages\System.ValueTuple.4.5.0\lib\netstandard1.0\System.ValueTuple.dll</HintPath>
</Reference>
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Xml" />
<Reference Include="WindowsBase" />
</ItemGroup>
<ItemGroup>
<Compile Include="Application.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Snoop\Collectors\CustomCollector.cs" />
<Compile Include="Snoop\Collectors\ModelItemStreamPass.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\NwLookup\NwLookup.csproj">
<Project>{1d20bc34-0d74-48d4-8f93-ccf080f50e17}</Project>
<Name>NwLookup</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<None Include="en-US\NwLookupDefinitions.txt">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
</ItemGroup>
<ItemGroup>
<None Include="en-US\NwLookupLayout.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
</ItemGroup>
<ItemGroup>
<None Include="resources\mg_16x16.ico">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="resources\mg_32x32.ico">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Import Project="$(SolutionDir)\Tools\ExtraCleanup.targets" />
<Import Project="$(SolutionDir)\Tools\Build.events" />
</Project>
36 changes: 36 additions & 0 deletions NwLookup.v19/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;

// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("NwLookup.v19")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("AMCC")]
[assembly: AssemblyProduct("NwLookup.v19")]
[assembly: AssemblyCopyright("Copyright © 2020")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]

// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("7173bb97-d5fb-43e8-b347-6d9c5f204877")]

// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("2019.0.0.0")]
[assembly: AssemblyFileVersion("2019.0.0.0")]
16 changes: 16 additions & 0 deletions NwLookup.v19/Snoop/Collectors/CustomCollector.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
using System.Collections.Generic;

using NwLookup.Snoop.Collectors;

namespace NwLookup.v19.Snoop.Collectors
{
public class CustomCollector : Collector
{
public CustomCollector()
: base(new List<IStreamPass>{
new DefaultStreamPass(),
new ModelItemStreamPass()
})
{ }
}
}
24 changes: 24 additions & 0 deletions NwLookup.v19/Snoop/Collectors/ModelItemStreamPass.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
using System.Collections.Generic;

using NwLookup.Snoop.Datas;
using NwLookup.Snoop.Collectors;

using Autodesk.Navisworks.Api;

using ComApi = Autodesk.Navisworks.Api.Interop.ComApi;
using ComBridge = Autodesk.Navisworks.Api.ComApi.ComApiBridge;

namespace NwLookup.v19.Snoop.Collectors
{
public class ModelItemStreamPass : StreamPassBase
{
public override bool CanRun(object obj)
=> obj is ModelItem;

public override void Stream(IList<Data> datas, object obj)
{
ComApi.InwOaPath path = ComBridge.ToInwOaPath((ModelItem)obj);
StreamInternal(datas, path);
}
}
}
6 changes: 6 additions & 0 deletions NwLookup.v19/en-US/NwLookupDefinitions.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Local names for ribbon tab, panel, and controls
$utf8

ID_NWLOOKUP_TAB.DisplayName=NwLookup

NWLOOKUP_SNOOP_COMMAND.DisplayName=Snoop
16 changes: 16 additions & 0 deletions NwLookup.v19/en-US/NwLookupLayout.xaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?xml version="1.0" encoding="utf-8"?>
<RibbonControl x:Uid="UID_NWLOOKUP_RIBBON_CONTROL"
xmlns="clr-namespace:Autodesk.Windows;assembly=AdWindows"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:nvw="clr-namespace:Autodesk.Navisworks.Gui.Roamer.AIRLook;assembly=navisworks.gui.roamer">
<RibbonTab Id="ID_NWLOOKUP_TAB" Title="NwLookup">
<RibbonPanel x:Uid="UID_SNOOP_PANEL">
<RibbonPanelSource x:Uid="UID_NWLOOKUP_TAB_SNOOP_PANEL_SOURCE" Title="Snoop">
<nvw:NWRibbonButton x:Uid="UID_NWLOOKUP_TAB_SNOOP_PANEL_SNOOP_BUTTON" Id="NWLOOKUP_SNOOP_COMMAND"
Size="Large"
ShowText="True"
Orientation = "Vertical"/>
</RibbonPanelSource>
</RibbonPanel>
</RibbonTab>
</RibbonControl>
Binary file added NwLookup.v19/lib/Autodesk.Navisworks.Api.dll
Binary file not shown.
Binary file added NwLookup.v19/lib/Autodesk.Navisworks.ComApi.dll
Binary file not shown.
Binary file not shown.
Binary file added NwLookup.v19/resources/mg_16x16.ico
Binary file not shown.
Binary file added NwLookup.v19/resources/mg_32x32.ico
Binary file not shown.
Loading

0 comments on commit 6804445

Please sign in to comment.