Skip to content

Commit 33109fd

Browse files
committed
Merge branch 'dev/revit2022'
2 parents 7a7654f + 7435716 commit 33109fd

File tree

5 files changed

+92
-11
lines changed

5 files changed

+92
-11
lines changed
Binary file not shown.

PythonConsoleControl/PythonConsoleControl.csproj

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
2019 | net47
1717
2020 | net471
1818
2021 | net48
19+
2022 | net48
1920
For example you can exclude Revit 2014, by simply removing net40 target belows
2021
-->
2122
<TargetFrameworks>net40;net45;net451;net452;net46;net47;net471;net48</TargetFrameworks>
@@ -57,6 +58,9 @@
5758
<PropertyGroup Condition=" '$(TargetFramework)' == 'net48' ">
5859
<RevitVersion>2021</RevitVersion>
5960
</PropertyGroup>
61+
<PropertyGroup Condition=" '$(TargetFramework)' == 'net48' ">
62+
<RevitVersion>2022</RevitVersion>
63+
</PropertyGroup>
6064

6165
<PropertyGroup>
6266
<!-- Forcibly set platform to 'x64' and ignore architecture-related problems -->
@@ -104,8 +108,9 @@
104108
<PackageReference Include="Autodesk.Revit.SDK" Version="2019.*" Condition=" '$(RevitVersion)' == '2019' " PrivateAssets="All" />
105109
<PackageReference Include="Autodesk.Revit.SDK" Version="2020.1.0" Condition=" '$(RevitVersion)' == '2020' " PrivateAssets="All" />
106110
<PackageReference Include="Autodesk.Revit.SDK" Version="2021.*" Condition=" '$(RevitVersion)' == '2021' " PrivateAssets="All" />
107-
<PackageReference Include="AvalonEdit" Version="6.0.1"/>
108-
111+
<PackageReference Include="Autodesk.Revit.SDK" Version="2022.*" Condition=" '$(RevitVersion)' == '2022' " PrivateAssets="All" />
112+
<PackageReference Include="AvalonEdit" Version="6.0.1" />
113+
109114
</ItemGroup>
110115

111116
<Target Name="PreventRevitSDKCopyLocal" AfterTargets="ResolveReferences">
@@ -132,8 +137,8 @@
132137
<HintPath>..\RequiredLibraries\Microsoft.Scripting.Metadata.dll</HintPath>
133138
</Reference>
134139
</ItemGroup>
135-
136-
140+
141+
137142
<ItemGroup>
138143
<Reference Include="PresentationCore" />
139144
<Reference Include="PresentationFramework" />

RevitPythonShell/RevitPythonShell.csproj

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
2019 | net47
1717
2020 | net471
1818
2021 | net48
19+
2022 | net48
1920
For example you can exclude Revit 2014, by simply removing net40 target belows
2021
-->
2122
<TargetFrameworks>net40;net45;net451;net452;net46;net47;net471;net48</TargetFrameworks>
@@ -58,6 +59,9 @@
5859
<PropertyGroup Condition=" '$(TargetFramework)' == 'net48' ">
5960
<RevitVersion>2021</RevitVersion>
6061
</PropertyGroup>
62+
<PropertyGroup Condition=" '$(TargetFramework)' == 'net48' ">
63+
<RevitVersion>2022</RevitVersion>
64+
</PropertyGroup>
6165
<PropertyGroup>
6266
<!-- Forcibly set platform to 'x64' and ignore architecture-related problems -->
6367
<PlatformTarget>x64</PlatformTarget>
@@ -112,7 +116,8 @@
112116
<PackageReference Include="Autodesk.Revit.SDK" Version="2019.*" Condition=" '$(RevitVersion)' == '2019' " PrivateAssets="All" />
113117
<PackageReference Include="Autodesk.Revit.SDK" Version="2020.*" Condition=" '$(RevitVersion)' == '2020' " PrivateAssets="All" />
114118
<PackageReference Include="Autodesk.Revit.SDK" Version="2021.*" Condition=" '$(RevitVersion)' == '2021' " PrivateAssets="All" />
115-
<PackageReference Include="AvalonEdit" Version="6.0.1"/>
119+
<PackageReference Include="Autodesk.Revit.SDK" Version="2022.*" Condition=" '$(RevitVersion)' == '2022' " PrivateAssets="All" />
120+
<PackageReference Include="AvalonEdit" Version="6.0.1" />
116121
</ItemGroup>
117122

