Skip to content

Commit f9ca6d6

Browse files
authored
Merge pull request #112 from GertjanVDBVK/master
Added Revit 2021 build targets & assembly references for dotnet48
2 parents 59c1392 + 7cc5392 commit f9ca6d6

File tree

6 files changed

+96
-17
lines changed

6 files changed

+96
-17
lines changed

PythonConsoleControl/PythonConsoleControl.csproj

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,10 @@
1515
2018 | net46
1616
2019 | net47
1717
2020 | net471
18+
2021 | net48
1819
For example you can exclude Revit 2014, by simply removing net40 target belows
1920
-->
20-
<TargetFrameworks>net40;net45;net451;net452;net46;net47;net471</TargetFrameworks>
21+
<TargetFrameworks>net40;net45;net451;net452;net46;net47;net471;net48</TargetFrameworks>
2122
<RuntimeIdentifiers>win</RuntimeIdentifiers>
2223
<PublishSingleFile>true</PublishSingleFile>
2324
</PropertyGroup>
@@ -29,7 +30,7 @@
2930
e.g. if you want to debug ONLY Revit 2019,
3031
put net47 below and switch to 'Debug One' configuration
3132
-->
32-
<TargetFrameworks>net40</TargetFrameworks>
33+
<TargetFrameworks>net48</TargetFrameworks>
3334
</PropertyGroup>
3435

3536
<PropertyGroup Condition=" '$(TargetFramework)' == 'net40' ">
@@ -53,6 +54,9 @@
5354
<PropertyGroup Condition=" '$(TargetFramework)' == 'net471' ">
5455
<RevitVersion>2020</RevitVersion>
5556
</PropertyGroup>
57+
<PropertyGroup Condition=" '$(TargetFramework)' == 'net48' ">
58+
<RevitVersion>2021</RevitVersion>
59+
</PropertyGroup>
5660

5761
<PropertyGroup>
5862
<!-- Forcibly set platform to 'x64' and ignore architecture-related problems -->
@@ -99,6 +103,7 @@
99103
<PackageReference Include="Autodesk.Revit.SDK" Version="2018.*" Condition=" '$(RevitVersion)' == '2018' " PrivateAssets="All" />
100104
<PackageReference Include="Autodesk.Revit.SDK" Version="2019.*" Condition=" '$(RevitVersion)' == '2019' " PrivateAssets="All" />
101105
<PackageReference Include="Autodesk.Revit.SDK" Version="2020.1.0" Condition=" '$(RevitVersion)' == '2020' " PrivateAssets="All" />
106+
<PackageReference Include="Autodesk.Revit.SDK" Version="2021.*" Condition=" '$(RevitVersion)' == '2021' " PrivateAssets="All" />
102107
<PackageReference Include="AvalonEdit" Version="6.0.1"/>
103108

104109
</ItemGroup>

RevitPythonShell/Properties/launchSettings.json

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,50 +3,46 @@
33
"Revit 2020": {
44
"commandName": "Executable",
55
"executablePath": "%ProgramW6432%\\Autodesk\\Revit 2020\\Revit.exe",
6-
"commandLineArgs": "",
76
"use64Bit": true
87
},
98
"Revit 2020 W Drive": {
109
"commandName": "Executable",
1110
"executablePath": "W:\\Program Files\\Autodesk\\Revit 2020\\Revit.exe",
12-
"commandLineArgs": "",
1311
"use64Bit": true
1412
},
1513
"Revit 2019": {
1614
"commandName": "Executable",
1715
"executablePath": "%ProgramW6432%\\Autodesk\\Revit 2019\\Revit.exe",
18-
"commandLineArgs": "",
1916
"use64Bit": true
2017
},
2118
"Revit 2018": {
2219
"commandName": "Executable",
2320
"executablePath": "%ProgramW6432%\\Autodesk\\Revit 2018\\Revit.exe",
24-
"commandLineArgs": "",
2521
"use64Bit": true
2622
},
2723
"Revit 2017": {
2824
"commandName": "Executable",
2925
"executablePath": "%ProgramW6432%\\Autodesk\\Revit 2017\\Revit.exe",
30-
"commandLineArgs": "",
3126
"use64Bit": true
3227
},
3328
"Revit 2016": {
3429
"commandName": "Executable",
3530
"executablePath": "%ProgramW6432%\\Autodesk\\Revit 2016\\Revit.exe",
36-
"commandLineArgs": "",
3731
"use64Bit": true
3832
},
3933
"Revit 2015": {
4034
"commandName": "Executable",
4135
"executablePath": "%ProgramW6432%\\Autodesk\\Revit 2015\\Revit.exe",
42-
"commandLineArgs": "",
4336
"use64Bit": true
4437
},
4538
"Revit 2014": {
4639
"commandName": "Executable",
4740
"executablePath": "%ProgramW6432%\\Autodesk\\Revit 2014\\Revit.exe",
48-
"commandLineArgs": "",
4941
"use64Bit": true
42+
},
43+
"Revit 2021": {
44+
"commandName": "Executable",
45+
"executablePath": "%ProgramW6432%\\Autodesk\\Revit 2021\\Revit.exe"
5046
}
5147
}
5248
}

