Skip to content

Commit

Permalink
Merge pull request #7 from Dangl-IT/feature/#1-revit-integration
Browse files Browse the repository at this point in the history
Feature/#1 revit integration
  • Loading branch information
GeorgDangl authored Apr 6, 2024
2 parents ae37f30 + 66b5f5d commit d4a8ba8
Show file tree
Hide file tree
Showing 56 changed files with 1,878 additions and 138 deletions.
60 changes: 48 additions & 12 deletions .github/workflows/continuous.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,9 @@ name: continuous
on: [push]

jobs:
windows-latest:
name: windows-latest
tests:
name: tests
runs-on: windows-latest
env:
GitHubAuthenticationToken: ${{ secrets.GITHUB_TOKEN }}
DocuApiKey: ${{ secrets.DOCUAPIKEY }}
CodeSigningCertificateKeyVaultBaseUrl: ${{ secrets.CODESIGNINGKEYVAULTBASEURL }}
KeyVaultClientId: ${{ secrets.CODESIGNINGKEYVAULTCLIENTID }}
KeyVaultClientSecret: ${{ secrets.CODESIGNINGKEYVAULTCLIENTSECRET }}
CodeSigningKeyVaultTenantId: ${{ secrets.CODESIGNINGKEYVAULTTENANTID }}
CodeSigningCertificateName: ${{ secrets.CODESIGNINGKEYVAULTCERTIFICATENAME }}
steps:
- name: Checkout repository
uses: actions/checkout@v1
Expand All @@ -25,5 +17,49 @@ jobs:
with:
name: Test Results (${{ runner.os }})
path: output/**/*_testresults.xml
- name: UploadDocumentation+PublishGitHubRelease+UploadElectronApp
run: ./build.ps1 UploadDocumentation+PublishGitHubRelease+UploadElectronApp
upload-docs:
needs: tests
name: upload-docs
runs-on: windows-latest
env:
GitHubAuthenticationToken: ${{ secrets.GITHUB_TOKEN }}
DocuApiKey: ${{ secrets.DOCUAPIKEY }}
steps:
- name: Checkout repository
uses: actions/checkout@v1
- name: UploadDocumentation+PublishGitHubRelease
run: ./build.ps1 UploadDocumentation+PublishGitHubRelease
upload-electron-app:
needs: upload-docs
name: upload-electron-app
runs-on: windows-latest
env:
GitHubAuthenticationToken: ${{ secrets.GITHUB_TOKEN }}
DocuApiKey: ${{ secrets.DOCUAPIKEY }}
CodeSigningCertificateKeyVaultBaseUrl: ${{ secrets.CODESIGNINGKEYVAULTBASEURL }}
KeyVaultClientId: ${{ secrets.CODESIGNINGKEYVAULTCLIENTID }}
KeyVaultClientSecret: ${{ secrets.CODESIGNINGKEYVAULTCLIENTSECRET }}
CodeSigningKeyVaultTenantId: ${{ secrets.CODESIGNINGKEYVAULTTENANTID }}
CodeSigningCertificateName: ${{ secrets.CODESIGNINGKEYVAULTCERTIFICATENAME }}
steps:
- name: Checkout repository
uses: actions/checkout@v1
- name: UploadElectronApp
run: ./build.ps1 UploadElectronApp --skip UploadDocumentation BuildDocumentation BuildDocFxMetadata
upload-revit-plugin:
needs: upload-docs
name: upload-revit-plugin
runs-on: windows-latest
env:
GitHubAuthenticationToken: ${{ secrets.GITHUB_TOKEN }}
DocuApiKey: ${{ secrets.DOCUAPIKEY }}
CodeSigningCertificateKeyVaultBaseUrl: ${{ secrets.CODESIGNINGKEYVAULTBASEURL }}
KeyVaultClientId: ${{ secrets.CODESIGNINGKEYVAULTCLIENTID }}
KeyVaultClientSecret: ${{ secrets.CODESIGNINGKEYVAULTCLIENTSECRET }}
CodeSigningKeyVaultTenantId: ${{ secrets.CODESIGNINGKEYVAULTTENANTID }}
CodeSigningCertificateName: ${{ secrets.CODESIGNINGKEYVAULTCERTIFICATENAME }}
steps:
- name: Checkout repository
uses: actions/checkout@v1
- name: UploadRevitPlugin
run: ./build.ps1 UploadRevitPlugin
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -199,3 +199,5 @@ output/
nuke2/