118123
<Target Name="PreventRevitSDKCopyLocal" AfterTargets="ResolveReferences">
@@ -139,7 +144,7 @@
139144
<HintPath>..\RequiredLibraries\Microsoft.Scripting.Metadata.dll</HintPath>
140145
</Reference>
141146
</ItemGroup>
142-
147+
143148
<ItemGroup>
144149
<Reference Include="PresentationCore" />
145150
<Reference Include="PresentationFramework" />
@@ -266,7 +271,7 @@
266271
<ReplaceFileText Condition="'$(Configuration)' == 'Release'" InputFilename="@(AddinManifest)" OutputFilename="@(AddinManifest)" MatchExpression="Assembly&gt;(.*?)&lt;" ReplacementText="Assembly&gt;$(AssemblyName).dll&lt;" />
267272
<ReplaceFileText Condition="$(Configuration.Contains('Debug'))" InputFilename="@(AddinManifest)" OutputFilename="@(AddinManifest)" MatchExpression="Assembly&gt;(.*?)&lt;" ReplacementText="Assembly&gt;$([System.IO.Path]::GetFullPath('$(OutputPath)'))$(AssemblyName).dll&lt;" />
268273
</Target>
269-
274+
270275
<Target Name="CreateInnoSetupFile" AfterTargets="AfterBuild" Condition="'$(Configuration)' == 'Release'">
271276
<PropertyGroup>
272277
<OutputDirPath>$(SolutionName)\bin\$(Configuration)\$(RevitVersion)\</OutputDirPath>

RpsRuntime/RpsRuntime.csproj

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@
1515
2018 | net46
1616
2019 | net47
1717
2020 | net471
18-
2021 | net472
18+
2021 | net48
19+
2022 | net48
1920
For example you can exclude Revit 2014, by simply removing net40 target belows
2021
-->
2122
<TargetFrameworks>net40;net45;net451;net452;net46;net47;net471;net48</TargetFrameworks>
@@ -56,6 +57,9 @@
5657
<PropertyGroup Condition=" '$(TargetFramework)' == 'net48' ">
5758
<RevitVersion>2021</RevitVersion>
5859
</PropertyGroup>
60+
<PropertyGroup Condition=" '$(TargetFramework)' == 'net48' ">
61+
<RevitVersion>2022</RevitVersion>
62+
</PropertyGroup>
5963

6064
<PropertyGroup>
6165
<!-- Forcibly set platform to 'x64' and ignore architecture-related problems -->
@@ -108,7 +112,8 @@
108112
<PackageReference Include="Autodesk.Revit.SDK" Version="2019.*" Condition=" '$(RevitVersion)' == '2019' " PrivateAssets="All" />
109113
<PackageReference Include="Autodesk.Revit.SDK" Version="2020.1.0" Condition=" '$(RevitVersion)' == '2020' " PrivateAssets="All" />
110114
<PackageReference Include="Autodesk.Revit.SDK" Version="2021.*" Condition=" '$(RevitVersion)' == '2021' " PrivateAssets="All" />
111-
<PackageReference Include="AvalonEdit" Version="6.0.1"/>
115+
<PackageReference Include="Autodesk.Revit.SDK" Version="2022.*" Condition=" '$(RevitVersion)' == '2022' " PrivateAssets="All" />
116+
<PackageReference Include="AvalonEdit" Version="6.0.1" />
112117
</ItemGroup>
113118

114119
<Target Name="PreventRevitSDKCopyLocal" AfterTargets="ResolveReferences">
@@ -117,7 +122,7 @@
117122
<ReferenceCopyLocalPaths Remove="@(ReferenceCopyLocalPaths)" Condition="'%(ReferenceCopyLocalPaths.NuGetPackageId)' == 'Autodesk.Revit.SDK'" />
118123
</ItemGroup>
119124
</Target>
120-
125+
121126
<ItemGroup>
122127
<Reference Include="IronPython">
123128
<HintPath>..\RequiredLibraries\IronPython.dll</HintPath>
@@ -138,7 +143,7 @@
138143
<HintPath>..\RequiredLibraries\Microsoft.CSharp.dll</HintPath>
139144
</Reference>
140145
</ItemGroup>
141-
146+
142147
<ItemGroup>
143148
<Reference Include="PresentationCore" />
144149
<Reference Include="System" />