RevitPythonShell/RevitPythonShell.csproj

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,10 @@
1515
2018 | net46
1616
2019 | net47
1717
2020 | net471
18+
2021 | net48
1819
For example you can exclude Revit 2014, by simply removing net40 target belows
1920
-->
20-
<TargetFrameworks>net40;net45;net451;net452;net46;net47;net471</TargetFrameworks>
21+
<TargetFrameworks>net40;net45;net451;net452;net46;net47;net471;net48</TargetFrameworks>
2122
<RuntimeIdentifiers>win</RuntimeIdentifiers>
2223
<PublishSingleFile>true</PublishSingleFile>
2324
<PublishTrimmed>true</PublishTrimmed>
@@ -30,7 +31,7 @@
3031
e.g. if you want to debug ONLY Revit 2019,
3132
put net47 below and switch to 'Debug One' configuration
3233
-->
33-
<TargetFrameworks>net471</TargetFrameworks>
34+
<TargetFrameworks>net48</TargetFrameworks>
3435
</PropertyGroup>
3536

3637
<PropertyGroup Condition=" '$(TargetFramework)' == 'net40' ">
@@ -54,7 +55,9 @@
5455
<PropertyGroup Condition=" '$(TargetFramework)' == 'net471' ">
5556
<RevitVersion>2020</RevitVersion>
5657
</PropertyGroup>
57-
58+
<PropertyGroup Condition=" '$(TargetFramework)' == 'net48' ">
59+
<RevitVersion>2021</RevitVersion>
60+
</PropertyGroup>
5861
<PropertyGroup>
5962
<!-- Forcibly set platform to 'x64' and ignore architecture-related problems -->
6063
<PlatformTarget>x64</PlatformTarget>
@@ -91,7 +94,7 @@
9194
<OutputPath>.\bin\$(Configuration)\$(RevitVersion)</OutputPath>
9295
</PropertyGroup>
9396

94-
<PropertyGroup Condition="'$(Configuration)|$(TargetFramework)|$(Platform)'=='Debug One|net471|x64'">
97+
<PropertyGroup Condition="'$(Configuration)|$(TargetFramework)|$(Platform)'=='Debug One|net48|x64'">
9598
<Optimize>false</Optimize>
9699
</PropertyGroup>
97100

@@ -108,6 +111,7 @@
108111
<PackageReference Include="Autodesk.Revit.SDK" Version="2018.*" Condition=" '$(RevitVersion)' == '2018' " PrivateAssets="All" />
109112
<PackageReference Include="Autodesk.Revit.SDK" Version="2019.*" Condition=" '$(RevitVersion)' == '2019' " PrivateAssets="All" />
110113
<PackageReference Include="Autodesk.Revit.SDK" Version="2020.*" Condition=" '$(RevitVersion)' == '2020' " PrivateAssets="All" />
114+
<PackageReference Include="Autodesk.Revit.SDK" Version="2021.*" Condition=" '$(RevitVersion)' == '2021' " PrivateAssets="All" />
111115
<PackageReference Include="AvalonEdit" Version="6.0.1"/>
112116
</ItemGroup>
113117

RevitPythonShell/RevitPythonShell.csproj.user

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,12 @@
44
<DebuggerFlavor>ProjectDebugger</DebuggerFlavor>
55
</PropertyGroup>
66
<PropertyGroup>
7-
<ActiveDebugProfile>Revit 2020 W Drive</ActiveDebugProfile>
7+
<ActiveDebugProfile>Revit 2021</ActiveDebugProfile>
88
<ShowAllFiles>false</ShowAllFiles>
99
</PropertyGroup>
10+
<PropertyGroup Condition="'$(Configuration)|$(TargetFramework)|$(Platform)'=='Debug One|net472|x64'">
11+
<DebuggerFlavor>ProjectDebugger</DebuggerFlavor>
12+
</PropertyGroup>
1013
<ItemGroup>
1114
<None Update="Manifests\AddinTemplate.addin">
1215
<SubType>Designer</SubType>

