From c522c689bad5b6923a36beffb7b4edc102a4dbba Mon Sep 17 00:00:00 2001 From: Francisco Maranchello Date: Fri, 23 Sep 2022 17:36:30 -0300 Subject: [PATCH] Initial upload --- .github/workflows/dev_actions.yml | 68 +++++ .github/workflows/production_actions.yml | 88 ++++++ .github/workflows/staging_actions.yml | 84 ++++++ .gitignore | 264 ++++++++++++++++++ GitVersion.yml | 2 + LICENSE | 21 ++ README.md | 1 + .../Properties/AssemblyInfo.cs | 36 +++ .../SampleRevitAddin.2020.csproj | 83 ++++++ SampleRevitAddin.2020/app.config | 12 + SampleRevitAddin.2020/packages.config | 4 + .../Properties/AssemblyInfo.cs | 36 +++ .../SampleRevitAddin.2021.csproj | 84 ++++++ SampleRevitAddin.2021/app.config | 12 + SampleRevitAddin.2021/packages.config | 4 + .../Properties/AssemblyInfo.cs | 36 +++ .../SampleRevitAddin.2022.csproj | 84 ++++++ SampleRevitAddin.2022/app.config | 12 + SampleRevitAddin.2022/packages.config | 4 + .../Properties/AssemblyInfo.cs | 36 +++ .../SampleRevitAddin.2023.csproj | 84 ++++++ SampleRevitAddin.2023/app.config | 12 + SampleRevitAddin.2023/packages.config | 4 + SampleRevitAddin.Common/PackageContents.xml | 36 +++ .../SampleRevitAddin.Common.projitems | 23 ++ .../SampleRevitAddin.Common.shproj | 13 + .../SampleRevitAddin.addin | 17 ++ SampleRevitAddin.Common/SampleRevitPopup.cs | 26 ++ SampleRevitAddin.Common/Startup.cs | 75 +++++ SampleRevitAddin.Installer/InstallScript.iss | 62 ++++ .../Properties/AssemblyInfo.cs | 36 +++ .../SampleRevitAddin.Installer.csproj | 65 +++++ SampleRevitAddin.Installer/packages.config | 4 + .../Images/Icons/e-verselogo.png | Bin 0 -> 686 bytes .../Properties/AssemblyInfo.cs | 36 +++ .../ResourceAssembly.cs | 28 ++ SampleRevitAddin.Resources/ResourceImage.cs | 33 +++ .../SampleRevitAddin.Resources.csproj | 57 ++++ SampleRevitAddin.sln | 70 +++++ 39 files changed, 1652 insertions(+) create mode 100644 .github/workflows/dev_actions.yml create mode 100644 .github/workflows/production_actions.yml create mode 100644 .github/workflows/staging_actions.yml create mode 100644 .gitignore create mode 100644 GitVersion.yml create mode 100644 LICENSE create mode 100644 README.md create mode 100644 SampleRevitAddin.2020/Properties/AssemblyInfo.cs create mode 100644 SampleRevitAddin.2020/SampleRevitAddin.2020.csproj create mode 100644 SampleRevitAddin.2020/app.config create mode 100644 SampleRevitAddin.2020/packages.config create mode 100644 SampleRevitAddin.2021/Properties/AssemblyInfo.cs create mode 100644 SampleRevitAddin.2021/SampleRevitAddin.2021.csproj create mode 100644 SampleRevitAddin.2021/app.config create mode 100644 SampleRevitAddin.2021/packages.config create mode 100644 SampleRevitAddin.2022/Properties/AssemblyInfo.cs create mode 100644 SampleRevitAddin.2022/SampleRevitAddin.2022.csproj create mode 100644 SampleRevitAddin.2022/app.config create mode 100644 SampleRevitAddin.2022/packages.config create mode 100644 SampleRevitAddin.2023/Properties/AssemblyInfo.cs create mode 100644 SampleRevitAddin.2023/SampleRevitAddin.2023.csproj create mode 100644 SampleRevitAddin.2023/app.config create mode 100644 SampleRevitAddin.2023/packages.config create mode 100644 SampleRevitAddin.Common/PackageContents.xml create mode 100644 SampleRevitAddin.Common/SampleRevitAddin.Common.projitems create mode 100644 SampleRevitAddin.Common/SampleRevitAddin.Common.shproj create mode 100644 SampleRevitAddin.Common/SampleRevitAddin.addin create mode 100644 SampleRevitAddin.Common/SampleRevitPopup.cs create mode 100644 SampleRevitAddin.Common/Startup.cs create mode 100644 SampleRevitAddin.Installer/InstallScript.iss create mode 100644 SampleRevitAddin.Installer/Properties/AssemblyInfo.cs create mode 100644 SampleRevitAddin.Installer/SampleRevitAddin.Installer.csproj create mode 100644 SampleRevitAddin.Installer/packages.config create mode 100644 SampleRevitAddin.Resources/Images/Icons/e-verselogo.png create mode 100644 SampleRevitAddin.Resources/Properties/AssemblyInfo.cs create mode 100644 SampleRevitAddin.Resources/ResourceAssembly.cs create mode 100644 SampleRevitAddin.Resources/ResourceImage.cs create mode 100644 SampleRevitAddin.Resources/SampleRevitAddin.Resources.csproj create mode 100644 SampleRevitAddin.sln diff --git a/.github/workflows/dev_actions.yml b/.github/workflows/dev_actions.yml new file mode 100644 index 0000000..908ef56 --- /dev/null +++ b/.github/workflows/dev_actions.yml @@ -0,0 +1,68 @@ +#dev_actions.yml + +name: Compile and run tests +on: + push: + # this will cause the action to run on pushes to branches that start with the prefixes specified here + branches: [ develop, tests/*, features/*, docs/*, bugs/* ] + tags: + - 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10 + + pull_request: + # we'll also run this when pull requests to develop are opened + branches: [ develop ] + +jobs: + Build: + # The type of runner that the job will run on + runs-on: windows-latest + env: + Solution_Name: SampleRevitAddin.sln + outputs: + Version: ${{ steps.gitversion.outputs.nuGetVersionV2 }} + CommitsSinceVersionSource: ${{ steps.gitversion.outputs.CommitsSinceVersionSource }} + + steps: + - name: Checkout + uses: actions/checkout@v2 + with: + fetch-depth: 0 + + # install and calculate the new version with GitVersion + - name: Install GitVersion + uses: gittools/actions/gitversion/setup@v0.9.7 + with: + versionSpec: '5.5.0' + + - name: Determine Version + uses: gittools/actions/gitversion/execute@v0.9.7 + with: + useConfigFile: true + configFilePath: GitVersion.yml + + id: gitversion # step id used as reference for output values + - name: Display GitVersion outputs + run: | + echo "MajorMinorPatch: ${{ steps.gitversion.outputs.majorMinorPatch }}" + echo "NuGetVersionV2: ${{ steps.gitversion.outputs.nuGetVersionV2 }}" + echo "CommitsSinceVersionSource: ${{ steps.gitversion.outputs.CommitsSinceVersionSource }}" + + + - name: Setup MSBuild.exe + uses: microsoft/setup-msbuild@v1.0.2 + + - name: Setup NuGet + uses: NuGet/setup-nuget@v1.0.5 + + - name: Restore nuGet packages + run: nuget restore $env:Solution_Name + + - name: Run MSBuild + id: run-msbuild + run: | + msbuild $env:Solution_Name /t:Clean,Build /p:platform="Any CPU" /p:Configuration=Release + + - name: Run tests + id: run-tests + run: | + dotnet test \ No newline at end of file diff --git a/.github/workflows/production_actions.yml b/.github/workflows/production_actions.yml new file mode 100644 index 0000000..d61090b --- /dev/null +++ b/.github/workflows/production_actions.yml @@ -0,0 +1,88 @@ +#production_actions.yml + +name: Deploy to Production +on: + push: + # this will cause the action to run on pushes to main + branches: [ main ] + tags: + - 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10 + +jobs: + Build: + # The type of runner that the job will run on + runs-on: windows-latest + env: + Solution_Name: SampleRevitAddin.sln + outputs: + Version: ${{ steps.gitversion.outputs.nuGetVersionV2 }} + CommitsSinceVersionSource: ${{ steps.gitversion.outputs.CommitsSinceVersionSource }} + + steps: + - name: Checkout + uses: actions/checkout@v2 + with: + fetch-depth: 0 + + # install and calculate the new version with GitVersion + - name: Install GitVersion + uses: gittools/actions/gitversion/setup@v0.9.7 + with: + versionSpec: '5.5.0' + + - name: Determine Version + uses: gittools/actions/gitversion/execute@v0.9.7 + with: + useConfigFile: true + configFilePath: GitVersion.yml + + id: gitversion # step id used as reference for output values + - name: Display GitVersion outputs + run: | + echo "MajorMinorPatch: ${{ steps.gitversion.outputs.majorMinorPatch }}" + echo "NuGetVersionV2: ${{ steps.gitversion.outputs.nuGetVersionV2 }}" + echo "CommitsSinceVersionSource: ${{ steps.gitversion.outputs.CommitsSinceVersionSource }}" + - name: Setup MSBuild.exe + uses: microsoft/setup-msbuild@v1.0.2 + + - name: Setup NuGet + uses: NuGet/setup-nuget@v1.0.5 + + - name: Restore nuGet packages + run: nuget restore $env:Solution_Name + + - name: Set path for candle and light + run: echo "C:\Program Files (x86)\WiX Toolset v3.11\bin" >> $GITHUB_PATH + shell: bash + + - name: Run MSBuild + id: run-msbuild + run: | + msbuild $env:Solution_Name /t:Clean,Build /p:platform="Any CPU" /p:Configuration=Release + + - name: Run tests + id: run-tests + run: | + dotnet test + + - name: Create Release + id: create_release + uses: actions/create-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token + with: + tag_name: ${{ steps.gitversion.outputs.majorMinorPatch }} + release_name: Sample Revit Addin v${{ steps.gitversion.outputs.majorMinorPatch }} + automatic_release_tag: "latest" + draft: false + prerelease: false + - name: Upload Release Asset + id: upload-release-asset + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps + asset_path: .\SampleRevitAddin.Installer\Output\SampleRevitAddin.exe + asset_name: SampleRevitAddin.exe + asset_content_type: application/zip \ No newline at end of file diff --git a/.github/workflows/staging_actions.yml b/.github/workflows/staging_actions.yml new file mode 100644 index 0000000..ff95f54 --- /dev/null +++ b/.github/workflows/staging_actions.yml @@ -0,0 +1,84 @@ +#staging_actions.yml + +name: Deploy to Staging +on: + push: + # this will cause the action to run on pushes to staging + branches: [ staging ] + tags: + - 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10 + +jobs: + Build: + # The type of runner that the job will run on + runs-on: windows-latest + env: + Solution_Name: SampleRevitAddin.sln + outputs: + Version: ${{ steps.gitversion.outputs.nuGetVersionV2 }} + CommitsSinceVersionSource: ${{ steps.gitversion.outputs.CommitsSinceVersionSource }} + + steps: + - name: Checkout + uses: actions/checkout@v2 + with: + fetch-depth: 0 + + # install and calculate the new version with GitVersion + - name: Install GitVersion + uses: gittools/actions/gitversion/setup@v0.9.7 + with: + versionSpec: '5.5.0' + + - name: Determine Version + uses: gittools/actions/gitversion/execute@v0.9.7 + with: + useConfigFile: true + configFilePath: GitVersion.yml + + id: gitversion # step id used as reference for output values + - name: Display GitVersion outputs + run: | + echo "MajorMinorPatch: ${{ steps.gitversion.outputs.majorMinorPatch }}" + echo "NuGetVersionV2: ${{ steps.gitversion.outputs.nuGetVersionV2 }}" + echo "CommitsSinceVersionSource: ${{ steps.gitversion.outputs.CommitsSinceVersionSource }}" + - name: Setup MSBuild.exe + uses: microsoft/setup-msbuild@v1.0.2 + + - name: Setup NuGet + uses: NuGet/setup-nuget@v1.0.5 + + - name: Restore nuGet packages + run: nuget restore $env:Solution_Name + + - name: Run MSBuild + id: run-msbuild + run: | + msbuild $env:Solution_Name /t:Clean,Build /p:platform="Any CPU" /p:Configuration=Release + + - name: Run tests + id: run-tests + run: | + dotnet test + + - name: Create Release + id: create_release + uses: actions/create-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token + with: + tag_name: ${{ steps.gitversion.outputs.majorMinorPatch }}-b + release_name: Sample Revit Addin v${{ steps.gitversion.outputs.majorMinorPatch }}-beta + automatic_release_tag: "latest" + draft: false + prerelease: true + - name: Upload Release Asset + id: upload-release-asset + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps + asset_path: .\SampleRevitAddin.Installer\Output\SampleRevitAddin.exe + asset_name: SampleRevitAddin.exe + asset_content_type: application/zip \ No newline at end of file diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..6b97bfa --- /dev/null +++ b/.gitignore @@ -0,0 +1,264 @@ +## Ignore Visual Studio temporary files, build results, and +## files generated by popular Visual Studio add-ons. + +# User-specific files +*.suo +*.user +*.userosscache +*.sln.docstates +*.env + + +# User-specific files (MonoDevelop/Xamarin Studio) +*.userprefs + +# Build results +[Dd]ebug/ +[Dd]ebugPublic/ +[Rr]elease/ +[Rr]eleases/ +x64/ +x86/ +bld/ +[Bb]in/ +[Oo]bj/ +[Ll]og/ +**/Output/* + +# Visual Studio 2015 cache/options directory +.vs/ +# Uncomment if you have tasks that create the project's static files in wwwroot +#wwwroot/ + +# MSTest test Results +[Tt]est[Rr]esult*/ +[Bb]uild[Ll]og.* + +# NUNIT +*.VisualState.xml +TestResult.xml + +# Build Results of an ATL Project +[Dd]ebugPS/ +[Rr]eleasePS/ +dlldata.c + +# DNX +project.lock.json +project.fragment.lock.json +artifacts/ + +*_i.c +*_p.c +*_i.h +*.ilk +*.meta +*.obj +*.pch +*.pdb +*.pgc +*.pgd +*.rsp +*.sbr +*.tlb +*.tli +*.tlh +*.tmp +*.tmp_proj +*.log +*.vspscc +*.vssscc +.builds +*.pidb +*.svclog +*.scc + +# Chutzpah Test files +_Chutzpah* + +# Visual C++ cache files +ipch/ +*.aps +*.ncb +*.opendb +*.opensdf +*.sdf +*.cachefile +*.VC.db +*.VC.VC.opendb + +# Visual Studio profiler +*.psess +*.vsp +*.vspx +*.sap + +# TFS 2012 Local Workspace +$tf/ + +# Guidance Automation Toolkit +*.gpState + +# ReSharper is a .NET coding add-in +_ReSharper*/ +*.[Rr]e[Ss]harper +*.DotSettings.user + +# JustCode is a .NET coding add-in +.JustCode + +# TeamCity is a build add-in +_TeamCity* + +# DotCover is a Code Coverage Tool +*.dotCover + +# NCrunch +_NCrunch_* +.*crunch*.local.xml +nCrunchTemp_* + +# MightyMoose +*.mm.* +AutoTest.Net/ + +# Web workbench (sass) +.sass-cache/ + +# Installshield output folder +[Ee]xpress/ + +# DocProject is a documentation generator add-in +DocProject/buildhelp/ +DocProject/Help/*.HxT +DocProject/Help/*.HxC +DocProject/Help/*.hhc +DocProject/Help/*.hhk +DocProject/Help/*.hhp +DocProject/Help/Html2 +DocProject/Help/html + +# Click-Once directory +publish/ + +# Publish Web Output +*.[Pp]ublish.xml +*.azurePubxml +# TODO: Comment the next line if you want to checkin your web deploy settings +# but database connection strings (with potential passwords) will be unencrypted +#*.pubxml +*.publishproj + +# Microsoft Azure Web App publish settings. Comment the next line if you want to +# checkin your Azure Web App publish settings, but sensitive information contained +# in these scripts will be unencrypted +PublishScripts/ + +# NuGet Packages +*.nupkg +# The packages folder can be ignored because of Package Restore +**/packages/* +# except build/, which is used as an MSBuild target. +!**/packages/build/ +# Uncomment if necessary however generally it will be regenerated when needed +#!**/packages/repositories.config +# NuGet v3's project.json files produces more ignoreable files +*.nuget.props +*.nuget.targets + +# Microsoft Azure Build Output +csx/ +*.build.csdef + +# Microsoft Azure Emulator +ecf/ +rcf/ + +# Windows Store app package directories and files +AppPackages/ +BundleArtifacts/ +Package.StoreAssociation.xml +_pkginfo.txt + +# Visual Studio cache files +# files ending in .cache can be ignored +*.[Cc]ache +# but keep track of directories ending in .cache +!*.[Cc]ache/ + +# Others +ClientBin/ +~$* +*~ +*.dbmdl +*.dbproj.schemaview +*.jfm +*.pfx +*.publishsettings +node_modules/ +orleans.codegen.cs + +# Since there are multiple workflows, uncomment next line to ignore bower_components +# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) +#bower_components/ + +# RIA/Silverlight projects +Generated_Code/ + +# Backup & report files from converting an old project file +# to a newer Visual Studio version. Backup files are not needed, +# because we have git ;-) +_UpgradeReport_Files/ +Backup*/ +UpgradeLog*.XML +UpgradeLog*.htm + +# SQL Server files +*.mdf +*.ldf + +# Business Intelligence projects +*.rdl.data +*.bim.layout +*.bim_*.settings + +# Microsoft Fakes +FakesAssemblies/ + +# GhostDoc plugin setting file +*.GhostDoc.xml + +# Node.js Tools for Visual Studio +.ntvs_analysis.dat + +# Visual Studio 6 build log +*.plg + +# Visual Studio 6 workspace options file +*.opt + +# Visual Studio LightSwitch build output +**/*.HTMLClient/GeneratedArtifacts +**/*.DesktopClient/GeneratedArtifacts +**/*.DesktopClient/ModelManifest.xml +**/*.Server/GeneratedArtifacts +**/*.Server/ModelManifest.xml +_Pvt_Extensions + +# Paket dependency manager +.paket/paket.exe +paket-files/ + +# FAKE - F# Make +.fake/ + +# JetBrains Rider +.idea/ +*.sln.iml + +# CodeRush +.cr/ + +# Python Tools for Visual Studio (PTVS) +__pycache__/ +*.pyc \ No newline at end of file diff --git a/GitVersion.yml b/GitVersion.yml new file mode 100644 index 0000000..0777cbe --- /dev/null +++ b/GitVersion.yml @@ -0,0 +1,2 @@ +mode: ContinuousDeployment +next-version: 0.0.1 \ No newline at end of file diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..5773a77 --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2022 e-verse + +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: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +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. diff --git a/README.md b/README.md new file mode 100644 index 0000000..bad2c91 --- /dev/null +++ b/README.md @@ -0,0 +1 @@ +# Snack.Revit.Addin \ No newline at end of file diff --git a/SampleRevitAddin.2020/Properties/AssemblyInfo.cs b/SampleRevitAddin.2020/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..7308c70 --- /dev/null +++ b/SampleRevitAddin.2020/Properties/AssemblyInfo.cs @@ -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("SampleRevitAddin.2020")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("SampleRevitAddin.2020")] +[assembly: AssemblyCopyright("Copyright © 2022")] +[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("07583564-afc9-49d3-b859-21ed8c65344e")] + +// 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("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/SampleRevitAddin.2020/SampleRevitAddin.2020.csproj b/SampleRevitAddin.2020/SampleRevitAddin.2020.csproj new file mode 100644 index 0000000..d06dbd8 --- /dev/null +++ b/SampleRevitAddin.2020/SampleRevitAddin.2020.csproj @@ -0,0 +1,83 @@ + + + + + Debug + AnyCPU + {07583564-AFC9-49D3-B859-21ED8C65344E} + Library + Properties + SampleRevitAddin._2020 + SampleRevitAddin + v4.7.2 + 512 + true + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + ..\packages\Revit_All_Main_Versions_API_x64.2020.0.0\lib\net47\AdWindows.dll + False + False + + + + ..\packages\Revit_All_Main_Versions_API_x64.2020.0.0\lib\net47\RevitAPI.dll + False + False + + + ..\packages\Revit_All_Main_Versions_API_x64.2020.0.0\lib\net47\RevitAPIUI.dll + False + False + + + + + + + + + + + ..\packages\Revit_All_Main_Versions_API_x64.2020.0.0\lib\net47\UIFramework.dll + False + False + + + + + + + + + + + + + {87317c2b-af3a-40ad-865c-093fbaa72440} + SampleRevitAddin.Resources + + + + + + if $(ConfigurationName) == Debug copy /Y "$(TargetDir)" "$(AppData)\Autodesk\Revit\Addins\2020\" + + \ No newline at end of file diff --git a/SampleRevitAddin.2020/app.config b/SampleRevitAddin.2020/app.config new file mode 100644 index 0000000..4389c63 --- /dev/null +++ b/SampleRevitAddin.2020/app.config @@ -0,0 +1,12 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/SampleRevitAddin.2020/packages.config b/SampleRevitAddin.2020/packages.config new file mode 100644 index 0000000..ad4155e --- /dev/null +++ b/SampleRevitAddin.2020/packages.config @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/SampleRevitAddin.2021/Properties/AssemblyInfo.cs b/SampleRevitAddin.2021/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..e8297ed --- /dev/null +++ b/SampleRevitAddin.2021/Properties/AssemblyInfo.cs @@ -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("SampleRevitAddin.2021")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("SampleRevitAddin.2021")] +[assembly: AssemblyCopyright("Copyright © 2022")] +[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("8df231c1-4af1-4be2-a713-fc8e97951500")] + +// 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("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/SampleRevitAddin.2021/SampleRevitAddin.2021.csproj b/SampleRevitAddin.2021/SampleRevitAddin.2021.csproj new file mode 100644 index 0000000..72c120e --- /dev/null +++ b/SampleRevitAddin.2021/SampleRevitAddin.2021.csproj @@ -0,0 +1,84 @@ + + + + + Debug + AnyCPU + {8DF231C1-4AF1-4BE2-A713-FC8E97951500} + Library + Properties + SampleRevitAddin._2021 + SampleRevitAddin + v4.8 + 512 + true + + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + ..\packages\Revit_All_Main_Versions_API_x64.2021.1.4\lib\net48\AdWindows.dll + False + False + + + + ..\packages\Revit_All_Main_Versions_API_x64.2021.1.4\lib\net48\RevitAPI.dll + False + False + + + ..\packages\Revit_All_Main_Versions_API_x64.2021.1.4\lib\net48\RevitAPIUI.dll + False + False + + + + + + + + + + + ..\packages\Revit_All_Main_Versions_API_x64.2021.1.4\lib\net48\UIFramework.dll + False + False + + + + + + + + + + + + + {87317c2b-af3a-40ad-865c-093fbaa72440} + SampleRevitAddin.Resources + + + + + + if $(ConfigurationName) == Debug copy /Y "$(TargetDir)" "$(AppData)\Autodesk\Revit\Addins\2021\" + + \ No newline at end of file diff --git a/SampleRevitAddin.2021/app.config b/SampleRevitAddin.2021/app.config new file mode 100644 index 0000000..4389c63 --- /dev/null +++ b/SampleRevitAddin.2021/app.config @@ -0,0 +1,12 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/SampleRevitAddin.2021/packages.config b/SampleRevitAddin.2021/packages.config new file mode 100644 index 0000000..4790ad1 --- /dev/null +++ b/SampleRevitAddin.2021/packages.config @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/SampleRevitAddin.2022/Properties/AssemblyInfo.cs b/SampleRevitAddin.2022/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..722a942 --- /dev/null +++ b/SampleRevitAddin.2022/Properties/AssemblyInfo.cs @@ -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("SampleRevitAddin.2022")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("SampleRevitAddin.2022")] +[assembly: AssemblyCopyright("Copyright © 2022")] +[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("ac17c4be-a7e7-4135-b970-9c5c133cb875")] + +// 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("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/SampleRevitAddin.2022/SampleRevitAddin.2022.csproj b/SampleRevitAddin.2022/SampleRevitAddin.2022.csproj new file mode 100644 index 0000000..7dd069c --- /dev/null +++ b/SampleRevitAddin.2022/SampleRevitAddin.2022.csproj @@ -0,0 +1,84 @@ + + + + + Debug + AnyCPU + {AC17C4BE-A7E7-4135-B970-9C5C133CB875} + Library + Properties + SampleRevitAddin._2022 + SampleRevitAddin + v4.8 + 512 + true + + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + ..\packages\Revit_All_Main_Versions_API_x64.2022.0.0\lib\net48\AdWindows.dll + False + False + + + + ..\packages\Revit_All_Main_Versions_API_x64.2022.0.0\lib\net48\RevitAPI.dll + False + False + + + ..\packages\Revit_All_Main_Versions_API_x64.2022.0.0\lib\net48\RevitAPIUI.dll + False + False + + + + + + + + + + + ..\packages\Revit_All_Main_Versions_API_x64.2022.0.0\lib\net48\UIFramework.dll + False + False + + + + + + + + + + + + + {87317c2b-af3a-40ad-865c-093fbaa72440} + SampleRevitAddin.Resources + + + + + + if $(ConfigurationName) == Debug copy /Y "$(TargetDir)" "$(AppData)\Autodesk\Revit\Addins\2022\" + + \ No newline at end of file diff --git a/SampleRevitAddin.2022/app.config b/SampleRevitAddin.2022/app.config new file mode 100644 index 0000000..4389c63 --- /dev/null +++ b/SampleRevitAddin.2022/app.config @@ -0,0 +1,12 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/SampleRevitAddin.2022/packages.config b/SampleRevitAddin.2022/packages.config new file mode 100644 index 0000000..d7923e0 --- /dev/null +++ b/SampleRevitAddin.2022/packages.config @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/SampleRevitAddin.2023/Properties/AssemblyInfo.cs b/SampleRevitAddin.2023/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..aa272c1 --- /dev/null +++ b/SampleRevitAddin.2023/Properties/AssemblyInfo.cs @@ -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("SampleRevitAddin.2023")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("SampleRevitAddin.2023")] +[assembly: AssemblyCopyright("Copyright © 2022")] +[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("963b5ab4-beda-499e-896f-9fb61fdcc96d")] + +// 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("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/SampleRevitAddin.2023/SampleRevitAddin.2023.csproj b/SampleRevitAddin.2023/SampleRevitAddin.2023.csproj new file mode 100644 index 0000000..12aa9c3 --- /dev/null +++ b/SampleRevitAddin.2023/SampleRevitAddin.2023.csproj @@ -0,0 +1,84 @@ + + + + + Debug + AnyCPU + {963B5AB4-BEDA-499E-896F-9FB61FDCC96D} + Library + Properties + SampleRevitAddin._2023 + SampleRevitAddin + v4.8 + 512 + true + + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + ..\packages\Revit_All_Main_Versions_API_x64.2023.0.0\lib\net48\AdWindows.dll + False + False + + + + ..\packages\Revit_All_Main_Versions_API_x64.2023.0.0\lib\net48\RevitAPI.dll + False + False + + + ..\packages\Revit_All_Main_Versions_API_x64.2023.0.0\lib\net48\RevitAPIUI.dll + False + False + + + + + + + + + + + ..\packages\Revit_All_Main_Versions_API_x64.2023.0.0\lib\net48\UIFramework.dll + False + False + + + + + + + + + + + + + {87317c2b-af3a-40ad-865c-093fbaa72440} + SampleRevitAddin.Resources + + + + + + if $(ConfigurationName) == Debug copy /Y "$(TargetDir)" "$(AppData)\Autodesk\Revit\Addins\2023\" + + \ No newline at end of file diff --git a/SampleRevitAddin.2023/app.config b/SampleRevitAddin.2023/app.config new file mode 100644 index 0000000..4389c63 --- /dev/null +++ b/SampleRevitAddin.2023/app.config @@ -0,0 +1,12 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/SampleRevitAddin.2023/packages.config b/SampleRevitAddin.2023/packages.config new file mode 100644 index 0000000..f7ed1d2 --- /dev/null +++ b/SampleRevitAddin.2023/packages.config @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/SampleRevitAddin.Common/PackageContents.xml b/SampleRevitAddin.Common/PackageContents.xml new file mode 100644 index 0000000..b7318fe --- /dev/null +++ b/SampleRevitAddin.Common/PackageContents.xml @@ -0,0 +1,36 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/SampleRevitAddin.Common/SampleRevitAddin.Common.projitems b/SampleRevitAddin.Common/SampleRevitAddin.Common.projitems new file mode 100644 index 0000000..741e04d --- /dev/null +++ b/SampleRevitAddin.Common/SampleRevitAddin.Common.projitems @@ -0,0 +1,23 @@ + + + + $(MSBuildAllProjects);$(MSBuildThisFileFullPath) + true + c5d23e10-c3af-4ac2-8f80-9d4482d274b0 + + + SampleRevitAddin.Common + + + + + + + + Always + + + + + + \ No newline at end of file diff --git a/SampleRevitAddin.Common/SampleRevitAddin.Common.shproj b/SampleRevitAddin.Common/SampleRevitAddin.Common.shproj new file mode 100644 index 0000000..6b8a983 --- /dev/null +++ b/SampleRevitAddin.Common/SampleRevitAddin.Common.shproj @@ -0,0 +1,13 @@ + + + + c5d23e10-c3af-4ac2-8f80-9d4482d274b0 + 14.0 + + + + + + + + diff --git a/SampleRevitAddin.Common/SampleRevitAddin.addin b/SampleRevitAddin.Common/SampleRevitAddin.addin new file mode 100644 index 0000000..8a78acb --- /dev/null +++ b/SampleRevitAddin.Common/SampleRevitAddin.addin @@ -0,0 +1,17 @@ + + + + SampleRevitAddin + SampleRevitAddin.Common.Startup + Sample Revit Addin + A simple add-in to display how we create Revit add-ins at e-verse + AlwaysVisible + SampleRevitAddin.dll + 601FFC79-C4C3-4A5B-A0FE-CE89CEC7EE04 + ADSK + e-verse LLC, www.e-verse.com + + + + + diff --git a/SampleRevitAddin.Common/SampleRevitPopup.cs b/SampleRevitAddin.Common/SampleRevitPopup.cs new file mode 100644 index 0000000..02e4030 --- /dev/null +++ b/SampleRevitAddin.Common/SampleRevitPopup.cs @@ -0,0 +1,26 @@ +using System; +using Autodesk.Revit.Attributes; +using Autodesk.Revit.DB; +using Autodesk.Revit.UI; + +namespace SampleRevitAddin.Common +{ + [Transaction(TransactionMode.Manual)] + public class SampleRevitPopup : IExternalCommand + { + + public Result Execute(ExternalCommandData commandData, ref string message, ElementSet elements) + { + try + { + TaskDialog.Show("e-verse Sample Addin", "Looks like this worked!"); + return Result.Succeeded; + } + catch (Exception e) + { + TaskDialog.Show("e-verse Sample Addin", $"Exception found: {e.Message}"); + return Result.Failed; + } + } + } +} diff --git a/SampleRevitAddin.Common/Startup.cs b/SampleRevitAddin.Common/Startup.cs new file mode 100644 index 0000000..a2c102f --- /dev/null +++ b/SampleRevitAddin.Common/Startup.cs @@ -0,0 +1,75 @@ +using System; +using System.Reflection; +using System.Windows.Media.Imaging; +using System.IO; +using System.Diagnostics; +using Autodesk.Revit.Attributes; +using Autodesk.Revit.DB; +using Autodesk.Revit.UI; +using SampleRevitAddin.Resources; + +namespace SampleRevitAddin.Common +{ + [Transaction(TransactionMode.Manual)] + [Regeneration(RegenerationOption.Manual)] + public class Startup : IExternalApplication + { + public Result OnShutdown(UIControlledApplication application) + { + return Result.Succeeded; + } + + public Result OnStartup(UIControlledApplication application) + { + AddRibbonButtons(application); + + return Result.Succeeded; + } + + BitmapImage NewBitmapImage( + Assembly a, string imageName) + { + Stream s = a.GetManifestResourceStream(imageName); + BitmapImage img = new BitmapImage(); + img.BeginInit(); + img.StreamSource = s; + img.EndInit(); + return img; + } + + private System.Windows.Media.ImageSource BmpImageSource(string embeddedPath) + { + Stream stream = this.GetType().Assembly.GetManifestResourceStream(embeddedPath); + var decoder = new BmpBitmapDecoder(stream, BitmapCreateOptions.PreservePixelFormat, BitmapCacheOption.Default); + return decoder.Frames[0]; + } + + private void AddRibbonButtons(UIControlledApplication application) + { + Assembly assembly = Assembly.GetExecutingAssembly(); + string executingAssemblyPath = assembly.Location; + Debug.Print(executingAssemblyPath); + string executingAssemblyName = assembly.GetName().Name; + Console.WriteLine(executingAssemblyName); + string eTabName = "e-verse"; + + try + { + application.CreateRibbonTab(eTabName); + } + catch (Autodesk.Revit.Exceptions.ArgumentException) + { + // tab already exists + } + + PushButtonData pbd = new PushButtonData("Sample", "Click Me", executingAssemblyPath, "SampleRevitAddin.Common.SampleRevitPopup"); + RibbonPanel panel = application.CreateRibbonPanel(eTabName, "Revit Snack"); + + // Create the main button. + PushButton pb = panel.AddItem(pbd) as PushButton; + + pb.ToolTip = "This is a sample Revit button"; + pb.LargeImage = ResourceImage.GetIcon("e-verselogo.png"); + } + } +} \ No newline at end of file diff --git a/SampleRevitAddin.Installer/InstallScript.iss b/SampleRevitAddin.Installer/InstallScript.iss new file mode 100644 index 0000000..e41768b --- /dev/null +++ b/SampleRevitAddin.Installer/InstallScript.iss @@ -0,0 +1,62 @@ +; Script generated by the Inno Setup Script Wizard. +; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES! + +#define MyAppName "SampleRevitAddin" +#define MyAppVersion "1.0" +#define MyAppPublisher "e-verse" + +[Setup] +; NOTE: The value of AppId uniquely identifies this application. Do not use the same AppId value in installers for other applications. +; (To generate a new GUID, click Tools | Generate GUID inside the IDE.) +AppId={{264AD411-643C-43AC-9F07-34523C752100} +AppName={#MyAppName} +#define installerPath "{commonpf64}\e-verse\Snacks\" +AppVersion={#MyAppVersion} +;AppVerName={#MyAppName} {#MyAppVersion} +AppPublisher={#MyAppPublisher} +DefaultDirName={#installerPath} +DisableDirPage=yes +DefaultGroupName=Revit Extractor +DisableProgramGroupPage=yes + + +#define Revit2020 "\Autodesk\ApplicationPlugins\SampleRevitAddin.bundle\Contents\2020\" +#define Revit2021 "\Autodesk\ApplicationPlugins\SampleRevitAddin.bundle\Contents\2021\" +#define Revit2022 "\Autodesk\ApplicationPlugins\SampleRevitAddin.bundle\Contents\2022\" +#define Revit2023 "\Autodesk\ApplicationPlugins\SampleRevitAddin.bundle\Contents\2023\" + + +; Uncomment the following line to run in non administrative install mode (install for current user only.) +;PrivilegesRequired=lowest +OutputDir=.\Output +OutputBaseFilename=SampleRevitAddin +Compression=lzma +SolidCompression=yes +WizardStyle=modern + +[Languages] +Name: "english"; MessagesFile: "compiler:Default.isl" + +[Files] + + +Source: "..\SampleRevitAddin.2020\bin\Release\*"; DestDir: "{userappdata}{#Revit2020}\"; Flags: ignoreversion recursesubdirs createallsubdirs +Source: "..\SampleRevitAddin.Common\SampleRevitAddin.addin"; DestDir: "{userappdata}{#Revit2020}\"; Flags: ignoreversion recursesubdirs createallsubdirs + +Source: "..\SampleRevitAddin.2021\bin\Release\*"; DestDir: "{userappdata}{#Revit2021}\"; Flags: ignoreversion recursesubdirs createallsubdirs +Source: "..\SampleRevitAddin.Common\SampleRevitAddin.addin"; DestDir: "{userappdata}{#Revit2021}\"; Flags: ignoreversion recursesubdirs createallsubdirs + + +Source: "..\SampleRevitAddin.2022\bin\Release\*"; DestDir: "{userappdata}{#Revit2022}\"; Flags: ignoreversion recursesubdirs createallsubdirs +Source: "..\SampleRevitAddin.Common\SampleRevitAddin.addin"; DestDir: "{userappdata}{#Revit2022}\"; Flags: ignoreversion recursesubdirs createallsubdirs + +Source: "..\SampleRevitAddin.2023\bin\Release\*"; DestDir: "{userappdata}{#Revit2023}\"; Flags: ignoreversion recursesubdirs createallsubdirs +Source: "..\SampleRevitAddin.Common\SampleRevitAddin.addin"; DestDir: "{userappdata}{#Revit2022}\"; Flags: ignoreversion recursesubdirs createallsubdirs + +Source: "..\SampleRevitAddin.Common\PackageContents.xml"; DestDir: "{userappdata}\Autodesk\ApplicationPlugins\SampleRevitAddin.bundle\"; Flags: ignoreversion + +; NOTE: Don't use "Flags: ignoreversion" on any shared system files + +[Icons] +Name: "{group}\{cm:UninstallProgram,{#MyAppName}}"; Filename: "{uninstallexe}" + diff --git a/SampleRevitAddin.Installer/Properties/AssemblyInfo.cs b/SampleRevitAddin.Installer/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..42c9403 --- /dev/null +++ b/SampleRevitAddin.Installer/Properties/AssemblyInfo.cs @@ -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("SampleRevitAddin.Installer")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("SampleRevitAddin.Installer")] +[assembly: AssemblyCopyright("Copyright © 2022")] +[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("54b60ff5-0884-44b9-b25e-c7cd34dede3e")] + +// 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("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/SampleRevitAddin.Installer/SampleRevitAddin.Installer.csproj b/SampleRevitAddin.Installer/SampleRevitAddin.Installer.csproj new file mode 100644 index 0000000..bc7adfe --- /dev/null +++ b/SampleRevitAddin.Installer/SampleRevitAddin.Installer.csproj @@ -0,0 +1,65 @@ + + + + + + Debug + AnyCPU + {54B60FF5-0884-44B9-B25E-C7CD34DEDE3E} + Library + Properties + SampleRevitAddin.Installer + SampleRevitAddin.Installer + v4.7.2 + 512 + true + + + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + + + + + + + + + + + + + + + + + + + + if $(ConfigurationName) == Release "$(SolutionDir)packages\Tools.InnoSetup.6.2.1\tools\ISCC.exe" "$(ProjectDir)InstallScript.iss" + + + + This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. + + + + \ No newline at end of file diff --git a/SampleRevitAddin.Installer/packages.config b/SampleRevitAddin.Installer/packages.config new file mode 100644 index 0000000..850c90a --- /dev/null +++ b/SampleRevitAddin.Installer/packages.config @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/SampleRevitAddin.Resources/Images/Icons/e-verselogo.png b/SampleRevitAddin.Resources/Images/Icons/e-verselogo.png new file mode 100644 index 0000000000000000000000000000000000000000..69bfa212c9749671b23647309654cfa896bea8a8 GIT binary patch literal 686 zcmV;f0#W^mP)Px%Xh}ptR9HvtmQ8CDQ51&XI|)fiz#>H@H?7cQf>7KmRwOg^0~JApF5J5D2Z$R% zaG^W#2e@(T!Vl1eACQ}96y3Nig5GgsG7YUr6_Qet&XFmOj+4yXsU&oh*`9OX^UQnB zxm<=F{@4!J#~5Jjz(5BGV6B32W;3A;%^|Iw5!`;-2@ZW<0Rpt;qVWWbogMauq>-MS zlFxqnb^8Dsdik&h?cK18yLyapHD`(2kpT9rc@hb{7zKc<$))(`r~4dem5f6UvG*ea zc)+DtjC8;qz-8TZhh;(qLBPGd6qjt>d<@{cDxZN4=45p#62J|v6i$?S+U6&P;CC*? zl$T@crUXz7JL3@Dowll%m0REwTmvu}4nfbkte*Db%Hi$&$a4FGdJR3nFS85#CKA+& za>0Q!Gc9Y4zt9WU0J;@C)7yZ)|EsVDX+>T%cFAmjkPnAoAGxf|`Qx^3QXt>qQY6AO zA_1!9a`He!TL+K~g&^l9w`$kDc(Z8CGsfQh$?s&dgKj`CuDoiSMe_(_cpK4*E|((Z z#R)ewyZCyYF{Fr`dfuuXi)y11z&&j1<_ds45v{nxW#x)LPUUiv)oMNUYN|2-tj^5y zZaUqJav>*0ngPN7E7fB;;Horr^D_hV&|xCn&spN4vSJ`1Hh|5~WsqsNqYAXq-CL6N z)$KsU2KYS-uK + /// Resource assembly helper methods + /// + public static class ResourceAssembly + { + /// + /// Gets the current resource assembly + /// + /// + public static Assembly GetAssembly() + { + return Assembly.GetExecutingAssembly(); + } + + /// + /// Gets the namespace of the currently running resource assembly + /// + /// + public static string GetNamespace() + { + return typeof(ResourceAssembly).Namespace + "."; + } + } +} \ No newline at end of file diff --git a/SampleRevitAddin.Resources/ResourceImage.cs b/SampleRevitAddin.Resources/ResourceImage.cs new file mode 100644 index 0000000..c92472a --- /dev/null +++ b/SampleRevitAddin.Resources/ResourceImage.cs @@ -0,0 +1,33 @@ +using System.IO; +using System.Windows.Media.Imaging; + +namespace SampleRevitAddin.Resources +{ + /// + /// Gets the embedded resource image from the Resources assembly based on user provided file name with extension. + /// Helper methods. + /// + public static class ResourceImage + { + /// + /// Gets the icon image from resource assembly by specified name + /// + /// + /// + public static BitmapImage GetIcon(string name) + { + // Create the resource reader stream + Stream stream = ResourceAssembly.GetAssembly().GetManifestResourceStream(ResourceAssembly.GetNamespace() + "Images.Icons." + name); + + BitmapImage image = new BitmapImage(); + + // Construct and return the image itself + image.BeginInit(); + image.StreamSource = stream; + image.EndInit(); + + // Return constructed BitmapImage + return image; + } + } +} \ No newline at end of file diff --git a/SampleRevitAddin.Resources/SampleRevitAddin.Resources.csproj b/SampleRevitAddin.Resources/SampleRevitAddin.Resources.csproj new file mode 100644 index 0000000..cad3ea5 --- /dev/null +++ b/SampleRevitAddin.Resources/SampleRevitAddin.Resources.csproj @@ -0,0 +1,57 @@ + + + + + Debug + AnyCPU + {87317C2B-AF3A-40AD-865C-093FBAA72440} + Library + Properties + SampleRevitAddin.Resources + SampleRevitAddin.Resources + v4.7.2 + 512 + true + + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + + + + + + + + + + + + + + + + + + Always + + + + \ No newline at end of file diff --git a/SampleRevitAddin.sln b/SampleRevitAddin.sln new file mode 100644 index 0000000..b60187e --- /dev/null +++ b/SampleRevitAddin.sln @@ -0,0 +1,70 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.3.32901.215 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{D954291E-2A0B-460D-934E-DC6B0785DB48}") = "SampleRevitAddin.Common", "SampleRevitAddin.Common\SampleRevitAddin.Common.shproj", "{C5D23E10-C3AF-4AC2-8F80-9D4482D274B0}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SampleRevitAddin.2020", "SampleRevitAddin.2020\SampleRevitAddin.2020.csproj", "{07583564-AFC9-49D3-B859-21ED8C65344E}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SampleRevitAddin.2021", "SampleRevitAddin.2021\SampleRevitAddin.2021.csproj", "{8DF231C1-4AF1-4BE2-A713-FC8E97951500}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SampleRevitAddin.2022", "SampleRevitAddin.2022\SampleRevitAddin.2022.csproj", "{AC17C4BE-A7E7-4135-B970-9C5C133CB875}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SampleRevitAddin.2023", "SampleRevitAddin.2023\SampleRevitAddin.2023.csproj", "{963B5AB4-BEDA-499E-896F-9FB61FDCC96D}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SampleRevitAddin.Installer", "SampleRevitAddin.Installer\SampleRevitAddin.Installer.csproj", "{54B60FF5-0884-44B9-B25E-C7CD34DEDE3E}" + ProjectSection(ProjectDependencies) = postProject + {07583564-AFC9-49D3-B859-21ED8C65344E} = {07583564-AFC9-49D3-B859-21ED8C65344E} + {8DF231C1-4AF1-4BE2-A713-FC8E97951500} = {8DF231C1-4AF1-4BE2-A713-FC8E97951500} + {963B5AB4-BEDA-499E-896F-9FB61FDCC96D} = {963B5AB4-BEDA-499E-896F-9FB61FDCC96D} + {AC17C4BE-A7E7-4135-B970-9C5C133CB875} = {AC17C4BE-A7E7-4135-B970-9C5C133CB875} + EndProjectSection +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SampleRevitAddin.Resources", "SampleRevitAddin.Resources\SampleRevitAddin.Resources.csproj", "{87317C2B-AF3A-40AD-865C-093FBAA72440}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {07583564-AFC9-49D3-B859-21ED8C65344E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {07583564-AFC9-49D3-B859-21ED8C65344E}.Debug|Any CPU.Build.0 = Debug|Any CPU + {07583564-AFC9-49D3-B859-21ED8C65344E}.Release|Any CPU.ActiveCfg = Release|Any CPU + {07583564-AFC9-49D3-B859-21ED8C65344E}.Release|Any CPU.Build.0 = Release|Any CPU + {8DF231C1-4AF1-4BE2-A713-FC8E97951500}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {8DF231C1-4AF1-4BE2-A713-FC8E97951500}.Debug|Any CPU.Build.0 = Debug|Any CPU + {8DF231C1-4AF1-4BE2-A713-FC8E97951500}.Release|Any CPU.ActiveCfg = Release|Any CPU + {8DF231C1-4AF1-4BE2-A713-FC8E97951500}.Release|Any CPU.Build.0 = Release|Any CPU + {AC17C4BE-A7E7-4135-B970-9C5C133CB875}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {AC17C4BE-A7E7-4135-B970-9C5C133CB875}.Debug|Any CPU.Build.0 = Debug|Any CPU + {AC17C4BE-A7E7-4135-B970-9C5C133CB875}.Release|Any CPU.ActiveCfg = Release|Any CPU + {AC17C4BE-A7E7-4135-B970-9C5C133CB875}.Release|Any CPU.Build.0 = Release|Any CPU + {963B5AB4-BEDA-499E-896F-9FB61FDCC96D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {963B5AB4-BEDA-499E-896F-9FB61FDCC96D}.Debug|Any CPU.Build.0 = Debug|Any CPU + {963B5AB4-BEDA-499E-896F-9FB61FDCC96D}.Release|Any CPU.ActiveCfg = Release|Any CPU + {963B5AB4-BEDA-499E-896F-9FB61FDCC96D}.Release|Any CPU.Build.0 = Release|Any CPU + {54B60FF5-0884-44B9-B25E-C7CD34DEDE3E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {54B60FF5-0884-44B9-B25E-C7CD34DEDE3E}.Debug|Any CPU.Build.0 = Debug|Any CPU + {54B60FF5-0884-44B9-B25E-C7CD34DEDE3E}.Release|Any CPU.ActiveCfg = Release|Any CPU + {54B60FF5-0884-44B9-B25E-C7CD34DEDE3E}.Release|Any CPU.Build.0 = Release|Any CPU + {87317C2B-AF3A-40AD-865C-093FBAA72440}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {87317C2B-AF3A-40AD-865C-093FBAA72440}.Debug|Any CPU.Build.0 = Debug|Any CPU + {87317C2B-AF3A-40AD-865C-093FBAA72440}.Release|Any CPU.ActiveCfg = Release|Any CPU + {87317C2B-AF3A-40AD-865C-093FBAA72440}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {299B59F9-B84B-4547-8B40-346A6B4012AF} + EndGlobalSection + GlobalSection(SharedMSBuildProjectFiles) = preSolution + SampleRevitAddin.Common\SampleRevitAddin.Common.projitems*{07583564-afc9-49d3-b859-21ed8c65344e}*SharedItemsImports = 4 + SampleRevitAddin.Common\SampleRevitAddin.Common.projitems*{8df231c1-4af1-4be2-a713-fc8e97951500}*SharedItemsImports = 4 + SampleRevitAddin.Common\SampleRevitAddin.Common.projitems*{963b5ab4-beda-499e-896f-9fb61fdcc96d}*SharedItemsImports = 4 + SampleRevitAddin.Common\SampleRevitAddin.Common.projitems*{ac17c4be-a7e7-4135-b970-9c5c133cb875}*SharedItemsImports = 4 + SampleRevitAddin.Common\SampleRevitAddin.Common.projitems*{c5d23e10-c3af-4ac2-8f80-9d4482d274b0}*SharedItemsImports = 13 + EndGlobalSection +EndGlobal