src/IPA.Bcfier.App/wwwroot/dist/

src/IPA.Bcfier.Revit/Resources/Browser/
10 changes: 8 additions & 2 deletions .nuke/build.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,8 @@
"BuildDocFxMetadata",
"BuildDocumentation",
"BuildElectronApp",
"BuildFrontend",
"BuildRevitPlugin",
"Clean",
"Compile",
"FrontEndRestore",
Expand All @@ -112,7 +114,8 @@
"SignExecutables",
"Tests",
"UploadDocumentation",
"UploadElectronApp"
"UploadElectronApp",
"UploadRevitPlugin"
]
}
},
Expand All @@ -129,6 +132,8 @@
"BuildDocFxMetadata",
"BuildDocumentation",
"BuildElectronApp",
"BuildFrontend",
"BuildRevitPlugin",
"Clean",
"Compile",
"FrontEndRestore",
Expand All @@ -139,7 +144,8 @@
"SignExecutables",
"Tests",
"UploadDocumentation",
"UploadElectronApp"
"UploadElectronApp",
"UploadRevitPlugin"
]
}
},
Expand Down
2 changes: 1 addition & 1 deletion Bcfier.Revit/App.config
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7"/>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.8.1"/>
</startup>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
Expand Down
145 changes: 74 additions & 71 deletions Bcfier.Revit/Bcfier.Revit.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Bcfier.Revit</RootNamespace>
<AssemblyName>Bcfier.Revit</AssemblyName>
<TargetFrameworkVersion>v4.7</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.8.1</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<ProjectTypeGuids>{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<WarningLevel>4</WarningLevel>
Expand Down Expand Up @@ -274,64 +274,57 @@
<Prefer32Bit>false</Prefer32Bit>
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
</PropertyGroup>
<!--2021-->
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug-2022|AnyCPU'">
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\Debug-2022\</OutputPath>
<DefineConstants>TRACE;DEBUG;Version2022</DefineConstants>
<DebugType>full</DebugType>
<PlatformTarget>x64</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
<RevitVersion>2022</RevitVersion>
<AssemblyName>$(AssemblyName)</AssemblyName>
<Prefer32Bit>false</Prefer32Bit>
<StartAction>Program</StartAction>
<StartProgram>C:\Program Files\Autodesk\Revit 2022\Revit.exe</StartProgram>
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release-2022|AnyCPU'">
<OutputPath>bin\Release-2022\</OutputPath>
<DefineConstants>TRACE;RELEASE;Version2022</DefineConstants>
<Optimize>true</Optimize>
<DebugType>pdbonly</DebugType>
<PlatformTarget>AnyCPU</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
<RevitVersion>2022</RevitVersion>
<AssemblyName>$(AssemblyName)</AssemblyName>
<WarningLevel>0</WarningLevel>
<ResolveAssemblyWarnOrErrorOnTargetArchitectureMismatch>
<!--2021-->
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug-2022|AnyCPU'">
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\Debug-2022\</OutputPath>
<DefineConstants>TRACE;DEBUG;Version2022</DefineConstants>
<DebugType>full</DebugType>
<PlatformTarget>x64</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
<RevitVersion>2022</RevitVersion>
<AssemblyName>$(AssemblyName)</AssemblyName>
<Prefer32Bit>false</Prefer32Bit>
<StartAction>Program</StartAction>
<StartProgram>C:\Program Files\Autodesk\Revit 2022\Revit.exe</StartProgram>
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release-2022|AnyCPU'">
<OutputPath>bin\Release-2022\</OutputPath>
<DefineConstants>TRACE;RELEASE;Version2022</DefineConstants>
<Optimize>true</Optimize>
<DebugType>pdbonly</DebugType>
<PlatformTarget>AnyCPU</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
<RevitVersion>2022</RevitVersion>
<AssemblyName>$(AssemblyName)</AssemblyName>
<WarningLevel>0</WarningLevel>
<ResolveAssemblyWarnOrErrorOnTargetArchitectureMismatch>
None
</ResolveAssemblyWarnOrErrorOnTargetArchitectureMismatch>
<Prefer32Bit>false</Prefer32Bit>
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
</PropertyGroup>

<Prefer32Bit>false</Prefer32Bit>
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
</PropertyGroup>
<!-- MULTIVERSION CONFIGURATION END -->
<ItemGroup>
<!-- MULTIVERSION REVIT API REFERENCES START -->
<!-- DEBUG -->
<!-- 2015 -->
<!-- 2016 -->
<!-- 2017 -->
<Reference Include="RevitAPI" Condition="'$(Configuration)' == 'Debug-2017'">
<HintPath>C:\Program Files\Autodesk\Revit 2017\RevitAPI.dll</HintPath>
<Reference Include="AdWindows, Version=5.0.3.1, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Revit_All_Main_Versions_API_x64.2024.0.0\lib\net48\AdWindows.dll</HintPath>
<SpecificVersion>False</SpecificVersion>
<Private>False</Private>
</Reference>
<Reference Include="RevitAPIUI" Condition="'$(Configuration)' == 'Debug-2017'">
<HintPath>C:\Program Files\Autodesk\Revit 2017\RevitAPIUI.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="RevitAPIUI" Condition="'$(Configuration)' == 'Debug-2017'">
<HintPath>C:\Program Files\Autodesk\Revit 2017\RevitAPIIFC.dll</HintPath>
<Reference Include="RevitAPI, Version=24.0.0.0, Culture=neutral, processorArchitecture=AMD64">
<HintPath>..\packages\Revit_All_Main_Versions_API_x64.2024.0.0\lib\net48\RevitAPI.dll</HintPath>
<SpecificVersion>False</SpecificVersion>
<Private>False</Private>
</Reference>
<!-- 2018 -->
<Reference Include="RevitAPI" Condition="'$(Configuration)' == 'Debug-2018'">
<HintPath>C:\Program Files\Autodesk\Revit 2018\RevitAPI.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="RevitAPIUI" Condition="'$(Configuration)' == 'Debug-2018'">
<HintPath>C:\Program Files\Autodesk\Revit 2018\RevitAPIUI.dll</HintPath>
<Private>False</Private>
Expand Down Expand Up @@ -379,19 +372,19 @@
<HintPath>C:\Program Files\Autodesk\Revit 2021\RevitAPIIFC.dll</HintPath>
<Private>False</Private>
</Reference>
<!-- 2022 -->
<Reference Include="RevitAPI" Condition="'$(Configuration)' == 'Debug-2022'">
<HintPath>C:\Program Files\Autodesk\Revit 2022\RevitAPI.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="RevitAPIUI" Condition="'$(Configuration)' == 'Debug-2022'">
<HintPath>C:\Program Files\Autodesk\Revit 2022\RevitAPIUI.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="RevitAPIUI" Condition="'$(Configuration)' == 'Debug-2022'">
<HintPath>C:\Program Files\Autodesk\Revit 2022\RevitAPIIFC.dll</HintPath>
<Private>False</Private>
</Reference>
<!-- 2022 -->
<Reference Include="RevitAPI" Condition="'$(Configuration)' == 'Debug-2022'">
<HintPath>C:\Program Files\Autodesk\Revit 2022\RevitAPI.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="RevitAPIUI" Condition="'$(Configuration)' == 'Debug-2022'">
<HintPath>C:\Program Files\Autodesk\Revit 2022\RevitAPIUI.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="RevitAPIUI" Condition="'$(Configuration)' == 'Debug-2022'">
<HintPath>C:\Program Files\Autodesk\Revit 2022\RevitAPIIFC.dll</HintPath>
<Private>False</Private>
</Reference>
<!-- RELEASE -->
<!-- 2015 -->
<Reference Include="RevitAPI" Condition="'$(Configuration)' == 'Release-2015'">
Expand Down Expand Up @@ -484,30 +477,40 @@
<HintPath>C:\Program Files\Autodesk\Revit 2021\RevitAPIIFC.dll</HintPath>
<Private>False</Private>
</Reference>
<!--2022-->
<Reference Include="RevitAPI" Condition="'$(Configuration)' == 'Release-2022'">
<HintPath>C:\Program Files\Autodesk\Revit 2022\RevitAPI.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="RevitAPIUI" Condition="'$(Configuration)' == 'Release-2022'">
<HintPath>C:\Program Files\Autodesk\Revit 2022\RevitAPIUI.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="RevitAPIUI" Condition="'$(Configuration)' == 'Release-2022'">
<HintPath>C:\Program Files\Autodesk\Revit 2022\RevitAPIIFC.dll</HintPath>
<Private>False</Private>
</Reference>
<!--2022-->
<Reference Include="RevitAPI" Condition="'$(Configuration)' == 'Release-2022'">
<HintPath>C:\Program Files\Autodesk\Revit 2022\RevitAPI.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="RevitAPIUI" Condition="'$(Configuration)' == 'Release-2022'">
<HintPath>C:\Program Files\Autodesk\Revit 2022\RevitAPIUI.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="RevitAPIUI" Condition="'$(Configuration)' == 'Release-2022'">
<HintPath>C:\Program Files\Autodesk\Revit 2022\RevitAPIIFC.dll</HintPath>
<Private>False</Private>
</Reference>
<!-- MULTIVERSION REVIT API REFERENCES END -->
<Reference Include="RevitAPIUI">
<HintPath>C:\Program Files\Autodesk\Revit 2016\RevitAPIUI.dll</HintPath>
</Reference>
<Reference Include="RevitAPIUI, Version=24.0.0.0, Culture=neutral, processorArchitecture=AMD64">
<HintPath>..\packages\Revit_All_Main_Versions_API_x64.2024.0.0\lib\net48\RevitAPIUI.dll</HintPath>
<SpecificVersion>False</SpecificVersion>
<Private>False</Private>
</Reference>
<Reference Include="System" />
<Reference Include="System.configuration" />
<Reference Include="System.Xml" />
<Reference Include="System.Core" />
<Reference Include="System.Xaml">
<RequiredTargetFramework>4.0</RequiredTargetFramework>
</Reference>
<Reference Include="UIFramework, Version=24.0.0.0, Culture=neutral, processorArchitecture=AMD64">
<HintPath>..\packages\Revit_All_Main_Versions_API_x64.2024.0.0\lib\net48\UIFramework.dll</HintPath>
<SpecificVersion>False</SpecificVersion>
<Private>False</Private>
</Reference>
<Reference Include="WindowsBase" />
<Reference Include="PresentationCore" />
<Reference Include="PresentationFramework" />
Expand Down
12 changes: 0 additions & 12 deletions Bcfier.Revit/Data/RevitUtils.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,7 @@ public static ViewOrientation3D ConvertBasePoint(Document doc, XYZ c, XYZ view,
//if BPL is set to 0,0,0 not always it corresponds to Revit's origin

XYZ origin = new XYZ(0, 0, 0);
#if Version2019 || Version2020 || Version2021 || Version2022
ProjectPosition position = doc.ActiveProjectLocation.GetProjectPosition(origin);
#else
ProjectPosition position = doc.ActiveProjectLocation.get_ProjectPosition(origin);
#endif

int i = (negative) ? -1 : 1;

Expand Down Expand Up @@ -90,11 +86,7 @@ public static XYZ GetRevitXYZ(Point d)
/// <returns></returns>
public static double ToMeters(this double feet)
{
#if Version2021 || Version2022
return UnitUtils.ConvertFromInternalUnits(feet, UnitTypeId.Meters);
#else
return UnitUtils.ConvertFromInternalUnits(feet, DisplayUnitType.DUT_METERS);
#endif
}
/// <summary>
/// Converts meters units to feet
Expand All @@ -103,11 +95,7 @@ public static double ToMeters(this double feet)
/// <returns></returns>
public static double ToFeet(this double meters)
{
#if Version2021 || Version2022
return UnitUtils.ConvertToInternalUnits(meters, UnitTypeId.Meters);
#else
return UnitUtils.ConvertToInternalUnits(meters, DisplayUnitType.DUT_METERS);
#endif

}
}
Expand Down
3 changes: 2 additions & 1 deletion Bcfier.Revit/Entry/CmdMain.cs
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,10 @@ public class CmdMain : IExternalCommand

#endif

public const string RevitVersion = "2024";


internal static CmdMain ThisCmd = null;
internal static CmdMain ThisCmd = null;
private static bool _isRunning;
private static ExtAppBcfier _extAppBcfier;

Expand Down
2 changes: 1 addition & 1 deletion Bcfier.Revit/Properties/Resources.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Bcfier.Revit/Properties/Settings.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Bcfier.Revit/packages.config
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="RestSharp" version="104.4.0" targetFramework="net40" />
<package id="Revit_All_Main_Versions_API_x64" version="2024.0.0" targetFramework="net481" />
</packages>
Loading

0 comments on commit d4a8ba8

Please sign in to comment.