RpsRuntime/RpsRuntime.csproj

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,10 @@
1515
2018 | net46
1616
2019 | net47
1717
2020 | net471
18+
2021 | net472
1819
For example you can exclude Revit 2014, by simply removing net40 target belows
1920
-->
20-
<TargetFrameworks>net40;net45;net451;net452;net46;net47;net471</TargetFrameworks>
21+
<TargetFrameworks>net40;net45;net451;net452;net46;net47;net471;net48</TargetFrameworks>
2122
<RuntimeIdentifiers>win</RuntimeIdentifiers>
2223
</PropertyGroup>
2324

@@ -28,7 +29,7 @@
2829
e.g. if you want to debug ONLY Revit 2019,
2930
put net47 below and switch to 'Debug One' configuration
3031
-->
31-
<TargetFrameworks>net471</TargetFrameworks>
32+
<TargetFrameworks>net48</TargetFrameworks>
3233
</PropertyGroup>
3334

3435
<PropertyGroup Condition=" '$(TargetFramework)' == 'net40' ">
@@ -52,6 +53,9 @@
5253
<PropertyGroup Condition=" '$(TargetFramework)' == 'net471' ">
5354
<RevitVersion>2020</RevitVersion>
5455
</PropertyGroup>
56+
<PropertyGroup Condition=" '$(TargetFramework)' == 'net48' ">
57+
<RevitVersion>2021</RevitVersion>
58+
</PropertyGroup>
5559

5660
<PropertyGroup>
5761
<!-- Forcibly set platform to 'x64' and ignore architecture-related problems -->
@@ -103,6 +107,7 @@
103107
<PackageReference Include="Autodesk.Revit.SDK" Version="2018.*" Condition=" '$(RevitVersion)' == '2018' " PrivateAssets="All" />
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" />
110+
<PackageReference Include="Autodesk.Revit.SDK" Version="2021.*" Condition=" '$(RevitVersion)' == '2021' " PrivateAssets="All" />
106111
<PackageReference Include="AvalonEdit" Version="6.0.1"/>
107112
</ItemGroup>
108113

Setup_RevitPythonShell_2021.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\2021\PythonConsoleControl.dll"; DestDir: "{app}"; Flags: replacesameversion
3+
Source: "RevitPythonShell\bin\Release\2021\RevitPythonShell.dll"; DestDir: "{app}"; Flags: replacesameversion
4+
Source: "RevitPythonShell\bin\Release\2021\RpsRuntime.dll"; DestDir: "{app}"; Flags: replacesameversion
5+
Source: "RevitPythonShell\bin\Release\2021\RevitPythonShell.addin"; DestDir: "{userappdata}\Autodesk\Revit\Addins\2021"; Flags: replacesameversion
6+
Source: "RevitPythonShell\bin\Release\2021\ICSharpCode.AvalonEdit.dll"; DestDir: "{app}"
7+
Source: "RevitPythonShell\bin\Release\2021\IronPython.dll"; DestDir: "{app}"
8+
Source: "RevitPythonShell\bin\Release\2021\IronPython.Modules.dll"; DestDir: "{app}"
9+
Source: "RevitPythonShell\bin\Release\2021\Microsoft.Scripting.Metadata.dll"; DestDir: "{app}"
10+
Source: "RevitPythonShell\bin\Release\2021\Microsoft.Dynamic.dll"; DestDir: "{app}"
11+
Source: "RevitPythonShell\bin\Release\2021\Microsoft.Scripting.dll"; DestDir: "{app}"
12+
Source: "RevitPythonShell\bin\Release\2021\DefaultConfig\RevitPythonShell.xml"; DestDir: "{userappdata}\RevitPythonShell\2021"; Flags: onlyifdoesntexist
13+
Source: "RevitPythonShell\bin\Release\2021\DefaultConfig\init.py"; DestDir: {userappdata}\RevitPythonShell\2021; Flags: confirmoverwrite;
14+
Source: "RevitPythonShell\bin\Release\2021\DefaultConfig\startup.py"; DestDir: {userappdata}\RevitPythonShell\2021; 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\2021\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 2021
55+
AppVerName=RevitPythonShell for Autodesk Revit 2021
56+
RestartIfNeededByRun=false
57+
DefaultDirName={pf32}\RevitPythonShell\2021
58+
OutputBaseFilename=Setup_RevitPythonShell_2021
59+
ShowLanguageDialog=auto
60+
FlatComponentsList=false
61+
UninstallFilesDir={app}\Uninstall
62+
UninstallDisplayName=RevitPythonShell for Autodesk Revit 2021
63+
AppVersion=2021.0
64+
VersionInfoVersion=2021.0
65+
VersionInfoDescription=RevitPythonShell for Autodesk Revit 2021
66+
VersionInfoTextVersion=RevitPythonShell for Autodesk Revit 2021

0 commit comments

Comments
 (0)