From 14ac9f866e453f9a659d9e5a984e73a866aad264 Mon Sep 17 00:00:00 2001 From: LetsBIMtogether <221650916+LetsBIMtogether@users.noreply.github.com> Date: Sat, 11 Oct 2025 01:32:24 -0400 Subject: [PATCH 1/2] Converted to SDK style project (Rvt 2019-2024) --- .gitignore | 6 +- ONBOXApp.sln | 152 +-- ONBOXApp/ONBOXApp.csproj | 1470 +++++++++++------------ ONBOXApp/PackageContents.xml | 37 + ONBOXApp/Properties/launchSettings.json | 82 ++ OnboxApp.bundle/PackageContents.xml | 8 + 6 files changed, 815 insertions(+), 940 deletions(-) create mode 100644 ONBOXApp/PackageContents.xml create mode 100644 ONBOXApp/Properties/launchSettings.json diff --git a/.gitignore b/.gitignore index d261f46..87d9c32 100644 --- a/.gitignore +++ b/.gitignore @@ -259,4 +259,8 @@ paket-files/ # Python Tools for Visual Studio (PTVS) __pycache__/ -*.pyc \ No newline at end of file +*.pyc + +# Ignore Windows thumbnail cache files +**/Thumbs.db + diff --git a/ONBOXApp.sln b/ONBOXApp.sln index daaf389..17b240c 100644 --- a/ONBOXApp.sln +++ b/ONBOXApp.sln @@ -1,156 +1,28 @@  Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio Version 17 -VisualStudioVersion = 17.5.33530.505 +VisualStudioVersion = 17.8.34309.116 MinimumVisualStudioVersion = 10.0.40219.1 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ONBOXApp", "ONBOXApp\ONBOXApp.csproj", "{59DC5911-8879-4F59-86E0-7499B48BB7A5}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ONBOXApp", "ONBOXApp\ONBOXApp.csproj", "{59DC5911-8879-4F59-86E0-7499B48BB7A5}" EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CanvasTests", "CanvasTests\CanvasTests.csproj", "{C60EF26F-9E50-4751-8D9C-9D067CEA8F18}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution - D2019|Any CPU = D2019|Any CPU - D2019|x64 = D2019|x64 - D2020|Any CPU = D2020|Any CPU - D2020|x64 = D2020|x64 - D2021|Any CPU = D2021|Any CPU - D2021|x64 = D2021|x64 - D2022|Any CPU = D2022|Any CPU - D2022|x64 = D2022|x64 - D2023|Any CPU = D2023|Any CPU - D2023|x64 = D2023|x64 - D2024|Any CPU = D2024|Any CPU - D2024|x64 = D2024|x64 - Debug|Any CPU = Debug|Any CPU + Debug One|x64 = Debug One|x64 Debug|x64 = Debug|x64 - R2019|Any CPU = R2019|Any CPU - R2019|x64 = R2019|x64 - R2020|Any CPU = R2020|Any CPU - R2020|x64 = R2020|x64 - R2021|Any CPU = R2021|Any CPU - R2021|x64 = R2021|x64 - R2022|Any CPU = R2022|Any CPU - R2022|x64 = R2022|x64 - R2023|Any CPU = R2023|Any CPU - R2023|x64 = R2023|x64 - R2024|Any CPU = R2024|Any CPU - R2024|x64 = R2024|x64 - Release|Any CPU = Release|Any CPU Release|x64 = Release|x64 EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution - {59DC5911-8879-4F59-86E0-7499B48BB7A5}.D2019|Any CPU.ActiveCfg = Debug2024|x64 - {59DC5911-8879-4F59-86E0-7499B48BB7A5}.D2019|Any CPU.Build.0 = Debug2024|x64 - {59DC5911-8879-4F59-86E0-7499B48BB7A5}.D2019|x64.ActiveCfg = Debug2019|x64 - {59DC5911-8879-4F59-86E0-7499B48BB7A5}.D2019|x64.Build.0 = Debug2019|x64 - {59DC5911-8879-4F59-86E0-7499B48BB7A5}.D2020|Any CPU.ActiveCfg = Debug2024|x64 - {59DC5911-8879-4F59-86E0-7499B48BB7A5}.D2020|Any CPU.Build.0 = Debug2024|x64 - {59DC5911-8879-4F59-86E0-7499B48BB7A5}.D2020|x64.ActiveCfg = Debug2020|x64 - {59DC5911-8879-4F59-86E0-7499B48BB7A5}.D2020|x64.Build.0 = Debug2020|x64 - {59DC5911-8879-4F59-86E0-7499B48BB7A5}.D2021|Any CPU.ActiveCfg = Debug2024|x64 - {59DC5911-8879-4F59-86E0-7499B48BB7A5}.D2021|Any CPU.Build.0 = Debug2024|x64 - {59DC5911-8879-4F59-86E0-7499B48BB7A5}.D2021|x64.ActiveCfg = Debug2021|x64 - {59DC5911-8879-4F59-86E0-7499B48BB7A5}.D2021|x64.Build.0 = Debug2021|x64 - {59DC5911-8879-4F59-86E0-7499B48BB7A5}.D2022|Any CPU.ActiveCfg = Debug2024|x64 - {59DC5911-8879-4F59-86E0-7499B48BB7A5}.D2022|Any CPU.Build.0 = Debug2024|x64 - {59DC5911-8879-4F59-86E0-7499B48BB7A5}.D2022|x64.ActiveCfg = Debug2022|x64 - {59DC5911-8879-4F59-86E0-7499B48BB7A5}.D2022|x64.Build.0 = Debug2022|x64 - {59DC5911-8879-4F59-86E0-7499B48BB7A5}.D2023|Any CPU.ActiveCfg = Debug2024|x64 - {59DC5911-8879-4F59-86E0-7499B48BB7A5}.D2023|Any CPU.Build.0 = Debug2024|x64 - {59DC5911-8879-4F59-86E0-7499B48BB7A5}.D2023|x64.ActiveCfg = Debug2023|x64 - {59DC5911-8879-4F59-86E0-7499B48BB7A5}.D2023|x64.Build.0 = Debug2023|x64 - {59DC5911-8879-4F59-86E0-7499B48BB7A5}.D2024|Any CPU.ActiveCfg = Debug2024|x64 - {59DC5911-8879-4F59-86E0-7499B48BB7A5}.D2024|Any CPU.Build.0 = Debug2024|x64 - {59DC5911-8879-4F59-86E0-7499B48BB7A5}.D2024|x64.ActiveCfg = Debug2024|x64 - {59DC5911-8879-4F59-86E0-7499B48BB7A5}.D2024|x64.Build.0 = Debug2024|x64 - {59DC5911-8879-4F59-86E0-7499B48BB7A5}.Debug|Any CPU.ActiveCfg = Debug2024|x64 - {59DC5911-8879-4F59-86E0-7499B48BB7A5}.Debug|Any CPU.Build.0 = Debug2024|x64 - {59DC5911-8879-4F59-86E0-7499B48BB7A5}.Debug|x64.ActiveCfg = Debug2024|x64 - {59DC5911-8879-4F59-86E0-7499B48BB7A5}.Debug|x64.Build.0 = Debug2024|x64 - {59DC5911-8879-4F59-86E0-7499B48BB7A5}.R2019|Any CPU.ActiveCfg = Release2024|x64 - {59DC5911-8879-4F59-86E0-7499B48BB7A5}.R2019|Any CPU.Build.0 = Release2024|x64 - {59DC5911-8879-4F59-86E0-7499B48BB7A5}.R2019|x64.ActiveCfg = Release2019|x64 - {59DC5911-8879-4F59-86E0-7499B48BB7A5}.R2019|x64.Build.0 = Release2019|x64 - {59DC5911-8879-4F59-86E0-7499B48BB7A5}.R2020|Any CPU.ActiveCfg = Release2024|x64 - {59DC5911-8879-4F59-86E0-7499B48BB7A5}.R2020|Any CPU.Build.0 = Release2024|x64 - {59DC5911-8879-4F59-86E0-7499B48BB7A5}.R2020|x64.ActiveCfg = Release2020|x64 - {59DC5911-8879-4F59-86E0-7499B48BB7A5}.R2020|x64.Build.0 = Release2020|x64 - {59DC5911-8879-4F59-86E0-7499B48BB7A5}.R2021|Any CPU.ActiveCfg = Release2024|x64 - {59DC5911-8879-4F59-86E0-7499B48BB7A5}.R2021|Any CPU.Build.0 = Release2024|x64 - {59DC5911-8879-4F59-86E0-7499B48BB7A5}.R2021|x64.ActiveCfg = Release2021|x64 - {59DC5911-8879-4F59-86E0-7499B48BB7A5}.R2021|x64.Build.0 = Release2021|x64 - {59DC5911-8879-4F59-86E0-7499B48BB7A5}.R2022|Any CPU.ActiveCfg = Release2024|x64 - {59DC5911-8879-4F59-86E0-7499B48BB7A5}.R2022|Any CPU.Build.0 = Release2024|x64 - {59DC5911-8879-4F59-86E0-7499B48BB7A5}.R2022|x64.ActiveCfg = Release2022|x64 - {59DC5911-8879-4F59-86E0-7499B48BB7A5}.R2022|x64.Build.0 = Release2022|x64 - {59DC5911-8879-4F59-86E0-7499B48BB7A5}.R2023|Any CPU.ActiveCfg = Release2024|x64 - {59DC5911-8879-4F59-86E0-7499B48BB7A5}.R2023|Any CPU.Build.0 = Release2024|x64 - {59DC5911-8879-4F59-86E0-7499B48BB7A5}.R2023|x64.ActiveCfg = Release2023|x64 - {59DC5911-8879-4F59-86E0-7499B48BB7A5}.R2023|x64.Build.0 = Release2023|x64 - {59DC5911-8879-4F59-86E0-7499B48BB7A5}.R2024|Any CPU.ActiveCfg = Release2024|x64 - {59DC5911-8879-4F59-86E0-7499B48BB7A5}.R2024|Any CPU.Build.0 = Release2024|x64 - {59DC5911-8879-4F59-86E0-7499B48BB7A5}.R2024|x64.ActiveCfg = Release2024|x64 - {59DC5911-8879-4F59-86E0-7499B48BB7A5}.R2024|x64.Build.0 = Release2024|x64 - {59DC5911-8879-4F59-86E0-7499B48BB7A5}.Release|Any CPU.ActiveCfg = Release2024|x64 - {59DC5911-8879-4F59-86E0-7499B48BB7A5}.Release|Any CPU.Build.0 = Release2024|x64 - {59DC5911-8879-4F59-86E0-7499B48BB7A5}.Release|x64.ActiveCfg = Release2024|x64 - {59DC5911-8879-4F59-86E0-7499B48BB7A5}.Release|x64.Build.0 = Release2024|x64 - {C60EF26F-9E50-4751-8D9C-9D067CEA8F18}.D2019|Any CPU.ActiveCfg = Debug|Any CPU - {C60EF26F-9E50-4751-8D9C-9D067CEA8F18}.D2019|Any CPU.Build.0 = Debug|Any CPU - {C60EF26F-9E50-4751-8D9C-9D067CEA8F18}.D2019|x64.ActiveCfg = Debug|Any CPU - {C60EF26F-9E50-4751-8D9C-9D067CEA8F18}.D2019|x64.Build.0 = Debug|Any CPU - {C60EF26F-9E50-4751-8D9C-9D067CEA8F18}.D2020|Any CPU.ActiveCfg = Debug|Any CPU - {C60EF26F-9E50-4751-8D9C-9D067CEA8F18}.D2020|Any CPU.Build.0 = Debug|Any CPU - {C60EF26F-9E50-4751-8D9C-9D067CEA8F18}.D2020|x64.ActiveCfg = Debug|Any CPU - {C60EF26F-9E50-4751-8D9C-9D067CEA8F18}.D2020|x64.Build.0 = Debug|Any CPU - {C60EF26F-9E50-4751-8D9C-9D067CEA8F18}.D2021|Any CPU.ActiveCfg = Debug|Any CPU - {C60EF26F-9E50-4751-8D9C-9D067CEA8F18}.D2021|Any CPU.Build.0 = Debug|Any CPU - {C60EF26F-9E50-4751-8D9C-9D067CEA8F18}.D2021|x64.ActiveCfg = Debug|Any CPU - {C60EF26F-9E50-4751-8D9C-9D067CEA8F18}.D2021|x64.Build.0 = Debug|Any CPU - {C60EF26F-9E50-4751-8D9C-9D067CEA8F18}.D2022|Any CPU.ActiveCfg = Debug|Any CPU - {C60EF26F-9E50-4751-8D9C-9D067CEA8F18}.D2022|Any CPU.Build.0 = Debug|Any CPU - {C60EF26F-9E50-4751-8D9C-9D067CEA8F18}.D2022|x64.ActiveCfg = Debug|Any CPU - {C60EF26F-9E50-4751-8D9C-9D067CEA8F18}.D2022|x64.Build.0 = Debug|Any CPU - {C60EF26F-9E50-4751-8D9C-9D067CEA8F18}.D2023|Any CPU.ActiveCfg = Debug|Any CPU - {C60EF26F-9E50-4751-8D9C-9D067CEA8F18}.D2023|Any CPU.Build.0 = Debug|Any CPU - {C60EF26F-9E50-4751-8D9C-9D067CEA8F18}.D2023|x64.ActiveCfg = Debug|Any CPU - {C60EF26F-9E50-4751-8D9C-9D067CEA8F18}.D2023|x64.Build.0 = Debug|Any CPU - {C60EF26F-9E50-4751-8D9C-9D067CEA8F18}.D2024|Any CPU.ActiveCfg = Debug|Any CPU - {C60EF26F-9E50-4751-8D9C-9D067CEA8F18}.D2024|Any CPU.Build.0 = Debug|Any CPU - {C60EF26F-9E50-4751-8D9C-9D067CEA8F18}.D2024|x64.ActiveCfg = Debug|Any CPU - {C60EF26F-9E50-4751-8D9C-9D067CEA8F18}.D2024|x64.Build.0 = Debug|Any CPU - {C60EF26F-9E50-4751-8D9C-9D067CEA8F18}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {C60EF26F-9E50-4751-8D9C-9D067CEA8F18}.Debug|Any CPU.Build.0 = Debug|Any CPU - {C60EF26F-9E50-4751-8D9C-9D067CEA8F18}.Debug|x64.ActiveCfg = Debug|Any CPU - {C60EF26F-9E50-4751-8D9C-9D067CEA8F18}.Debug|x64.Build.0 = Debug|Any CPU - {C60EF26F-9E50-4751-8D9C-9D067CEA8F18}.R2019|Any CPU.ActiveCfg = Release|Any CPU - {C60EF26F-9E50-4751-8D9C-9D067CEA8F18}.R2019|Any CPU.Build.0 = Release|Any CPU - {C60EF26F-9E50-4751-8D9C-9D067CEA8F18}.R2019|x64.ActiveCfg = Release|Any CPU - {C60EF26F-9E50-4751-8D9C-9D067CEA8F18}.R2019|x64.Build.0 = Release|Any CPU - {C60EF26F-9E50-4751-8D9C-9D067CEA8F18}.R2020|Any CPU.ActiveCfg = Release|Any CPU - {C60EF26F-9E50-4751-8D9C-9D067CEA8F18}.R2020|Any CPU.Build.0 = Release|Any CPU - {C60EF26F-9E50-4751-8D9C-9D067CEA8F18}.R2020|x64.ActiveCfg = Release|Any CPU - {C60EF26F-9E50-4751-8D9C-9D067CEA8F18}.R2020|x64.Build.0 = Release|Any CPU - {C60EF26F-9E50-4751-8D9C-9D067CEA8F18}.R2021|Any CPU.ActiveCfg = Release|Any CPU - {C60EF26F-9E50-4751-8D9C-9D067CEA8F18}.R2021|Any CPU.Build.0 = Release|Any CPU - {C60EF26F-9E50-4751-8D9C-9D067CEA8F18}.R2021|x64.ActiveCfg = Release|Any CPU - {C60EF26F-9E50-4751-8D9C-9D067CEA8F18}.R2021|x64.Build.0 = Release|Any CPU - {C60EF26F-9E50-4751-8D9C-9D067CEA8F18}.R2022|Any CPU.ActiveCfg = Release|Any CPU - {C60EF26F-9E50-4751-8D9C-9D067CEA8F18}.R2022|Any CPU.Build.0 = Release|Any CPU - {C60EF26F-9E50-4751-8D9C-9D067CEA8F18}.R2022|x64.ActiveCfg = Release|Any CPU - {C60EF26F-9E50-4751-8D9C-9D067CEA8F18}.R2022|x64.Build.0 = Release|Any CPU - {C60EF26F-9E50-4751-8D9C-9D067CEA8F18}.R2023|Any CPU.ActiveCfg = Release|Any CPU - {C60EF26F-9E50-4751-8D9C-9D067CEA8F18}.R2023|Any CPU.Build.0 = Release|Any CPU - {C60EF26F-9E50-4751-8D9C-9D067CEA8F18}.R2023|x64.ActiveCfg = Release|Any CPU - {C60EF26F-9E50-4751-8D9C-9D067CEA8F18}.R2023|x64.Build.0 = Release|Any CPU - {C60EF26F-9E50-4751-8D9C-9D067CEA8F18}.R2024|Any CPU.ActiveCfg = Release|Any CPU - {C60EF26F-9E50-4751-8D9C-9D067CEA8F18}.R2024|Any CPU.Build.0 = Release|Any CPU - {C60EF26F-9E50-4751-8D9C-9D067CEA8F18}.R2024|x64.ActiveCfg = Release|Any CPU - {C60EF26F-9E50-4751-8D9C-9D067CEA8F18}.R2024|x64.Build.0 = Release|Any CPU - {C60EF26F-9E50-4751-8D9C-9D067CEA8F18}.Release|Any CPU.ActiveCfg = Release|Any CPU - {C60EF26F-9E50-4751-8D9C-9D067CEA8F18}.Release|Any CPU.Build.0 = Release|Any CPU - {C60EF26F-9E50-4751-8D9C-9D067CEA8F18}.Release|x64.ActiveCfg = Release|Any CPU - {C60EF26F-9E50-4751-8D9C-9D067CEA8F18}.Release|x64.Build.0 = Release|Any CPU + {59DC5911-8879-4F59-86E0-7499B48BB7A5}.Debug One|x64.ActiveCfg = Debug One|x64 + {59DC5911-8879-4F59-86E0-7499B48BB7A5}.Debug One|x64.Build.0 = Debug One|x64 + {59DC5911-8879-4F59-86E0-7499B48BB7A5}.Debug|x64.ActiveCfg = Debug|x64 + {59DC5911-8879-4F59-86E0-7499B48BB7A5}.Debug|x64.Build.0 = Debug|x64 + {59DC5911-8879-4F59-86E0-7499B48BB7A5}.Release|x64.ActiveCfg = Release|x64 + {59DC5911-8879-4F59-86E0-7499B48BB7A5}.Release|x64.Build.0 = Release|x64 + {C60EF26F-9E50-4751-8D9C-9D067CEA8F18}.Debug One|x64.ActiveCfg = Debug|x64 + {C60EF26F-9E50-4751-8D9C-9D067CEA8F18}.Debug|x64.ActiveCfg = Debug|x64 + {C60EF26F-9E50-4751-8D9C-9D067CEA8F18}.Release|x64.ActiveCfg = Release|x64 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/ONBOXApp/ONBOXApp.csproj b/ONBOXApp/ONBOXApp.csproj index 0e4b69a..39d8e48 100644 --- a/ONBOXApp/ONBOXApp.csproj +++ b/ONBOXApp/ONBOXApp.csproj @@ -1,810 +1,682 @@ - - - - - Debug - AnyCPU - {59DC5911-8879-4F59-86E0-7499B48BB7A5} - Library - Properties - ONBOXAppl - ONBOXAppl - v4.7.2 - 512 - {60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - 4 - true - - - - - - - - - true - bin\x64\Debug2019\ - TRACE;DEBUG;R2019 - full - x64 - prompt - MinimumRecommendedRules.ruleset - true - - - true - bin\x64\Debug2020\ - v4.8 - TRACE;DEBUG;R2020 - full - x64 - prompt - MinimumRecommendedRules.ruleset - true - - - true - v4.8 - bin\x64\Debug2021\ - TRACE;DEBUG;R2021 - full - x64 - 7.3 - prompt - MinimumRecommendedRules.ruleset - true - - - true - v4.8 - bin\x64\Debug2022\ - TRACE;DEBUG;R2022 - full - x64 - 7.3 - prompt - MinimumRecommendedRules.ruleset - true - - - true - v4.8 - bin\x64\Debug2023\ - TRACE;DEBUG;R2023 - full - x64 - 7.3 - prompt - MinimumRecommendedRules.ruleset - true - - - true - v4.8 - bin\x64\Debug2024\ - TRACE;DEBUG;R2024 - full - x64 - 7.3 - prompt - MinimumRecommendedRules.ruleset - true - - - bin\x64\Release2019\ - TRACE;R2019 - true - pdbonly - x64 - prompt - MinimumRecommendedRules.ruleset - - - bin\x64\Release2020\ - v4.8 - TRACE;R2020 - true - pdbonly - x64 - prompt - MinimumRecommendedRules.ruleset - - - bin\x64\Release2021\ - v4.8 - TRACE;R2021 - true - pdbonly - x64 - 7.3 - prompt - MinimumRecommendedRules.ruleset - - - bin\x64\Release2022\ - v4.8 - TRACE;R2022 - true - pdbonly - x64 - 7.3 - prompt - MinimumRecommendedRules.ruleset - - - bin\x64\Release2023\ - v4.8 - TRACE;R2023 - true - pdbonly - x64 - 7.3 - prompt - MinimumRecommendedRules.ruleset - - - bin\x64\Release2024\ - TRACE;R2024 - v4.8 - true - pdbonly - x64 - 7.3 - prompt - MinimumRecommendedRules.ruleset - - - - C:\Program Files\Autodesk\Revit 2019\RevitAPI.dll - False - - - C:\Program Files\Autodesk\Revit 2019\RevitAPIUI.dll - False - - - C:\Program Files\Autodesk\Revit 2019\RevitAPIIFC.dll - False - - - - - C:\Program Files\Autodesk\Revit 2020\RevitAPI.dll - False - - - C:\Program Files\Autodesk\Revit 2020\RevitAPIUI.dll - False - - - C:\Program Files\Autodesk\Revit 2020\RevitAPIIFC.dll - False - - - - - C:\Program Files\Autodesk\Revit 2021\RevitAPI.dll - False - - - C:\Program Files\Autodesk\Revit 2021\RevitAPIUI.dll - False - - - C:\Program Files\Autodesk\Revit 2021\RevitAPIIFC.dll - False - - - - - C:\Program Files\Autodesk\Revit 2022\RevitAPI.dll - False - - - C:\Program Files\Autodesk\Revit 2022\RevitAPIUI.dll - False - - - C:\Program Files\Autodesk\Revit 2022\RevitAPIIFC.dll - False - - - - - C:\Program Files\Autodesk\Revit 2023\RevitAPI.dll - False - - - C:\Program Files\Autodesk\Revit 2023\RevitAPIUI.dll - False - - - C:\Program Files\Autodesk\Revit 2023\RevitAPIIFC.dll - False - - - - - C:\Program Files\Autodesk\Revit 2024\RevitAPI.dll - False - - - C:\Program Files\Autodesk\Revit 2024\RevitAPIUI.dll - False - - - C:\Program Files\Autodesk\Revit 2024\RevitAPIIFC.dll - False - - - - - - - - - - - - - - - - - - 4.0 - - - - - - - - - AboutUI.xaml - - - - ElementJoinSelectUI.xaml - - - - ElementsJoinUIAdvanced.xaml - - - - - BeamsFromEntireBuildingChooseStandardFloorsUI.xaml - - - BeamsFromEntireBuildingUI.xaml - - - - BeamsFromColumnsUI.xaml - - - - BeamsFromWallsUI.xaml - - - BeamsUpdateUI.xaml - - - - - ColumnsFromDwgUI.xaml - - - - ElementsCopyUI.xaml - - - - ElementsJoinUI.xaml - - - - ExceptionManagerUI.xaml - - - - - PrivacyUI.xaml - - - Code - - - True - True - HelpLinks.resx - - - True - True - HelpLinks.pt-BR.resx - - - True - True - Messages.resx - - - True - True - Resources.resx - - - True - True - RibbonLanguage.resx - - - True - Settings.settings - True - - - True - True - WindowLanguage.resx - - - - RenumberBeamsUI.xaml - - - RenumberBeamTypesUI.xaml - - - RenumberLevelPrefixUI.xaml - - - - RenumberColumnsLevelsUI.xaml - - - RenumberColumnsUI.xaml - - - RenumberColumnsTypeUI.xaml - - - RenumberColumnsSelectionUI.xaml - - - - - RenumberGridsUI.xaml - - - RenumberGridsAdvUI.xaml - - - - renumberBlocksUI.xaml - - - RenumberParkingCleanerUI.xaml - - - renumberParkingPrefixUI.xaml - - - renumberParkingUI.xaml - - - RenumberTypeUI.xaml - - - - RevitZipUI.xaml - - - - - Canvas.xaml - - - - - - - - TopoPointCloudUIAdvanced.xaml - - - - - - - - - - TopoSlopesUI.xaml - - - - - - PublicResXFileCodeGenerator - HelpLinks.pt-BR.Designer.cs - - - PublicResXFileCodeGenerator - HelpLinks.Designer.cs - - - - PublicResXFileCodeGenerator - Messages.Designer.cs - Designer - - - - ResXFileCodeGenerator - Resources.Designer.cs - - - - PublicResXFileCodeGenerator - RibbonLanguage.Designer.cs - - - - PublicResXFileCodeGenerator - WindowLanguage.Designer.cs - Designer - - - - SettingsSingleFileGenerator - Settings.Designer.cs - - - - - - MSBuild:Compile - Designer - - - Designer - MSBuild:Compile - - - MSBuild:Compile - Designer - - - MSBuild:Compile - Designer - - - MSBuild:Compile - Designer - - - MSBuild:Compile - Designer - - - MSBuild:Compile - Designer - - - MSBuild:Compile - Designer - - - MSBuild:Compile - Designer - - - MSBuild:Compile - Designer - - - MSBuild:Compile - Designer - - - MSBuild:Compile - Designer - - - Designer - MSBuild:Compile - - - MSBuild:Compile - Designer - - - MSBuild:Compile - Designer - - - MSBuild:Compile - Designer - - - MSBuild:Compile - Designer - - - MSBuild:Compile - Designer - - - MSBuild:Compile - Designer - - - MSBuild:Compile - Designer - - - MSBuild:Compile - Designer - - - MSBuild:Compile - Designer - - - MSBuild:Compile - Designer - - - MSBuild:Compile - Designer - - - MSBuild:Compile - Designer - - - MSBuild:Compile - Designer - - - MSBuild:Compile - Designer - - - Designer - MSBuild:Compile - - - MSBuild:Compile - Designer - - - Designer - MSBuild:Compile - - - Designer - MSBuild:Compile - - - MSBuild:Compile - Designer - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - echo Configuration: $(Configuration) + + + + false + + + + + + + -if $(Configuration) == Debug2017 goto D2017 -if $(Configuration) == Debug2018 goto D2018 -if $(Configuration) == Debug2019 goto D2019 -if $(Configuration) == Debug2020 goto D2020 -if $(Configuration) == Debug2021 goto D2021 -if $(Configuration) == Debug2022 goto D2022 -if $(Configuration) == Debug2023 goto D2023 -if $(Configuration) == Debug2024 goto D2024 + + + obj\$(Configuration)\$(TargetFramework)\ + true + true + -if $(Configuration) == Release2017 goto R2017 -if $(Configuration) == Release2018 goto R2018 -if $(Configuration) == Release2019 goto R2019 -if $(Configuration) == Release2020 goto R2020 -if $(Configuration) == Release2021 goto R2021 -if $(Configuration) == Release2022 goto R2022 -if $(Configuration) == Release2023 goto R2023 -if $(Configuration) == Release2024 goto R2024 + + Debug;Debug One;Release + x64 + Library + ONBOXAppl + ONBOXAppl + win -echo ######## INVALID CONFIGURATION SPECIFIED ######## + net47;net48; + 2024 + REVIT$(RevitVersion) + $(DefineConstants) + + x64 + None + false + false + false + ..\bin\$(Configuration)\$(RevitVersion) + false + -goto exit + + + {351668CC-8477-4fbf-BFE3-5F1006E4DB1F} + -:D2019 -echo Copying results to 2019 -if not exist "%25ProgramData%25\Autodesk\Revit\Addins\2019\ONBOX\" mkdir "%25ProgramData%25\Autodesk\Revit\Addins\2019\ONBOX\" -XCOPY "$(TargetDir)\*" "%25ProgramData%25\Autodesk\Revit\Addins\2019\ONBOX\" /Y /R /F /I /S -copy "$(ProjectDir)\ONBOXApp.addin" "%25ProgramData%25\Autodesk\Revit\Addins\2019\" -goto exit + + + true + + + + + + 2019 + ..\bin\$(Configuration)\$(RevitVersion) + + + + 2026 + true + ..\bin\$(Configuration)\$(RevitVersion) + + + + + net8.0-windows + + + + + $(DefineConstants);DEBUG + full + true + + + + + true + pdbonly + + + + + + + + + + + + + + + + + + + + + + 4.0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + -:D2020 -echo Copying results to 2020 -if not exist "%25ProgramData%25\Autodesk\Revit\Addins\2020\ONBOX\" mkdir "%25ProgramData%25\Autodesk\Revit\Addins\2020\ONBOX\" -XCOPY "$(TargetDir)\*" "%25ProgramData%25\Autodesk\Revit\Addins\2020\ONBOX\" /Y /R /F /I /S -copy "$(ProjectDir)\ONBOXApp.addin" "%25ProgramData%25\Autodesk\Revit\Addins\2020\" -goto exit + + + $(DefineConstants);REVIT2026UP + $(DefineConstants) + -:D2021 -echo Copying results to 2021 -if not exist "%25ProgramData%25\Autodesk\Revit\Addins\2021\ONBOX\" mkdir "%25ProgramData%25\Autodesk\Revit\Addins\2021\ONBOX\" -XCOPY "$(TargetDir)\*" "%25ProgramData%25\Autodesk\Revit\Addins\2021\ONBOX\" /Y /R /F /I /S -copy "$(ProjectDir)\ONBOXApp.addin" "%25ProgramData%25\Autodesk\Revit\Addins\2021\" -goto exit + + + $(DefineConstants);REVIT2025UP + $(DefineConstants) + -:D2022 -echo Copying results to 2022 -if not exist "%25ProgramData%25\Autodesk\Revit\Addins\2022\ONBOX\" mkdir "%25ProgramData%25\Autodesk\Revit\Addins\2022\ONBOX\" -XCOPY "$(TargetDir)\*" "%25ProgramData%25\Autodesk\Revit\Addins\2022\ONBOX\" /Y /R /F /I /S -copy "$(ProjectDir)\ONBOXApp.addin" "%25ProgramData%25\Autodesk\Revit\Addins\2022\" -goto exit + + $(DefineConstants);REVIT2024UP + $(DefineConstants) + + + + $(DefineConstants);DEBUG + full + ..\bin\Debug\$(RevitVersion) + + + + + + + AboutUI.xaml + + + + ElementJoinSelectUI.xaml + + + + ElementsJoinUIAdvanced.xaml + + + + + BeamsFromEntireBuildingChooseStandardFloorsUI.xaml + + + BeamsFromEntireBuildingUI.xaml + + + + BeamsFromColumnsUI.xaml + + + + BeamsFromWallsUI.xaml + + + BeamsUpdateUI.xaml + + + + + ColumnsFromDwgUI.xaml + + + + ElementsCopyUI.xaml + + + + ElementsJoinUI.xaml + + + + ExceptionManagerUI.xaml + + + + + PrivacyUI.xaml + + + + HelpLinks.resx + + + HelpLinks.pt-BR.resx + + + Messages.resx + + + Resources.resx + + + RibbonLanguage.resx + + + Settings.settings + + + WindowLanguage.resx + True + True + + + + RenumberBeamsUI.xaml + + + RenumberBeamTypesUI.xaml + + + RenumberLevelPrefixUI.xaml + + + + RenumberColumnsLevelsUI.xaml + + + RenumberColumnsUI.xaml + + + RenumberColumnsTypeUI.xaml + + + RenumberColumnsSelectionUI.xaml + + + + + RenumberGridsUI.xaml + + + RenumberGridsAdvUI.xaml + + + + renumberBlocksUI.xaml + + + RenumberParkingCleanerUI.xaml + + + renumberParkingPrefixUI.xaml + + + renumberParkingUI.xaml + + + RenumberTypeUI.xaml + + + + RevitZipUI.xaml + + + + + Canvas.xaml + + + + + + + + TopoPointCloudUIAdvanced.xaml + + + + + + + + + + TopoSlopesUI.xaml + + + + + + + + + + MSBuild:Compile + Designer + + + MSBuild:Compile + Designer + + + MSBuild:Compile + Designer + + + MSBuild:Compile + Designer + + + MSBuild:Compile + Designer + + + MSBuild:Compile + Designer + + + MSBuild:Compile + Designer + + + MSBuild:Compile + Designer + + + MSBuild:Compile + Designer + + + MSBuild:Compile + Designer + + + MSBuild:Compile + Designer + + + MSBuild:Compile + Designer + + + MSBuild:Compile + Designer + + + MSBuild:Compile + Designer + + + MSBuild:Compile + Designer + + + MSBuild:Compile + Designer + + + MSBuild:Compile + Designer + + + MSBuild:Compile + Designer + + + MSBuild:Compile + Designer + + + MSBuild:Compile + Designer + + + MSBuild:Compile + Designer + + + MSBuild:Compile + Designer + + + MSBuild:Compile + Designer + + + MSBuild:Compile + Designer + + + MSBuild:Compile + Designer + + + MSBuild:Compile + Designer + + + MSBuild:Compile + Designer + + + MSBuild:Compile + Designer + + + MSBuild:Compile + Designer + + + MSBuild:Compile + Designer + + + MSBuild:Compile + Designer + + + MSBuild:Compile + Designer + + + + + + + PublicResXFileCodeGenerator + HelpLinks.pt-BR.Designer.cs + + + PublicResXFileCodeGenerator + HelpLinks.Designer.cs + + + + PublicResXFileCodeGenerator + Messages.Designer.cs + + + + ResXFileCodeGenerator + Resources.Designer.cs + + + + PublicResXFileCodeGenerator + RibbonLanguage.Designer.cs + + + + PublicResXFileCodeGenerator + WindowLanguage.Designer.cs + + + + SettingsSingleFileGenerator + Settings.Designer.cs + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + -:D2023 -echo Copying results to 2023 -if not exist "%25ProgramData%25\Autodesk\Revit\Addins\2023\ONBOX\" mkdir "%25ProgramData%25\Autodesk\Revit\Addins\2023\ONBOX\" -XCOPY "$(TargetDir)\*" "%25ProgramData%25\Autodesk\Revit\Addins\2023\ONBOX\" /Y /R /F /I /S -copy "$(ProjectDir)\ONBOXApp.addin" "%25ProgramData%25\Autodesk\Revit\Addins\2023\" -goto exit + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + --> + \ No newline at end of file diff --git a/ONBOXApp/PackageContents.xml b/ONBOXApp/PackageContents.xml new file mode 100644 index 0000000..fedf6bf --- /dev/null +++ b/ONBOXApp/PackageContents.xml @@ -0,0 +1,37 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/ONBOXApp/Properties/launchSettings.json b/ONBOXApp/Properties/launchSettings.json new file mode 100644 index 0000000..d5c1c72 --- /dev/null +++ b/ONBOXApp/Properties/launchSettings.json @@ -0,0 +1,82 @@ +{ + "profiles": { + "Revit 2026": { + "commandName": "Executable", + "executablePath": "%ProgramW6432%\\Autodesk\\Revit 2026\\Revit.exe", + "commandLineArgs": "/viewer", + "use64Bit": true + }, + "Revit 2025": { + "commandName": "Executable", + "executablePath": "%ProgramW6432%\\Autodesk\\Revit 2025\\Revit.exe", + "commandLineArgs": "/viewer", + "use64Bit": true + }, + "Revit 2024": { + "commandName": "Executable", + "executablePath": "%ProgramW6432%\\Autodesk\\Revit 2024\\Revit.exe", + "commandLineArgs": "/viewer", + "use64Bit": true + }, + "Revit 2023": { + "commandName": "Executable", + "executablePath": "%ProgramW6432%\\Autodesk\\Revit 2023\\Revit.exe", + "commandLineArgs": "/viewer", + "use64Bit": true + }, + "Revit 2022": { + "commandName": "Executable", + "executablePath": "%ProgramW6432%\\Autodesk\\Revit 2022\\Revit.exe", + "commandLineArgs": "/viewer", + "use64Bit": true + }, + "Revit 2021": { + "commandName": "Executable", + "executablePath": "%ProgramW6432%\\Autodesk\\Revit 2021\\Revit.exe", + "commandLineArgs": "/viewer", + "use64Bit": true + }, + "Revit 2020": { + "commandName": "Executable", + "executablePath": "%ProgramW6432%\\Autodesk\\Revit 2020\\Revit.exe", + "commandLineArgs": "/viewer", + "use64Bit": true + }, + "Revit 2019": { + "commandName": "Executable", + "executablePath": "%ProgramW6432%\\Autodesk\\Revit 2019\\Revit.exe", + "commandLineArgs": "/viewer", + "use64Bit": true + }, + "Revit 2018": { + "commandName": "Executable", + "executablePath": "%ProgramW6432%\\Autodesk\\Revit 2018\\Revit.exe", + "commandLineArgs": "/viewer", + "use64Bit": true + }, + "Revit 2017": { + "commandName": "Executable", + "executablePath": "%ProgramW6432%\\Autodesk\\Revit 2017\\Revit.exe", + "commandLineArgs": "/viewer", + "use64Bit": true + }, + "Revit 2016": { + "commandName": "Executable", + "executablePath": "%ProgramW6432%\\Autodesk\\Revit 2016\\Revit.exe", + "commandLineArgs": "/viewer", + "use64Bit": true + }, + "Revit 2015": { + "commandName": "Executable", + "executablePath": "%ProgramW6432%\\Autodesk\\Revit 2015\\Revit.exe", + "commandLineArgs": "/viewer", + "use64Bit": true + }, + "Revit 2014": { + "commandName": "Executable", + "executablePath": "%ProgramW6432%\\Autodesk\\Revit 2014\\Revit.exe", + "commandLineArgs": "/viewer", + "use64Bit": true + } + } +} \ No newline at end of file diff --git a/OnboxApp.bundle/PackageContents.xml b/OnboxApp.bundle/PackageContents.xml index 2f2f28f..fedf6bf 100644 --- a/OnboxApp.bundle/PackageContents.xml +++ b/OnboxApp.bundle/PackageContents.xml @@ -26,4 +26,12 @@ + + + + + + + + \ No newline at end of file From 3808b597f821de60610a21f7a5eb650a3a8d78b4 Mon Sep 17 00:00:00 2001 From: LetsBIMtogether <221650916+LetsBIMtogether@users.noreply.github.com> Date: Sun, 12 Oct 2025 21:09:12 -0400 Subject: [PATCH 2/2] Revit 2025 & 2026 support --- ONBOXApp/About.cs | 3 +- ONBOXApp/AboutUI.xaml.cs | 9 ++- ONBOXApp/BeamUpdate/BeamUpdate.cs | 21 +++--- ONBOXApp/BeamsFromColumns/BeamsFromColumns.cs | 45 +++++------ ONBOXApp/BeamsFromWalls/BeamsFromWalls.cs | 5 +- ONBOXApp/ColumnsFromDwg/ColumnsFromDwg.cs | 17 +++-- ONBOXApp/CurveRasterizationService.cs | 2 +- ONBOXApp/ElementRayIntersector.cs | 2 +- ONBOXApp/ElementRayIntersectorResult.cs | 2 +- ONBOXApp/ElementsCopy/ElementsCopyToLevels.cs | 3 +- ONBOXApp/ElmentsJoin/ElementsJoinAdvanced.cs | 7 +- ONBOXApp/ONBOXApp.cs | 4 +- ONBOXApp/ONBOXApp.csproj | 12 +-- ONBOXApp/PackageContents.xml | 4 +- ONBOXApp/PrivacyUI.xaml.cs | 3 +- ONBOXApp/RenumberBeams/RenumberBeams.cs | 7 +- ONBOXApp/RenumberColumns/RenumberColumns.cs | 37 ++++----- ONBOXApp/RenumberGrids/GridAdvanced.cs | 17 +++-- ONBOXApp/RenumberParking/Parking.cs | 23 +++--- ONBOXApp/Storage.cs | 3 +- ONBOXApp/TopoSlope/BoundsService.cs | 2 +- ONBOXApp/TopoSlope/FindBoundsResult.cs | 2 +- ONBOXApp/TopoSlope/RetainingWallCommand.cs | 7 +- ONBOXApp/TopoSlope/TopoSlopesUI.xaml.cs | 2 +- ONBOXApp/TopoSlope/TopoSolidSlopeCommand.cs | 7 +- ONBOXApp/TypeSelectionFilter.cs | 2 +- ONBOXApp/Utils.cs | 75 +++++++++++++++++-- OnboxApp.bundle/PackageContents.xml | 4 +- 28 files changed, 192 insertions(+), 135 deletions(-) diff --git a/ONBOXApp/About.cs b/ONBOXApp/About.cs index 6ce358a..b4c7cd9 100644 --- a/ONBOXApp/About.cs +++ b/ONBOXApp/About.cs @@ -10,6 +10,7 @@ using System.Threading.Tasks; using System.Windows.Media.Imaging; using System.Xml; +using Utils; namespace ONBOXAppl { @@ -18,7 +19,7 @@ class SiteONBOX : IExternalCommand { public Result Execute(ExternalCommandData commandData, ref string message, ElementSet elements) { - System.Diagnostics.Process.Start("http://www.onboxdesign.com.br/"); + UrlOpener.Open("http://www.onboxdesign.com.br/"); return Result.Succeeded; } } diff --git a/ONBOXApp/AboutUI.xaml.cs b/ONBOXApp/AboutUI.xaml.cs index c259b5b..e862e42 100644 --- a/ONBOXApp/AboutUI.xaml.cs +++ b/ONBOXApp/AboutUI.xaml.cs @@ -3,6 +3,7 @@ using System.Text; using System.Windows; using System.Windows.Media; +using Utils; namespace ONBOXAppl { @@ -30,7 +31,7 @@ private void btnOK_Click(object sender, RoutedEventArgs e) private void btnInfo_Click(object sender, RoutedEventArgs e) { - System.Diagnostics.Process.Start("http://www.onboxdesign.com.br/"); + UrlOpener.Open("http://www.onboxdesign.com.br/"); } private void btnLicense_Click(object sender, RoutedEventArgs e) @@ -56,17 +57,17 @@ private void btnLicense_Click(object sender, RoutedEventArgs e) private void imgYoutube_MouseDown(object sender, System.Windows.Input.MouseButtonEventArgs e) { - System.Diagnostics.Process.Start("https://www.youtube.com/user/mrthiagokurumada"); + UrlOpener.Open("https://www.youtube.com/user/mrthiagokurumada"); } private void imgOnbox_MouseDown(object sender, System.Windows.Input.MouseButtonEventArgs e) { - System.Diagnostics.Process.Start("http://www.onboxdesign.com.br/"); + UrlOpener.Open("http://www.onboxdesign.com.br/"); } private void imgMail_MouseDown(object sender, System.Windows.Input.MouseButtonEventArgs e) { - System.Diagnostics.Process.Start("http://www.onboxdesign.com.br/contato/"); + UrlOpener.Open("http://www.onboxdesign.com.br/contato/"); } } } diff --git a/ONBOXApp/BeamUpdate/BeamUpdate.cs b/ONBOXApp/BeamUpdate/BeamUpdate.cs index d4acf78..281d25e 100644 --- a/ONBOXApp/BeamUpdate/BeamUpdate.cs +++ b/ONBOXApp/BeamUpdate/BeamUpdate.cs @@ -7,25 +7,22 @@ using Autodesk.Revit.UI; using Autodesk.Revit.Attributes; using Autodesk.Revit.UI.Selection; +using Utils; namespace ONBOXAppl { class BeamSelectionFilter : ISelectionFilter { - public bool AllowElement(Element elem) { - if (elem.Category.Id.IntegerValue.ToString() == BuiltInCategory.OST_StructuralFraming.GetHashCode().ToString()) - { - return true; - } - return false; - } + if (elem == null || elem is ElementType) + return false; - public bool AllowReference(Reference reference, XYZ position) - { - return false; + var cat = elem.Category; // can be null now + return cat != null && cat.Id.Ext_IntValue() == (int)BuiltInCategory.OST_StructuralFraming; } + + public bool AllowReference(Reference reference, XYZ position) => false; } class RequestBeamsUpdateHandler : IExternalEventHandler @@ -130,7 +127,7 @@ private void CreateBeams() #endregion - Family currentFamily = doc.GetElement(new ElementId(currentUI.SelectedBeamFamilyID)) as Family; + Family currentFamily = doc.GetElement(currentUI.SelectedBeamFamilyID.Ext_UniversalElemID()) as Family; FamilySymbol currentFamilySymbol = doc.GetElement(currentFamily.GetFamilySymbolIds().First()) as FamilySymbol; if (currentFamilySymbol == null) throw new Exception("Erro na separação do tipo de família."); @@ -305,7 +302,7 @@ private IList GetAllBeamFamilies() foreach (Family currentElem in allColumnFamiliesFilt) { string currentFamilyName = (currentElem as Family).Name; - int currentFamilyID = currentElem.Id.IntegerValue; + int currentFamilyID = currentElem.Id.Ext_IntValue(); System.Drawing.Bitmap currentFirstTypeBitmap = (uidoc.Document.GetElement(((currentElem as Family) .GetFamilySymbolIds()).First()) as FamilySymbol).GetPreviewImage(new System.Drawing.Size(60, 60)); diff --git a/ONBOXApp/BeamsFromColumns/BeamsFromColumns.cs b/ONBOXApp/BeamsFromColumns/BeamsFromColumns.cs index 61c51fb..e426fd3 100644 --- a/ONBOXApp/BeamsFromColumns/BeamsFromColumns.cs +++ b/ONBOXApp/BeamsFromColumns/BeamsFromColumns.cs @@ -7,6 +7,7 @@ using Autodesk.Revit.UI; using Autodesk.Revit.Attributes; using Autodesk.Revit.UI.Selection; +using Utils; namespace ONBOXAppl { @@ -14,45 +15,33 @@ class ColumnSelectionFilter : ISelectionFilter { public bool AllowElement(Element elem) { - if (elem.Category.Id.ToString() == (BuiltInCategory.OST_StructuralColumns).GetHashCode().ToString()) - return true; - return false; - } + if (elem == null || elem is ElementType) return false; - public bool AllowReference(Reference reference, XYZ position) - { - return false; + var cat = elem.Category; // can be null in 2025+ + return cat != null && cat.Id.Ext_IntValue() == (int)BuiltInCategory.OST_StructuralColumns; } - } + public bool AllowReference(Reference reference, XYZ position) => false; + } class ColumnAndBeamSelectionFilter : ISelectionFilter { - FamilyInstance currentBeam = null; + private readonly FamilyInstance _currentBeam; - public ColumnAndBeamSelectionFilter(FamilyInstance targetBeam) - { - currentBeam = targetBeam; - } + public ColumnAndBeamSelectionFilter(FamilyInstance targetBeam) => _currentBeam = targetBeam; public bool AllowElement(Element elem) { - if (elem.Category.Id.IntegerValue == BuiltInCategory.OST_StructuralColumns.GetHashCode()) - { - return true; - } - else if (elem.Id == currentBeam.Id) - { + if (elem == null || elem is ElementType) return false; + + var cat = elem.Category; // can be null in 2025+ + if (cat != null && cat.Id.Ext_IntValue() == (int)BuiltInCategory.OST_StructuralColumns) return true; - } - return false; + return _currentBeam != null && elem.Id == _currentBeam.Id; } - public bool AllowReference(Reference reference, XYZ position) - { - return false; - } + public bool AllowReference(Reference reference, XYZ position) => false; } public class RequestBeamsFromColumnsHandler : IExternalEventHandler @@ -150,7 +139,7 @@ private void CreateBeams() { FamilyInstance currentSelection = doc.GetElement(sel.PickObject(ObjectType.Element, new ColumnAndBeamSelectionFilter(createdBeam), Properties.Messages.BeamsFromColumns_SelectFirstColumnOrBeam)) as FamilyInstance; - if (currentSelection.Category.Id.IntegerValue == BuiltInCategory.OST_StructuralColumns.GetHashCode()) + if (currentSelection.Category.Id.Ext_IntValue() == BuiltInCategory.OST_StructuralColumns.GetHashCode()) { if (currentUI.IsChain() == false || lastSelectedColumn == null) { @@ -297,7 +286,7 @@ private FamilyInstance CreateBeam(ref FamilyInstance firstColumn, ref FamilyInst FamilySymbol BeamTypeFromFamilySymbol = null; IList ListBeamTypesFromFamilySymbol = new FilteredElementCollector(doc).OfCategory(BuiltInCategory.OST_StructuralFraming) - .WhereElementIsElementType().Cast().Where(t => t.Family.Id.IntegerValue == currentUI.selectedBeamFamilyID).ToList(); + .WhereElementIsElementType().Cast().Where(t => t.Family.Id.Ext_IntValue() == currentUI.selectedBeamFamilyID).ToList(); if (ListBeamTypesFromFamilySymbol.Count > 0) BeamTypeFromFamilySymbol = ListBeamTypesFromFamilySymbol.FirstOrDefault(); @@ -624,7 +613,7 @@ static internal IList getAllBeamFamilies() foreach (Family currentElem in allColumnFamiliesFilt) { string currentFamilyName = (currentElem as Family).Name; - int currentFamilyID = currentElem.Id.IntegerValue; + int currentFamilyID = currentElem.Id.Ext_IntValue(); System.Drawing.Bitmap currentFirstTypeBitmap = (uidoc.Document.GetElement(((currentElem as Family) .GetFamilySymbolIds()).First()) as FamilySymbol).GetPreviewImage(new System.Drawing.Size(60, 60)); diff --git a/ONBOXApp/BeamsFromWalls/BeamsFromWalls.cs b/ONBOXApp/BeamsFromWalls/BeamsFromWalls.cs index bbacfcc..4c5fb04 100644 --- a/ONBOXApp/BeamsFromWalls/BeamsFromWalls.cs +++ b/ONBOXApp/BeamsFromWalls/BeamsFromWalls.cs @@ -8,6 +8,7 @@ using System.Text; using System.Threading.Tasks; using System.Threading; +using Utils; namespace ONBOXAppl { @@ -220,7 +221,7 @@ private void CreateBeams() #endregion - Family currentFamily = doc.GetElement(new ElementId(currentUI.SelectedBeamFamilyID)) as Family; + Family currentFamily = doc.GetElement(currentUI.SelectedBeamFamilyID.Ext_UniversalElemID()) as Family; if (currentFamily == null) { @@ -519,7 +520,7 @@ private IList GetAllBeamFamilies() foreach (Family currentElem in allColumnFamiliesFilt) { string currentFamilyName = (currentElem as Family).Name; - int currentFamilyID = currentElem.Id.IntegerValue; + int currentFamilyID = currentElem.Id.Ext_IntValue(); System.Drawing.Bitmap currentFirstTypeBitmap = (uidoc.Document.GetElement(((currentElem as Family) .GetFamilySymbolIds()).First()) as FamilySymbol).GetPreviewImage(new System.Drawing.Size(60, 60)); diff --git a/ONBOXApp/ColumnsFromDwg/ColumnsFromDwg.cs b/ONBOXApp/ColumnsFromDwg/ColumnsFromDwg.cs index 2904783..eb0d52a 100644 --- a/ONBOXApp/ColumnsFromDwg/ColumnsFromDwg.cs +++ b/ONBOXApp/ColumnsFromDwg/ColumnsFromDwg.cs @@ -8,6 +8,7 @@ using System.Threading.Tasks; using Autodesk.Revit.UI.Selection; using System.Drawing; +using Utils; namespace ONBOXAppl { @@ -239,7 +240,7 @@ private void CreateInstances(GeometryElement geoElem, Document doc, string selec XYZ midPoint = Utils.GetPoint.getMidPoint(point1, point2); FamilyWithImage familyInfo = ONBOXApplication.storedColumnFamiliesInfo.ElementAt(ONBOXApplication.selectedColumnFamily); - FamilySymbol fs = uidoc.Document.GetElement((uidoc.Document.GetElement(new ElementId(familyInfo.FamilyID)) as Family).GetFamilySymbolIds().First()) as FamilySymbol; + FamilySymbol fs = uidoc.Document.GetElement((uidoc.Document.GetElement(familyInfo.FamilyID.Ext_UniversalElemID()) as Family).GetFamilySymbolIds().First()) as FamilySymbol; string newTypeName = (line1LengthCm).ToString() + " x " + (line2LengthCm).ToString() + "cm"; ElementType newType = null; @@ -258,8 +259,8 @@ private void CreateInstances(GeometryElement geoElem, Document doc, string selec FamilySymbol fs2 = newType as FamilySymbol; fi = doc.Create.NewFamilyInstance(midPoint, fs2, (allLevels.First() as Level), Autodesk.Revit.DB.Structure.StructuralType.Column); - ElementId topLevelID = new ElementId(ONBOXApplication.StoredColumnsDwgLevels.ElementAt(l + 1).levelId); - ElementId baseLevelID = new ElementId(ONBOXApplication.StoredColumnsDwgLevels.ElementAt(l).levelId); + ElementId topLevelID = ONBOXApplication.StoredColumnsDwgLevels.ElementAt(l + 1).levelId.Ext_UniversalElemID(); + ElementId baseLevelID = ONBOXApplication.StoredColumnsDwgLevels.ElementAt(l).levelId.Ext_UniversalElemID(); fi.get_Parameter(BuiltInParameter.FAMILY_BASE_LEVEL_PARAM).Set(baseLevelID); fi.get_Parameter(BuiltInParameter.FAMILY_TOP_LEVEL_PARAM).Set(topLevelID); @@ -293,7 +294,7 @@ private void CreateInstances(GeometryElement geoElem, Document doc, string selec continue; FamilyWithImage familyInfo = ONBOXApplication.storedColumnFamiliesCircInfo.ElementAt(ONBOXApplication.selectedColumnCircFamily); - FamilySymbol fs = uidoc.Document.GetElement((uidoc.Document.GetElement(new ElementId(familyInfo.FamilyID)) as Family).GetFamilySymbolIds().First()) as FamilySymbol; + FamilySymbol fs = uidoc.Document.GetElement((uidoc.Document.GetElement(familyInfo.FamilyID.Ext_UniversalElemID()) as Family).GetFamilySymbolIds().First()) as FamilySymbol; string newTypeName = currentArcDiameterCm + "cm"; ElementType newType = null; @@ -312,8 +313,8 @@ private void CreateInstances(GeometryElement geoElem, Document doc, string selec FamilySymbol fs2 = newType as FamilySymbol; FamilyInstance fi = doc.Create.NewFamilyInstance(currentArcLocation, fs2, (allLevels.First() as Level), Autodesk.Revit.DB.Structure.StructuralType.Column); - ElementId topLevelID = new ElementId((ONBOXApplication.StoredColumnsDwgLevels.ElementAt(ONBOXApplication.StoredColumnsDwgLevels.IndexOf(currentLevelInfo) + 1)).levelId); - ElementId baseLevelID = new ElementId(currentLevelInfo.levelId); + ElementId topLevelID = (ONBOXApplication.StoredColumnsDwgLevels.ElementAt(ONBOXApplication.StoredColumnsDwgLevels.IndexOf(currentLevelInfo) + 1)).levelId.Ext_UniversalElemID(); + ElementId baseLevelID = currentLevelInfo.levelId.Ext_UniversalElemID(); fi.get_Parameter(BuiltInParameter.FAMILY_BASE_LEVEL_PARAM).Set(baseLevelID); fi.get_Parameter(BuiltInParameter.FAMILY_TOP_LEVEL_PARAM).Set(topLevelID); @@ -393,7 +394,7 @@ static internal IList getAllColumnFamilies() foreach (Family currentElem in allColumnFamiliesFilt) { string currentFamilyName = (currentElem as Family).Name; - int currentFamilyID = currentElem.Id.IntegerValue; + int currentFamilyID = currentElem.Id.Ext_IntValue(); Bitmap currentFirstTypeBitmap = (uidoc.Document.GetElement(((currentElem as Family) .GetFamilySymbolIds()).First()) as FamilySymbol).GetPreviewImage(new Size(60, 60)); @@ -429,7 +430,7 @@ static internal IList getAllColumnCircularFamilies() foreach (Family currentElem in allColumnFamiliesFilt) { string currentFamilyName = (currentElem as Family).Name; - int currentFamilyID = currentElem.Id.IntegerValue; + int currentFamilyID = currentElem.Id.Ext_IntValue(); Bitmap currentFirstTypeBitmap = (uidoc.Document.GetElement(((currentElem as Family) .GetFamilySymbolIds()).First()) as FamilySymbol).GetPreviewImage(new Size(60, 60)); diff --git a/ONBOXApp/CurveRasterizationService.cs b/ONBOXApp/CurveRasterizationService.cs index 83a4d06..9f184ce 100644 --- a/ONBOXApp/CurveRasterizationService.cs +++ b/ONBOXApp/CurveRasterizationService.cs @@ -1,4 +1,4 @@ -#if R2024 +#if REVIT2024UP using System; using System.Collections.Generic; diff --git a/ONBOXApp/ElementRayIntersector.cs b/ONBOXApp/ElementRayIntersector.cs index 987e2b3..aa9238a 100644 --- a/ONBOXApp/ElementRayIntersector.cs +++ b/ONBOXApp/ElementRayIntersector.cs @@ -1,4 +1,4 @@ -#if R2024 +#if REVIT2024UP using System.Collections.Generic; using Autodesk.Revit.DB; diff --git a/ONBOXApp/ElementRayIntersectorResult.cs b/ONBOXApp/ElementRayIntersectorResult.cs index 96adb74..922d476 100644 --- a/ONBOXApp/ElementRayIntersectorResult.cs +++ b/ONBOXApp/ElementRayIntersectorResult.cs @@ -1,4 +1,4 @@ -#if R2024 +#if REVIT2024UP using Autodesk.Revit.DB; diff --git a/ONBOXApp/ElementsCopy/ElementsCopyToLevels.cs b/ONBOXApp/ElementsCopy/ElementsCopyToLevels.cs index a8dd334..3578302 100644 --- a/ONBOXApp/ElementsCopy/ElementsCopyToLevels.cs +++ b/ONBOXApp/ElementsCopy/ElementsCopyToLevels.cs @@ -7,6 +7,7 @@ using Autodesk.Revit.UI; using Autodesk.Revit.UI.Selection; using Autodesk.Revit.Attributes; +using Utils; namespace ONBOXAppl { @@ -49,7 +50,7 @@ public Result Execute(ExternalCommandData commandData, ref string message, Eleme t.Start(); foreach (LevelInfo currentLevelInfo in selectedLevelsInfo) { - ElementId currentLevelID = new ElementId(currentLevelInfo.levelId); + ElementId currentLevelID = currentLevelInfo.levelId.Ext_UniversalElemID(); Level currentLevel = doc.GetElement(currentLevelID) as Level; if (currentUI.checkEraseBeamsOnTarget.IsChecked == true) diff --git a/ONBOXApp/ElmentsJoin/ElementsJoinAdvanced.cs b/ONBOXApp/ElmentsJoin/ElementsJoinAdvanced.cs index 3af54bb..c4aff34 100644 --- a/ONBOXApp/ElmentsJoin/ElementsJoinAdvanced.cs +++ b/ONBOXApp/ElmentsJoin/ElementsJoinAdvanced.cs @@ -8,6 +8,7 @@ using Autodesk.Revit.Attributes; using Autodesk.Revit.UI.Selection; using System.Windows.Controls; +using Utils; namespace ONBOXAppl { @@ -76,10 +77,10 @@ public Result Execute(ExternalCommandData commandData, ref string message, Eleme Element upperLevelElement = null; if (currentUI.selectedLowerLevel != 0 && currentUI.selectedLowerLevel != -1) - lowerLevelElement = doc.GetElement(new ElementId(currentUI.selectedLowerLevel)); + lowerLevelElement = doc.GetElement(currentUI.selectedLowerLevel.Ext_UniversalElemID()); if (currentUI.selectedUpperLevel != 0 && currentUI.selectedUpperLevel != -1) - upperLevelElement = doc.GetElement(new ElementId(currentUI.selectedUpperLevel)); + upperLevelElement = doc.GetElement(currentUI.selectedUpperLevel.Ext_UniversalElemID()); if (lowerLevelElement != null) lowerLevel = lowerLevelElement as Level; @@ -252,7 +253,7 @@ private Level GetNextLevel(Level targetLevel) int nextLevelLocation = levelIdList.IndexOf(targetLevel.Id) + 1; - ElementId nextLevelId = new ElementId(-1); + ElementId nextLevelId = (-1).Ext_UniversalElemID(); if (levelIdList.Count - 1 >= nextLevelLocation) nextLevelId = levelIdList.ElementAt(nextLevelLocation); diff --git a/ONBOXApp/ONBOXApp.cs b/ONBOXApp/ONBOXApp.cs index 1d19af9..0264207 100644 --- a/ONBOXApp/ONBOXApp.cs +++ b/ONBOXApp/ONBOXApp.cs @@ -236,7 +236,7 @@ private void CreateONBOXRibbon(UIControlledApplication application) btnCreateTopoFromPointCloud.SetContextualHelp(new ContextualHelp(ContextualHelpType.Url, Properties.HelpLinks.btnCreateTopoFromPointCloud)); //PushButton btnCreateTopoFromDwgMarks = panelTopo.AddItem(new PushButtonData(" Topografia por CAD planimétrico ", " Topografia por \n planimetria ", dll, "ONBOXAppl.TopoFromDwgMarks")) as PushButton; -#if !R2024 +#if !REVIT2024UP PushButton btnTopoSlope = panelTopo.AddItem(new PushButtonData(Properties.RibbonLanguage.Topography_SlopeByPads, Properties.RibbonLanguage.Topography_SlopeByPads.Replace("\\n", "\n"), dll, "ONBOXAppl.TopoSlopes")) as PushButton; btnTopoSlope.SetContextualHelp(new ContextualHelp(ContextualHelpType.Url, Properties.HelpLinks.btnTopoSlope)); #else @@ -383,7 +383,7 @@ private void CreateONBOXRibbon(UIControlledApplication application) //btnCreateTopoFromDwgMarks.Image = TopoFromDWG16; //btnCreateTopoFromDwgMarks.LargeImage = TopoFromDWG32; -#if !R2024 +#if !REVIT2024UP btnTopoSlope.ToolTip = Properties.RibbonLanguage.Topography_SlopeByPads_ToolTip; btnTopoSlope.LongDescription = Properties.RibbonLanguage.Topography_SlopeByPads_Descrip; #else diff --git a/ONBOXApp/ONBOXApp.csproj b/ONBOXApp/ONBOXApp.csproj index 39d8e48..eafb90c 100644 --- a/ONBOXApp/ONBOXApp.csproj +++ b/ONBOXApp/ONBOXApp.csproj @@ -5,7 +5,7 @@ - + net47;net48;net8.0-windows; 2024 - REVIT$(RevitVersion) + REVIT$(RevitVersion) $(DefineConstants) x64 @@ -141,13 +141,11 @@ - $(DefineConstants);REVIT2026UP $(DefineConstants) - $(DefineConstants);REVIT2025UP $(DefineConstants) @@ -670,13 +668,9 @@ - - \ No newline at end of file diff --git a/ONBOXApp/PackageContents.xml b/ONBOXApp/PackageContents.xml index fedf6bf..bf88526 100644 --- a/ONBOXApp/PackageContents.xml +++ b/ONBOXApp/PackageContents.xml @@ -28,10 +28,10 @@ - + - + \ No newline at end of file diff --git a/ONBOXApp/PrivacyUI.xaml.cs b/ONBOXApp/PrivacyUI.xaml.cs index 99eb6ca..7f76fbd 100644 --- a/ONBOXApp/PrivacyUI.xaml.cs +++ b/ONBOXApp/PrivacyUI.xaml.cs @@ -11,6 +11,7 @@ using System.Windows.Media; using System.Windows.Media.Imaging; using System.Windows.Shapes; +using Utils; namespace ONBOXAppl { @@ -26,7 +27,7 @@ public PrivacyUI() private void OnClick(object sender, RoutedEventArgs e) { - System.Diagnostics.Process.Start("https://app.onboxdesign.com.br/accounts/request"); + UrlOpener.Open("https://app.onboxdesign.com.br/accounts/request"); } } } diff --git a/ONBOXApp/RenumberBeams/RenumberBeams.cs b/ONBOXApp/RenumberBeams/RenumberBeams.cs index 6b0adb7..3d6b90e 100644 --- a/ONBOXApp/RenumberBeams/RenumberBeams.cs +++ b/ONBOXApp/RenumberBeams/RenumberBeams.cs @@ -7,6 +7,7 @@ using Autodesk.Revit.DB; using Autodesk.Revit.UI.Selection; using Autodesk.Revit.Attributes; +using Utils; namespace ONBOXAppl { @@ -71,7 +72,7 @@ private void DoTheRenumberingBeams() foreach (Level currentLevel in allLevel) { - LevelInfo lvlInfo = ONBOXApplication.storedBeamLevelInfo.Where(l => l.levelId == currentLevel.Id.IntegerValue).First() as LevelInfo; + LevelInfo lvlInfo = ONBOXApplication.storedBeamLevelInfo.Where(l => l.levelId == currentLevel.Id.Ext_IntValue()).First() as LevelInfo; //checks if the current level will be numbered if (lvlInfo.willBeNumbered == false) @@ -124,7 +125,7 @@ private void RenumberListOfBeams(IList targetBeams, ref int currentCou foreach (Element currentBeamElem in targetBeams) { - BeamTypesInfo beamInfo = ONBOXApplication.storedBeamTypesInfo.Where(b => b.TypeId == currentBeamElem.GetTypeId().IntegerValue).First(); + BeamTypesInfo beamInfo = ONBOXApplication.storedBeamTypesInfo.Where(b => b.TypeId == currentBeamElem.GetTypeId().Ext_IntValue()).First(); if (beamInfo.WillBeNumbered == false) { continue; @@ -218,7 +219,7 @@ static internal IList GetBeamTypesInfo() { if (!allUsedBeamTypesIDs.Contains(currentElement.GetTypeId())) { - int typeID = currentElement.GetTypeId().IntegerValue; + int typeID = currentElement.GetTypeId().Ext_IntValue(); string typeName = currentElement.Name; BeamTypesInfo currentBeamInfo = new BeamTypesInfo() { TypeName = typeName, TypeId = typeID, WillBeNumbered = true, TypePrefix = "" }; diff --git a/ONBOXApp/RenumberColumns/RenumberColumns.cs b/ONBOXApp/RenumberColumns/RenumberColumns.cs index 278bc28..7ae58e6 100644 --- a/ONBOXApp/RenumberColumns/RenumberColumns.cs +++ b/ONBOXApp/RenumberColumns/RenumberColumns.cs @@ -7,6 +7,7 @@ using System.Text; using System.Threading.Tasks; using Autodesk.Revit.UI.Selection; +using Utils; namespace ONBOXAppl { @@ -142,19 +143,19 @@ static internal void DoRenumbering(bool selectColumnRow, int counter) continue; } - ColumnTypesInfo currentColumnTypeInfo = ONBOXApplication.storedColumnTypesInfo.Where(colInfo => colInfo.TypeId == currentColumn.GetTypeId().IntegerValue).First(); + ColumnTypesInfo currentColumnTypeInfo = ONBOXApplication.storedColumnTypesInfo.Where(colInfo => colInfo.TypeId == currentColumn.GetTypeId().Ext_IntValue()).First(); if (currentColumnTypeInfo.WillBeNumbered == false) continue; - LevelInfo currentLevelInfo = ONBOXApplication.storedColumnLevelInfo.Where(lvlInfo => lvlInfo.levelId == allLevels.ElementAt(i).Id.IntegerValue).First(); + LevelInfo currentLevelInfo = ONBOXApplication.storedColumnLevelInfo.Where(lvlInfo => lvlInfo.levelId == allLevels.ElementAt(i).Id.Ext_IntValue()).First(); if (currentLevelInfo.willBeNumbered == false) continue; Element currenColumnTopLevel = doc.GetElement(currentColumn.get_Parameter(BuiltInParameter.FAMILY_TOP_LEVEL_PARAM).AsElementId()); allUsedColumnsIDs.Add(currentColumn.Id); - string columnBaseSufix = ONBOXApplication.storedColumnLevelInfo.Where(colInfo => colInfo.levelId == currentColumnBaseLevel.Id.IntegerValue).First().levelPrefix; - string columnTopSufix = ONBOXApplication.storedColumnLevelInfo.Where(colInfo => colInfo.levelId == currenColumnTopLevel.Id.IntegerValue).First().levelPrefix; + string columnBaseSufix = ONBOXApplication.storedColumnLevelInfo.Where(colInfo => colInfo.levelId == currentColumnBaseLevel.Id.Ext_IntValue()).First().levelPrefix; + string columnTopSufix = ONBOXApplication.storedColumnLevelInfo.Where(colInfo => colInfo.levelId == currenColumnTopLevel.Id.Ext_IntValue()).First().levelPrefix; if (currenColumnTopLevel.Id != currentColumnBaseLevel.Id) { @@ -192,7 +193,7 @@ static internal void DoRenumbering(bool selectColumnRow, int counter) //we will try to find other columns equal to this column and are in the same z line (position) on other levels, so they have the same name for (int l = 0; l < allLevels.Count; l++) { - currentLevelInfo = ONBOXApplication.storedColumnLevelInfo.Where(lvlInfo => lvlInfo.levelId == allLevels.ElementAt(l).Id.IntegerValue).First(); + currentLevelInfo = ONBOXApplication.storedColumnLevelInfo.Where(lvlInfo => lvlInfo.levelId == allLevels.ElementAt(l).Id.Ext_IntValue()).First(); if (currentLevelInfo.willBeNumbered == false) continue; @@ -232,15 +233,15 @@ static internal void DoRenumbering(bool selectColumnRow, int counter) if ((currentcolumnInLine == null) || (currentColumn.Id == currentcolumnInLine.Id)) continue; - currentColumnTypeInfo = ONBOXApplication.storedColumnTypesInfo.Where(colInfo => colInfo.TypeId == currentcolumnInLine.GetTypeId().IntegerValue).First(); + currentColumnTypeInfo = ONBOXApplication.storedColumnTypesInfo.Where(colInfo => colInfo.TypeId == currentcolumnInLine.GetTypeId().Ext_IntValue()).First(); if (currentColumnTypeInfo.WillBeNumbered == false) continue; currentColumnBaseLevel = doc.GetElement(currentcolumnInLine.get_Parameter(BuiltInParameter.FAMILY_BASE_LEVEL_PARAM).AsElementId()); currenColumnTopLevel = doc.GetElement(currentcolumnInLine.get_Parameter(BuiltInParameter.FAMILY_TOP_LEVEL_PARAM).AsElementId()); - columnBaseSufix = ONBOXApplication.storedColumnLevelInfo.Where(colInfo => colInfo.levelId == currentColumnBaseLevel.Id.IntegerValue).First().levelPrefix; - columnTopSufix = ONBOXApplication.storedColumnLevelInfo.Where(colInfo => colInfo.levelId == currenColumnTopLevel.Id.IntegerValue).First().levelPrefix; + columnBaseSufix = ONBOXApplication.storedColumnLevelInfo.Where(colInfo => colInfo.levelId == currentColumnBaseLevel.Id.Ext_IntValue()).First().levelPrefix; + columnTopSufix = ONBOXApplication.storedColumnLevelInfo.Where(colInfo => colInfo.levelId == currenColumnTopLevel.Id.Ext_IntValue()).First().levelPrefix; if (currenColumnTopLevel.Id != currentColumnBaseLevel.Id) { @@ -334,7 +335,7 @@ static internal IList GetColumTypesInfo() { if (!allUsedColumnTypesIDs.Contains(currentElement.GetTypeId())) { - int typeID = currentElement.GetTypeId().IntegerValue; + int typeID = currentElement.GetTypeId().Ext_IntValue(); string typeName = currentElement.Name; ColumnTypesInfo currentColumnInfo = new ColumnTypesInfo() { TypeName = typeName, TypeId = typeID, WillBeNumbered = true, TypePrefix = "P" }; @@ -607,19 +608,19 @@ static internal void DoRenumbering(bool selectColumnRow, int counter) continue; } - ColumnTypesInfo currentColumnTypeInfo = ONBOXApplication.storedColumnTypesInfo.Where(colInfo => colInfo.TypeId == currentColumn.GetTypeId().IntegerValue).First(); + ColumnTypesInfo currentColumnTypeInfo = ONBOXApplication.storedColumnTypesInfo.Where(colInfo => colInfo.TypeId == currentColumn.GetTypeId().Ext_IntValue()).First(); if (currentColumnTypeInfo.WillBeNumbered == false) continue; - LevelInfo currentLevelInfo = ONBOXApplication.storedColumnLevelInfo.Where(lvlInfo => lvlInfo.levelId == allLevels.ElementAt(i).Id.IntegerValue).First(); + LevelInfo currentLevelInfo = ONBOXApplication.storedColumnLevelInfo.Where(lvlInfo => lvlInfo.levelId == allLevels.ElementAt(i).Id.Ext_IntValue()).First(); if (currentLevelInfo.willBeNumbered == false) continue; Element currenColumnTopLevel = doc.GetElement(currentColumn.get_Parameter(BuiltInParameter.FAMILY_TOP_LEVEL_PARAM).AsElementId()); allUsedColumnsIDs.Add(currentColumn.Id); - string columnBaseSufix = ONBOXApplication.storedColumnLevelInfo.Where(colInfo => colInfo.levelId == currentColumnBaseLevel.Id.IntegerValue).First().levelPrefix; - string columnTopSufix = ONBOXApplication.storedColumnLevelInfo.Where(colInfo => colInfo.levelId == currenColumnTopLevel.Id.IntegerValue).First().levelPrefix; + string columnBaseSufix = ONBOXApplication.storedColumnLevelInfo.Where(colInfo => colInfo.levelId == currentColumnBaseLevel.Id.Ext_IntValue()).First().levelPrefix; + string columnTopSufix = ONBOXApplication.storedColumnLevelInfo.Where(colInfo => colInfo.levelId == currenColumnTopLevel.Id.Ext_IntValue()).First().levelPrefix; if (currenColumnTopLevel.Id != currentColumnBaseLevel.Id) { @@ -657,7 +658,7 @@ static internal void DoRenumbering(bool selectColumnRow, int counter) //we will try to find other columns equal to this column and are in the same z line (position) on other levels, so they have the same name for (int l = 0; l < allLevels.Count; l++) { - currentLevelInfo = ONBOXApplication.storedColumnLevelInfo.Where(lvlInfo => lvlInfo.levelId == allLevels.ElementAt(l).Id.IntegerValue).First(); + currentLevelInfo = ONBOXApplication.storedColumnLevelInfo.Where(lvlInfo => lvlInfo.levelId == allLevels.ElementAt(l).Id.Ext_IntValue()).First(); if (currentLevelInfo.willBeNumbered == false) continue; @@ -697,15 +698,15 @@ static internal void DoRenumbering(bool selectColumnRow, int counter) if ((currentcolumnInLine == null) || (currentColumn.Id == currentcolumnInLine.Id)) continue; - currentColumnTypeInfo = ONBOXApplication.storedColumnTypesInfo.Where(colInfo => colInfo.TypeId == currentcolumnInLine.GetTypeId().IntegerValue).First(); + currentColumnTypeInfo = ONBOXApplication.storedColumnTypesInfo.Where(colInfo => colInfo.TypeId == currentcolumnInLine.GetTypeId().Ext_IntValue()).First(); if (currentColumnTypeInfo.WillBeNumbered == false) continue; currentColumnBaseLevel = doc.GetElement(currentcolumnInLine.get_Parameter(BuiltInParameter.FAMILY_BASE_LEVEL_PARAM).AsElementId()); currenColumnTopLevel = doc.GetElement(currentcolumnInLine.get_Parameter(BuiltInParameter.FAMILY_TOP_LEVEL_PARAM).AsElementId()); - columnBaseSufix = ONBOXApplication.storedColumnLevelInfo.Where(colInfo => colInfo.levelId == currentColumnBaseLevel.Id.IntegerValue).First().levelPrefix; - columnTopSufix = ONBOXApplication.storedColumnLevelInfo.Where(colInfo => colInfo.levelId == currenColumnTopLevel.Id.IntegerValue).First().levelPrefix; + columnBaseSufix = ONBOXApplication.storedColumnLevelInfo.Where(colInfo => colInfo.levelId == currentColumnBaseLevel.Id.Ext_IntValue()).First().levelPrefix; + columnTopSufix = ONBOXApplication.storedColumnLevelInfo.Where(colInfo => colInfo.levelId == currenColumnTopLevel.Id.Ext_IntValue()).First().levelPrefix; if (currenColumnTopLevel.Id != currentColumnBaseLevel.Id) { @@ -799,7 +800,7 @@ static internal IList GetColumTypesInfo() { if (!allUsedColumnTypesIDs.Contains(currentElement.GetTypeId())) { - int typeID = currentElement.GetTypeId().IntegerValue; + int typeID = currentElement.GetTypeId().Ext_IntValue(); string typeName = currentElement.Name; ColumnTypesInfo currentColumnInfo = new ColumnTypesInfo() { TypeName = typeName, TypeId = typeID, WillBeNumbered = true, TypePrefix = "P" }; diff --git a/ONBOXApp/RenumberGrids/GridAdvanced.cs b/ONBOXApp/RenumberGrids/GridAdvanced.cs index 5383351..01cc70f 100644 --- a/ONBOXApp/RenumberGrids/GridAdvanced.cs +++ b/ONBOXApp/RenumberGrids/GridAdvanced.cs @@ -10,6 +10,7 @@ using Autodesk.Revit.Attributes; using Autodesk.Revit.UI.Selection; using System.Diagnostics; +using Utils; namespace ONBOXAppl { @@ -105,7 +106,7 @@ internal void ApplyTheRenumberingOnTheActualGrids(IList targetGridInfo foreach (GridInfo currentGridInfo in targetGridInfoList) { bool isCurrentGridPartOfMultiGridItem = false; - Grid currentGrid = uidoc.Document.GetElement(new ElementId(currentGridInfo.Id)) as Grid; + Grid currentGrid = uidoc.Document.GetElement(currentGridInfo.Id.Ext_UniversalElemID()) as Grid; if (currentGrid == null) { @@ -172,17 +173,17 @@ internal IList GetAllGridsInfo() if (VerifyGridOrientation(currentGrid) == GridOrientation.Horizontal) { currentGridOrientation = "Horizontal"; - allHorizontalGridsInfo.Add(new GridInfo() { Id = currentGrid.Id.IntegerValue, newName = "", prevName = currentGrid.Name, orientation = currentGridOrientation }); + allHorizontalGridsInfo.Add(new GridInfo() { Id = currentGrid.Id.Ext_IntValue(), newName = "", prevName = currentGrid.Name, orientation = currentGridOrientation }); } else { currentGridOrientation = "Vertical"; - allVerticalGridsInfo.Add(new GridInfo() { Id = currentGrid.Id.IntegerValue, newName = "", prevName = currentGrid.Name, orientation = currentGridOrientation }); + allVerticalGridsInfo.Add(new GridInfo() { Id = currentGrid.Id.Ext_IntValue(), newName = "", prevName = currentGrid.Name, orientation = currentGridOrientation }); } } - allHorizontalGridsInfo = allHorizontalGridsInfo.Where(g => g is GridInfo).OrderByDescending(g => (uidoc.Document.GetElement(new ElementId(g.Id)) as Grid).Curve.GetEndPoint(0).Y).ToList(); - allVerticalGridsInfo = allVerticalGridsInfo.Where(g => g is GridInfo).OrderBy(g => (uidoc.Document.GetElement(new ElementId(g.Id)) as Grid).Curve.GetEndPoint(0).X).ToList(); + allHorizontalGridsInfo = allHorizontalGridsInfo.Where(g => g is GridInfo).OrderByDescending(g => (uidoc.Document.GetElement(g.Id.Ext_UniversalElemID()) as Grid).Curve.GetEndPoint(0).Y).ToList(); + allVerticalGridsInfo = allVerticalGridsInfo.Where(g => g is GridInfo).OrderBy(g => (uidoc.Document.GetElement(g.Id.Ext_UniversalElemID()) as Grid).Curve.GetEndPoint(0).X).ToList(); gridsInformation = allHorizontalGridsInfo.Union(allVerticalGridsInfo).ToList(); @@ -253,9 +254,9 @@ private void doTheRenumberingOrLettering(Document doc, IList targetLis { Grid currentGrid = null; - currentGrid = uidoc.Document.GetElement(new ElementId(currentGridInfo.Id)) as Grid; + currentGrid = uidoc.Document.GetElement(currentGridInfo.Id.Ext_UniversalElemID()) as Grid; - if (allMultiGridSubGridsIDs.Contains(new ElementId(currentGridInfo.Id))) + if (allMultiGridSubGridsIDs.Contains(currentGridInfo.Id.Ext_UniversalElemID())) { MultiSegmentGrid currentMultiSegGrid = doc.GetElement(MultiSegmentGrid.GetMultiSegementGridId(currentGrid)) as MultiSegmentGrid; @@ -277,7 +278,7 @@ private void doTheRenumberingOrLettering(Document doc, IList targetLis { prevGridLength = getTheoricalLengthOfTheGrid(prevGrid); } - GridInfo prevGridInfo = targetListOfGrids.Where(g => g.Id == prevGrid.Id.IntegerValue).FirstOrDefault(); + GridInfo prevGridInfo = targetListOfGrids.Where(g => g.Id == prevGrid.Id.Ext_IntValue()).FirstOrDefault(); if (canUseSubNumering) { if (CompareGridLength(prevGridLength, currentGridLength) == GridLength.Equal) diff --git a/ONBOXApp/RenumberParking/Parking.cs b/ONBOXApp/RenumberParking/Parking.cs index e4a91d4..d506b8b 100644 --- a/ONBOXApp/RenumberParking/Parking.cs +++ b/ONBOXApp/RenumberParking/Parking.cs @@ -10,6 +10,7 @@ using Autodesk.Revit.Attributes; using Autodesk.Revit.UI.Selection; using System.Diagnostics; +using Utils; namespace ONBOXAppl { @@ -71,7 +72,7 @@ public Result Execute(ExternalCommandData commandData, ref string message, Eleme { if (currentParkingInfo.willBeNumbered == true) { - typesThatWillBeNumbered.Add(new ElementId(currentParkingInfo.TypeId)); + typesThatWillBeNumbered.Add(currentParkingInfo.TypeId.Ext_UniversalElemID()); } } @@ -146,7 +147,7 @@ public Result Execute(ExternalCommandData commandData, ref string message, Eleme { //The storedParkingLevelInfo is global variable and it got initialisead in the UI, calling the getAllLevels() method in this class //TODO Again, move this to a local variable - LevelInfo lvlInfo = ONBOXApplication.storedParkingLevelInfo.Where(e => e.levelId == eLevel.Id.IntegerValue).First(); + LevelInfo lvlInfo = ONBOXApplication.storedParkingLevelInfo.Where(e => e.levelId == eLevel.Id.Ext_IntValue()).First(); if (lvlInfo.willBeNumbered == false) { @@ -163,7 +164,7 @@ public Result Execute(ExternalCommandData commandData, ref string message, Eleme //TODO use this in conjuntion with the storedParkingInfo so we only loop through the level info one time foreach (LevelInfo currentLevelInfo in ONBOXApplication.storedParkingLevelInfo) { - if (currentLevelInfo.levelId == eLevel.Id.IntegerValue) + if (currentLevelInfo.levelId == eLevel.Id.Ext_IntValue()) { currentLevelPrefix = currentLevelInfo.levelPrefix; } @@ -225,7 +226,7 @@ public Result Execute(ExternalCommandData commandData, ref string message, Eleme //Again, thats a Global Variable //TODO Create a local Variable for this one as well - string typePrefix = ONBOXApplication.storedParkingTypesInfo.Where(e => e.TypeId == ePark.GetTypeId().IntegerValue).First().TypePrefix; + string typePrefix = ONBOXApplication.storedParkingTypesInfo.Where(e => e.TypeId == ePark.GetTypeId().Ext_IntValue()).First().TypePrefix; ePark.get_Parameter(BuiltInParameter.DOOR_NUMBER).Set(currentLevelPrefix + typePrefix + counter.ToString()); counter++; @@ -241,7 +242,7 @@ public Result Execute(ExternalCommandData commandData, ref string message, Eleme distance = Utils.ConvertM.feetToM(distance); //TODO Gobal Variable to local - ParkingTypesInfo currentTypeInfo = ONBOXApplication.storedParkingTypesInfo.Where(e => e.TypeId == currentPark.GetTypeId().IntegerValue).First(); + ParkingTypesInfo currentTypeInfo = ONBOXApplication.storedParkingTypesInfo.Where(e => e.TypeId == currentPark.GetTypeId().Ext_IntValue()).First(); //The tolerance to include this parking as a part of the current block will be this double tolerance = currentTypeInfo.TypeWidth + 0.1; @@ -277,7 +278,7 @@ public Result Execute(ExternalCommandData commandData, ref string message, Eleme double distance = (currentParkinLevel.Location as LocationPoint).Point.DistanceTo((prevElement.Location as LocationPoint).Point); distance = Utils.ConvertM.feetToM(distance); - ParkingTypesInfo currentTypeInfo = ONBOXApplication.storedParkingTypesInfo.Where(e => e.TypeId == currentParkinLevel.GetTypeId().IntegerValue).First(); + ParkingTypesInfo currentTypeInfo = ONBOXApplication.storedParkingTypesInfo.Where(e => e.TypeId == currentParkinLevel.GetTypeId().Ext_IntValue()).First(); double tolerance = currentTypeInfo.TypeWidth + 0.1; if ((distance < tolerance) && (!UsedParkingsInLevel.Contains(currentParkinLevel.Id))) @@ -302,7 +303,7 @@ public Result Execute(ExternalCommandData commandData, ref string message, Eleme { counter++; } - ParkingTypesInfo currentTypeInfo = ONBOXApplication.storedParkingTypesInfo.Where(e => e.TypeId == currentParking.GetTypeId().IntegerValue).First(); + ParkingTypesInfo currentTypeInfo = ONBOXApplication.storedParkingTypesInfo.Where(e => e.TypeId == currentParking.GetTypeId().Ext_IntValue()).First(); currentParking.get_Parameter(BuiltInParameter.DOOR_NUMBER).Set(currentLevelPrefix + currentTypeInfo.TypePrefix + counter.ToString()); counter++; UsedParkingsInLevel.Add(currentParking.Id); @@ -398,7 +399,7 @@ static internal IList getAllLevels() { Level currentLevel = currentElement as Level; string currentLevelName = currentLevel.Name; - int currentLevelId = currentLevel.Id.IntegerValue; + int currentLevelId = currentLevel.Id.Ext_IntValue(); LevelInfo currentLevelInformation = new LevelInfo(); currentLevelInformation.levelName = currentLevelName; currentLevelInformation.levelId = currentLevelId; @@ -423,7 +424,7 @@ static internal IList getAllParkingTypesInfo() { if (!allUsedParkingTypesIDs.Contains(currentElement.GetTypeId())) { - int typeID = currentElement.GetTypeId().IntegerValue; + int typeID = currentElement.GetTypeId().Ext_IntValue(); string typeName = currentElement.Name; ParkingTypesInfo currentTypeInfo = new ParkingTypesInfo() { TypeName = typeName, TypeId = typeID, willBeNumbered = true, TypePrefix = "", TypeWidth = GetParkingWidth(currentElement) }; @@ -642,7 +643,7 @@ static internal void renameBlock(string inPrefix, string inNumber, bool isSingle double dist = (currentRemaining.Location as LocationPoint).Point.DistanceTo((prevElement.Location as LocationPoint).Point); dist = Utils.ConvertM.feetToM(dist); - ParkingTypesInfo currentTypeInfo = parkingInfo.Where(e => e.TypeId == currentRemaining.GetTypeId().IntegerValue).First(); + ParkingTypesInfo currentTypeInfo = parkingInfo.Where(e => e.TypeId == currentRemaining.GetTypeId().Ext_IntValue()).First(); double tolerance = currentTypeInfo.TypeWidth + 0.3; FamilyInstance currentParkInstance = currentRemaining as FamilyInstance; @@ -700,7 +701,7 @@ static internal IList getAllParkingTypesInfo() { if (!allUsedParkingTypesIDs.Contains(currentElement.GetTypeId())) { - int typeID = currentElement.GetTypeId().IntegerValue; + int typeID = currentElement.GetTypeId().Ext_IntValue(); string typeName = currentElement.Name; ParkingTypesInfo currentTypeInfo = new ParkingTypesInfo() { TypeName = typeName, TypeId = typeID, willBeNumbered = true, TypePrefix = "", TypeWidth = RenumberParking.GetParkingWidth(currentElement) }; diff --git a/ONBOXApp/Storage.cs b/ONBOXApp/Storage.cs index 0141522..3451113 100644 --- a/ONBOXApp/Storage.cs +++ b/ONBOXApp/Storage.cs @@ -6,6 +6,7 @@ using System.Linq; using System.Text; using System.Threading.Tasks; +using Utils; namespace ONBOXAppl { @@ -79,7 +80,7 @@ class RevitLinksInfo public RevitLinksInfo(RevitLinkInstance targetInstance) { Name = targetInstance.GetLinkDocument().Title; - Id = targetInstance.Id.IntegerValue; + Id = targetInstance.Id.Ext_IntValue(); } } diff --git a/ONBOXApp/TopoSlope/BoundsService.cs b/ONBOXApp/TopoSlope/BoundsService.cs index 3d0bdd3..c261642 100644 --- a/ONBOXApp/TopoSlope/BoundsService.cs +++ b/ONBOXApp/TopoSlope/BoundsService.cs @@ -1,4 +1,4 @@ -#if R2024 +#if REVIT2024UP using System.Collections.Generic; using System.Linq; diff --git a/ONBOXApp/TopoSlope/FindBoundsResult.cs b/ONBOXApp/TopoSlope/FindBoundsResult.cs index b61daf7..143976d 100644 --- a/ONBOXApp/TopoSlope/FindBoundsResult.cs +++ b/ONBOXApp/TopoSlope/FindBoundsResult.cs @@ -1,4 +1,4 @@ -#if R2024 +#if REVIT2024UP using System.Collections.Generic; using Autodesk.Revit.DB; diff --git a/ONBOXApp/TopoSlope/RetainingWallCommand.cs b/ONBOXApp/TopoSlope/RetainingWallCommand.cs index 6935b19..40e9422 100644 --- a/ONBOXApp/TopoSlope/RetainingWallCommand.cs +++ b/ONBOXApp/TopoSlope/RetainingWallCommand.cs @@ -1,4 +1,4 @@ -#if R2024 +#if REVIT2024UP using Autodesk.Revit.Attributes; using Autodesk.Revit.DB; using Autodesk.Revit.UI; @@ -7,6 +7,7 @@ using System.Collections.Generic; using System.Linq; using System.Security.Cryptography; +using Utils; namespace ONBOXAppl { @@ -143,7 +144,7 @@ public Result Execute(ExternalCommandData commandData, ref string message, Eleme //topoSolids.Add(topoSolid); - topoSolid.GetSlabShapeEditor().DrawPoint(point); + topoSolid.GetSlabShapeEditor().Ext_AddPoint(point); } var wallHeightParam = wall.GetParameter(new ForgeTypeId("autodesk.revit.parameter:wallBaseOffset-1.0.0")); @@ -155,7 +156,7 @@ public Result Execute(ExternalCommandData commandData, ref string message, Eleme point = new XYZ(point.X, point.Y, 5); //topoSolids.Add(topoSolid); - topoSolid.GetSlabShapeEditor().DrawPoint(point); + topoSolid.GetSlabShapeEditor().Ext_AddPoint(point); } t.Commit(); diff --git a/ONBOXApp/TopoSlope/TopoSlopesUI.xaml.cs b/ONBOXApp/TopoSlope/TopoSlopesUI.xaml.cs index 035411e..34855ec 100644 --- a/ONBOXApp/TopoSlope/TopoSlopesUI.xaml.cs +++ b/ONBOXApp/TopoSlope/TopoSlopesUI.xaml.cs @@ -76,7 +76,7 @@ internal double Angle public TopoSlopesUI() { InitializeComponent(); -#if R2024 +#if REVIT2024UP this.Title = Properties.WindowLanguage.ToposolidSolidGrading_Title; #endif } diff --git a/ONBOXApp/TopoSlope/TopoSolidSlopeCommand.cs b/ONBOXApp/TopoSlope/TopoSolidSlopeCommand.cs index c933c4a..5c6a86b 100644 --- a/ONBOXApp/TopoSlope/TopoSolidSlopeCommand.cs +++ b/ONBOXApp/TopoSlope/TopoSolidSlopeCommand.cs @@ -1,4 +1,4 @@ -#if R2024 +#if REVIT2024UP using System; using System.Collections.Generic; @@ -7,6 +7,7 @@ using Autodesk.Revit.DB; using Autodesk.Revit.UI; using ONBOXAppl.Properties; +using Utils; namespace ONBOXAppl { @@ -244,7 +245,7 @@ public Result RunTopoGrading(UIDocument uidoc, List topoSurfaces, ref s topoSolids.Add(topoSolid); - topoSolid.GetSlabShapeEditor().DrawPoint(point); + topoSolid.GetSlabShapeEditor().Ext_AddPoint(point); } foreach (var tuple in offsetOuterLoopPoints) @@ -254,7 +255,7 @@ public Result RunTopoGrading(UIDocument uidoc, List topoSurfaces, ref s topoSolids.Add(topoSolid); - topoSolid.GetSlabShapeEditor().DrawPoint(point); + topoSolid.GetSlabShapeEditor().Ext_AddPoint(point); } foreach (var toposolid in topoSolids) diff --git a/ONBOXApp/TypeSelectionFilter.cs b/ONBOXApp/TypeSelectionFilter.cs index c731310..39eb75d 100644 --- a/ONBOXApp/TypeSelectionFilter.cs +++ b/ONBOXApp/TypeSelectionFilter.cs @@ -1,4 +1,4 @@ -#if R2024 +#if REVIT2024UP using Autodesk.Revit.DB; using Autodesk.Revit.UI.Selection; diff --git a/ONBOXApp/Utils.cs b/ONBOXApp/Utils.cs index 40b0f6c..a3a391d 100644 --- a/ONBOXApp/Utils.cs +++ b/ONBOXApp/Utils.cs @@ -1,9 +1,10 @@ -using System; -using Autodesk.Revit.DB; +using Autodesk.Revit.DB; using Autodesk.Revit.UI; +using ONBOXAppl; +using System; using System.Collections.Generic; +using System.Diagnostics; using System.Linq; -using ONBOXAppl; namespace Utils { @@ -846,7 +847,7 @@ static internal IList GetAllLevelsInfo(UIDocument targetUidoc) { Level currentLevel = currentElement as Level; string currentLevelName = currentLevel.Name; - int currentLevelId = currentLevel.Id.IntegerValue; + int currentLevelId = currentLevel.Id.Ext_IntValue(); LevelInfo currentLevelInformation = new LevelInfo(); currentLevelInformation.levelName = currentLevelName; currentLevelInformation.levelId = currentLevelId; @@ -867,7 +868,7 @@ static internal IList GetAllLevelsInfo(Document targetDoc) { Level currentLevel = currentElement as Level; string currentLevelName = currentLevel.Name; - int currentLevelId = currentLevel.Id.IntegerValue; + int currentLevelId = currentLevel.Id.Ext_IntValue(); LevelInfo currentLevelInformation = new LevelInfo(); currentLevelInformation.levelName = currentLevelName; currentLevelInformation.levelId = currentLevelId; @@ -951,7 +952,7 @@ static internal IList GetAllBeamFamilies(Document targetDoc) foreach (Family currentElem in allColumnFamiliesFilt) { string currentFamilyName = (currentElem as Family).Name; - int currentFamilyID = currentElem.Id.IntegerValue; + int currentFamilyID = currentElem.Id.Ext_IntValue(); System.Drawing.Bitmap currentFirstTypeBitmap = (targetDoc.GetElement(((currentElem as Family) .GetFamilySymbolIds()).First()) as FamilySymbol).GetPreviewImage(new System.Drawing.Size(60, 60)); @@ -1078,4 +1079,66 @@ static internal int GetTheFirstIntFromString(string targetString, bool isLooping return resolvedInt; } } + + static class UrlOpener + { + public static void Open(string url) + { + if (!Uri.TryCreate(url, UriKind.Absolute, out var u)) + u = new Uri("http://" + url.Trim()); + + try + { + // Fast path, works in most contexts + Process.Start(new ProcessStartInfo + { + FileName = u.AbsoluteUri, + UseShellExecute = true + }); + } + catch + { + // Shell-resolved fallback: always asks Windows for the default handler + Process.Start(new ProcessStartInfo + { + FileName = "cmd", + Arguments = $"/c start \"\" \"{u.AbsoluteUri}\"", + CreateNoWindow = true, + UseShellExecute = false + }); + } + } + } + + static class MethodExtensions + { + public static int Ext_IntValue(this ElementId id) + { +#if REVIT2024UP + return (int)id.Value; +#else + return id.IntegerValue; +#endif + } + + public static ElementId Ext_UniversalElemID(this int value) + { +#if REVIT2024UP + return new ElementId((long)value); +#else + return new ElementId(value); +#endif + } + + public static void Ext_AddPoint(this SlabShapeEditor sse, XYZ p) + { +#if REVIT2025UP + sse.Enable(); + sse.AddPoints(new List { p }); +#else + sse.DrawPoint(p); +#endif + } + + } } diff --git a/OnboxApp.bundle/PackageContents.xml b/OnboxApp.bundle/PackageContents.xml index fedf6bf..bf88526 100644 --- a/OnboxApp.bundle/PackageContents.xml +++ b/OnboxApp.bundle/PackageContents.xml @@ -28,10 +28,10 @@ - + - + \ No newline at end of file