Setup_RevitPythonShell_2022.iss

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
[Files]
2+
Source: "RevitPythonShell\bin\Release\2022\PythonConsoleControl.dll"; DestDir: "{app}"; Flags: replacesameversion
3+
Source: "RevitPythonShell\bin\Release\2022\RevitPythonShell.dll"; DestDir: "{app}"; Flags: replacesameversion
4+
Source: "RevitPythonShell\bin\Release\2022\RpsRuntime.dll"; DestDir: "{app}"; Flags: replacesameversion
5+
Source: "RevitPythonShell\bin\Release\2022\RevitPythonShell.addin"; DestDir: "{userappdata}\Autodesk\Revit\Addins\2022"; Flags: replacesameversion
6+
Source: "RevitPythonShell\bin\Release\2022\ICSharpCode.AvalonEdit.dll"; DestDir: "{app}"
7+
Source: "RevitPythonShell\bin\Release\2022\IronPython.dll"; DestDir: "{app}"
8+
Source: "RevitPythonShell\bin\Release\2022\IronPython.Modules.dll"; DestDir: "{app}"
9+
Source: "RevitPythonShell\bin\Release\2022\Microsoft.Scripting.Metadata.dll"; DestDir: "{app}"
10+
Source: "RevitPythonShell\bin\Release\2022\Microsoft.Dynamic.dll"; DestDir: "{app}"
11+
Source: "RevitPythonShell\bin\Release\2022\Microsoft.Scripting.dll"; DestDir: "{app}"
12+
Source: "RevitPythonShell\bin\Release\2022\DefaultConfig\RevitPythonShell.xml"; DestDir: "{userappdata}\RevitPythonShell\2022"; Flags: onlyifdoesntexist
13+
Source: "RevitPythonShell\bin\Release\2022\DefaultConfig\init.py"; DestDir: {userappdata}\RevitPythonShell\2022; Flags: confirmoverwrite;
14+
Source: "RevitPythonShell\bin\Release\2022\DefaultConfig\startup.py"; DestDir: {userappdata}\RevitPythonShell\2022; Flags: confirmoverwrite;
15+
16+
17+
[code]
18+
{ HANDLE INSTALL PROCESS STEPS }
19+
procedure CurStepChanged(CurStep: TSetupStep);
20+
var
21+
AddInFilePath: String;
22+
LoadedFile : TStrings;
23+
AddInFileContents: String;
24+
ReplaceString: String;
25+
SearchString: String;
26+
begin
27+
28+
if CurStep = ssPostInstall then
29+
begin
30+
31+
AddinFilePath := ExpandConstant('{userappdata}\Autodesk\Revit\Addins\2022\RevitPythonShell.addin');
32+
LoadedFile := TStringList.Create;
33+
SearchString := 'Assembly>RevitPythonShell.dll<';
34+
ReplaceString := 'Assembly>' + ExpandConstant('{app}') + '\RevitPythonShell.dll<';
35+
36+
try
37+
LoadedFile.LoadFromFile(AddInFilePath);
38+
AddInFileContents := LoadedFile.Text;
39+
40+
{ Only save if text has been changed. }
41+
if StringChangeEx(AddInFileContents, SearchString, ReplaceString, True) > 0 then
42+
begin;
43+
LoadedFile.Text := AddInFileContents;
44+
LoadedFile.SaveToFile(AddInFilePath);
45+
end;
46+
finally
47+
LoadedFile.Free;
48+
end;
49+
50+
end;
51+
end;
52+
53+
[Setup]
54+
AppName=RevitPythonShell for Autodesk Revit 2022
55+
AppVerName=RevitPythonShell for Autodesk Revit 2022
56+
RestartIfNeededByRun=false
57+
DefaultDirName={pf32}\RevitPythonShell\2022
58+
OutputBaseFilename=Setup_RevitPythonShell_2022
59+
ShowLanguageDialog=auto
60+
FlatComponentsList=false
61+
UninstallFilesDir={app}\Uninstall
62+
UninstallDisplayName=RevitPythonShell for Autodesk Revit 2022
63+
AppVersion=2022.0
64+
VersionInfoVersion=2022.0
65+
VersionInfoDescription=RevitPythonShell for Autodesk Revit 2022
66+
VersionInfoTextVersion=RevitPythonShell for Autodesk Revit 2022

0 commit comments

Comments
 (0)