From 3a2899b7f45e1c5602dc1b626d8f144112e0d3aa Mon Sep 17 00:00:00 2001 From: "Martin B. Henriksen" Date: Wed, 19 Oct 2022 15:09:52 +0200 Subject: [PATCH 01/15] add dlubal.RFEM NuGet pagkage --- .github/ISSUE_TEMPLATE/06_question.md | 2 +- .github/PULL_REQUEST_TEMPLATE.md | 2 +- PowershellScript.ps1 | 20 +++++++++---------- .../CRUD/Create/_ICreate.cs | 6 +++--- .../CRUD/Delete/_IDelete.cs | 6 +++--- .../CRUD/Read/_IRead.cs | 6 +++--- .../CRUD/Update/_IUpdate.cs | 6 +++--- .../Convert/FromRFEM6}/ExampleObject.cs | 8 ++++---- .../Convert/ToRFEM6}/ExampleObject.cs | 8 ++++---- .../RFEM6Adapter.cs | 12 +++++------ .../RFEM6_Adapter.csproj | 11 +++++----- .../Compute/ExampleComputeMethod.cs | 4 ++-- .../Create/ExampleCreateMethod.cs | 6 +++--- .../Modify/ExampleModifyMethod.cs | 6 +++--- .../Query/ExampleQueryMethod.cs | 6 +++--- .../RFEM6_Engine.csproj | 8 ++++++++ SoftwareName_Toolkit.sln => RFEM6_Toolkit.sln | 8 ++++---- .../ExampleObject.cs | 4 ++-- .../RFEM6_oM.csproj | 2 +- RenameToolkitFiles.bat | 2 +- dependencies.txt | 2 +- 21 files changed, 72 insertions(+), 63 deletions(-) rename {SoftwareName_Adapter => RFEM6_Adapter}/CRUD/Create/_ICreate.cs (97%) rename {SoftwareName_Adapter => RFEM6_Adapter}/CRUD/Delete/_IDelete.cs (96%) rename {SoftwareName_Adapter => RFEM6_Adapter}/CRUD/Read/_IRead.cs (96%) rename {SoftwareName_Adapter => RFEM6_Adapter}/CRUD/Update/_IUpdate.cs (95%) rename {SoftwareName_Adapter/Convert/FromSoftwareName => RFEM6_Adapter/Convert/FromRFEM6}/ExampleObject.cs (93%) rename {SoftwareName_Adapter/Convert/ToSoftwareName => RFEM6_Adapter/Convert/ToRFEM6}/ExampleObject.cs (93%) rename SoftwareName_Adapter/SoftwareNameAdapter.cs => RFEM6_Adapter/RFEM6Adapter.cs (92%) rename SoftwareName_Adapter/SoftwareName_Adapter.csproj => RFEM6_Adapter/RFEM6_Adapter.csproj (80%) rename {SoftwareName_Engine => RFEM6_Engine}/Compute/ExampleComputeMethod.cs (98%) rename {SoftwareName_Engine => RFEM6_Engine}/Create/ExampleCreateMethod.cs (96%) rename {SoftwareName_Engine => RFEM6_Engine}/Modify/ExampleModifyMethod.cs (96%) rename {SoftwareName_Engine => RFEM6_Engine}/Query/ExampleQueryMethod.cs (97%) rename SoftwareName_oM/SoftwareName_oM.csproj => RFEM6_Engine/RFEM6_Engine.csproj (72%) rename SoftwareName_Toolkit.sln => RFEM6_Toolkit.sln (76%) rename {SoftwareName_oM => RFEM6_oM}/ExampleObject.cs (98%) rename SoftwareName_Engine/SoftwareName_Engine.csproj => RFEM6_oM/RFEM6_oM.csproj (87%) diff --git a/.github/ISSUE_TEMPLATE/06_question.md b/.github/ISSUE_TEMPLATE/06_question.md index 2e4a3d80..7fa349ea 100644 --- a/.github/ISSUE_TEMPLATE/06_question.md +++ b/.github/ISSUE_TEMPLATE/06_question.md @@ -8,4 +8,4 @@ labels: "type:question" - \ No newline at end of file + diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index 3f70af9c..6aefc564 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -24,4 +24,4 @@ Closes # ### Additional comments - \ No newline at end of file + diff --git a/PowershellScript.ps1 b/PowershellScript.ps1 index f22b7164..c4f73ce5 100644 --- a/PowershellScript.ps1 +++ b/PowershellScript.ps1 @@ -1,12 +1,12 @@ using namespace System.IO using namespace System.Collections.Generic -$softwareName = Read-Host "Please enter the software name." +$RFEM6 = Read-Host "Please enter the software name." -# Replace occurrences of "SoftwareName" in all files +# Replace occurrences of "RFEM6" in all files Get-ChildItem -File -Recurse | ForEach-Object { try { - (Get-Content $_.FullName) -replace 'SoftwareName', $softwareName | Set-Content $_.FullName + (Get-Content $_.FullName) -replace 'RFEM6', $RFEM6 | Set-Content $_.FullName } catch {} } @@ -16,11 +16,11 @@ $stack = [Stack[string]]::new() $allPaths = [List[string]]::new() -# Get all files and directories containing "SoftwareName" recursively +# Get all files and directories containing "RFEM6" recursively Get-ChildItem -Recurse -Directory | ForEach-Object { $dirpath = $_.FullName $dirname = Split-Path $dirpath -Leaf - if ($dirname.Contains("SoftwareName")) + if ($dirname.Contains("RFEM6")) { Write-Host "dirpath: " $dirpath $stack.Push($dirpath) @@ -32,7 +32,7 @@ Get-ChildItem -Recurse -Directory | ForEach-Object { foreach ($file in [Directory]::EnumerateFiles($dirpath)) { $filename = [Path]::GetFileName($file) - if ($filename.Contains('SoftwareName') -and -not $allPaths.Contains($file)) + if ($filename.Contains('RFEM6') -and -not $allPaths.Contains($file)) { Write-Host "filepath: " $file $stack.Push($file) @@ -43,7 +43,7 @@ Get-ChildItem -Recurse -Directory | ForEach-Object { # Add root files Get-ChildItem -File | ForEach-Object { - if ($_.FullName.Contains("SoftwareName")) { + if ($_.FullName.Contains("RFEM6")) { Write-Host "filepath: " $_.FullName $stack.Push($_.FullName) } @@ -56,12 +56,12 @@ while ($stack.Count) { $filename = [Path]::GetFileName($poppedFullName) - if($filename.Contains('SoftwareName') -and $pathExists) + if($filename.Contains('RFEM6') -and $pathExists) { - $newName = $filename.Replace('SoftwareName', $softwareName) + $newName = $filename.Replace('RFEM6', $RFEM6) Write-Host "Renaming: " $poppedFullName " to: " $newName Rename-Item -LiteralPath $poppedFullName -NewName $newName #-WhatIf } -} \ No newline at end of file +} diff --git a/SoftwareName_Adapter/CRUD/Create/_ICreate.cs b/RFEM6_Adapter/CRUD/Create/_ICreate.cs similarity index 97% rename from SoftwareName_Adapter/CRUD/Create/_ICreate.cs rename to RFEM6_Adapter/CRUD/Create/_ICreate.cs index f1fdb844..2c37420f 100644 --- a/SoftwareName_Adapter/CRUD/Create/_ICreate.cs +++ b/RFEM6_Adapter/CRUD/Create/_ICreate.cs @@ -1,4 +1,4 @@ -/* +/* * This file is part of the Buildings and Habitats object Model (BHoM) * Copyright (c) 2015 - 2022, the respective contributors. All rights reserved. * @@ -28,9 +28,9 @@ using System.Text; using System.Threading.Tasks; -namespace BH.Adapter.SoftwareName +namespace BH.Adapter.RFEM6 { - public partial class SoftwareNameAdapter : BHoMAdapter + public partial class RFEM6Adapter : BHoMAdapter { // NOTE: CRUD folder methods // All methods in the CRUD folder are used as "back-end" methods by the Adapter itself. diff --git a/SoftwareName_Adapter/CRUD/Delete/_IDelete.cs b/RFEM6_Adapter/CRUD/Delete/_IDelete.cs similarity index 96% rename from SoftwareName_Adapter/CRUD/Delete/_IDelete.cs rename to RFEM6_Adapter/CRUD/Delete/_IDelete.cs index 6593ef83..964f82e2 100644 --- a/SoftwareName_Adapter/CRUD/Delete/_IDelete.cs +++ b/RFEM6_Adapter/CRUD/Delete/_IDelete.cs @@ -1,4 +1,4 @@ -/* +/* * This file is part of the Buildings and Habitats object Model (BHoM) * Copyright (c) 2015 - 2022, the respective contributors. All rights reserved. * @@ -27,9 +27,9 @@ using System.Text; using System.Threading.Tasks; -namespace BH.Adapter.SoftwareName +namespace BH.Adapter.RFEM6 { - public partial class SoftwareNameAdapter : BHoMAdapter + public partial class RFEM6Adapter : BHoMAdapter { // Basic Delete method that deletes objects depending on their Type and Id. // It gets called by the Push or by the Remove Adapter Actions. diff --git a/SoftwareName_Adapter/CRUD/Read/_IRead.cs b/RFEM6_Adapter/CRUD/Read/_IRead.cs similarity index 96% rename from SoftwareName_Adapter/CRUD/Read/_IRead.cs rename to RFEM6_Adapter/CRUD/Read/_IRead.cs index e56d858b..57fa90dd 100644 --- a/SoftwareName_Adapter/CRUD/Read/_IRead.cs +++ b/RFEM6_Adapter/CRUD/Read/_IRead.cs @@ -1,4 +1,4 @@ -/* +/* * This file is part of the Buildings and Habitats object Model (BHoM) * Copyright (c) 2015 - 2022, the respective contributors. All rights reserved. * @@ -29,9 +29,9 @@ using System.Text; using System.Threading.Tasks; -namespace BH.Adapter.SoftwareName +namespace BH.Adapter.RFEM6 { - public partial class SoftwareNameAdapter : BHoMAdapter + public partial class RFEM6Adapter : BHoMAdapter { /***************************************************/ /**** Adapter overload method ****/ diff --git a/SoftwareName_Adapter/CRUD/Update/_IUpdate.cs b/RFEM6_Adapter/CRUD/Update/_IUpdate.cs similarity index 95% rename from SoftwareName_Adapter/CRUD/Update/_IUpdate.cs rename to RFEM6_Adapter/CRUD/Update/_IUpdate.cs index 2509ee73..4cc7ec06 100644 --- a/SoftwareName_Adapter/CRUD/Update/_IUpdate.cs +++ b/RFEM6_Adapter/CRUD/Update/_IUpdate.cs @@ -1,4 +1,4 @@ -/* +/* * This file is part of the Buildings and Habitats object Model (BHoM) * Copyright (c) 2015 - 2022, the respective contributors. All rights reserved. * @@ -27,9 +27,9 @@ using System.Text; using System.Threading.Tasks; -namespace BH.Adapter.SoftwareName +namespace BH.Adapter.RFEM6 { - public partial class SoftwareNameAdapter : BHoMAdapter + public partial class RFEM6Adapter : BHoMAdapter { // This method gets called when appropriate by the Push method contained in the base Adapter class. // Unlike the Create, Delete and Read, this method already exposes a simple implementation: it calls Delete and then Create. diff --git a/SoftwareName_Adapter/Convert/FromSoftwareName/ExampleObject.cs b/RFEM6_Adapter/Convert/FromRFEM6/ExampleObject.cs similarity index 93% rename from SoftwareName_Adapter/Convert/FromSoftwareName/ExampleObject.cs rename to RFEM6_Adapter/Convert/FromRFEM6/ExampleObject.cs index 314318e4..432fdd86 100644 --- a/SoftwareName_Adapter/Convert/FromSoftwareName/ExampleObject.cs +++ b/RFEM6_Adapter/Convert/FromRFEM6/ExampleObject.cs @@ -1,4 +1,4 @@ -/* +/* * This file is part of the Buildings and Habitats object Model (BHoM) * Copyright (c) 2015 - 2022, the respective contributors. All rights reserved. * @@ -20,7 +20,7 @@ * along with this code. If not, see . */ -using BH.oM.Adapters.SoftwareName; +using BH.oM.Adapters.RFEM6; using BH.oM.Base; using System; using System.Collections.Generic; @@ -28,7 +28,7 @@ using System.Text; using System.Threading.Tasks; -namespace BH.Adapter.SoftwareName +namespace BH.Adapter.RFEM6 { public static partial class Convert { @@ -38,7 +38,7 @@ public static partial class Convert // Add methods for converting to BHoM from the specific software types. // Example: - public static BHoMObject FromSoftwareName(this ExampleObject node) + public static BHoMObject FromRFEM6(this ExampleObject node) { //Insert code for convertion throw new NotImplementedException(); diff --git a/SoftwareName_Adapter/Convert/ToSoftwareName/ExampleObject.cs b/RFEM6_Adapter/Convert/ToRFEM6/ExampleObject.cs similarity index 93% rename from SoftwareName_Adapter/Convert/ToSoftwareName/ExampleObject.cs rename to RFEM6_Adapter/Convert/ToRFEM6/ExampleObject.cs index e13ff4ea..56b29cab 100644 --- a/SoftwareName_Adapter/Convert/ToSoftwareName/ExampleObject.cs +++ b/RFEM6_Adapter/Convert/ToRFEM6/ExampleObject.cs @@ -1,4 +1,4 @@ -/* +/* * This file is part of the Buildings and Habitats object Model (BHoM) * Copyright (c) 2015 - 2022, the respective contributors. All rights reserved. * @@ -20,7 +20,7 @@ * along with this code. If not, see . */ -using BH.oM.Adapters.SoftwareName; +using BH.oM.Adapters.RFEM6; using BH.oM.Base; using System; using System.Collections.Generic; @@ -28,7 +28,7 @@ using System.Text; using System.Threading.Tasks; -namespace BH.Adapter.SoftwareName +namespace BH.Adapter.RFEM6 { public static partial class Convert { @@ -38,7 +38,7 @@ public static partial class Convert // Add methods for converting from BHoM to the specific software types // Example: - public static ExampleObject ToSoftwareName(this BHoMObject node) + public static ExampleObject ToRFEM6(this BHoMObject node) { //Insert code for convertion throw new NotImplementedException(); diff --git a/SoftwareName_Adapter/SoftwareNameAdapter.cs b/RFEM6_Adapter/RFEM6Adapter.cs similarity index 92% rename from SoftwareName_Adapter/SoftwareNameAdapter.cs rename to RFEM6_Adapter/RFEM6Adapter.cs index fc1a54d4..fb9ad970 100644 --- a/SoftwareName_Adapter/SoftwareNameAdapter.cs +++ b/RFEM6_Adapter/RFEM6Adapter.cs @@ -1,4 +1,4 @@ -/* +/* * This file is part of the Buildings and Habitats object Model (BHoM) * Copyright (c) 2015 - 2022, the respective contributors. All rights reserved. * @@ -29,17 +29,17 @@ using System.Text; using System.Threading.Tasks; -namespace BH.Adapter.SoftwareName +namespace BH.Adapter.RFEM6 { - public partial class SoftwareNameAdapter : BHoMAdapter + public partial class RFEM6Adapter : BHoMAdapter { /***************************************************/ /**** Constructors ****/ /***************************************************/ - [Description("Adapter for SoftwareName.")] - [Output("The created SoftwareName adapter.")] - public SoftwareNameAdapter() + [Description("Adapter for RFEM6.")] + [Output("The created RFEM6 adapter.")] + public RFEM6Adapter() { // The Adapter constructor can be used to configure the Adapter behaviour. // For example: diff --git a/SoftwareName_Adapter/SoftwareName_Adapter.csproj b/RFEM6_Adapter/RFEM6_Adapter.csproj similarity index 80% rename from SoftwareName_Adapter/SoftwareName_Adapter.csproj rename to RFEM6_Adapter/RFEM6_Adapter.csproj index 0986150c..2f1bf595 100644 --- a/SoftwareName_Adapter/SoftwareName_Adapter.csproj +++ b/RFEM6_Adapter/RFEM6_Adapter.csproj @@ -1,18 +1,19 @@ - + netstandard2.0 - SoftwareName_Adapter - BH.Adapter.SoftwareName + RFEM6_Adapter + BH.Adapter.RFEM6 + - - + + diff --git a/SoftwareName_Engine/Compute/ExampleComputeMethod.cs b/RFEM6_Engine/Compute/ExampleComputeMethod.cs similarity index 98% rename from SoftwareName_Engine/Compute/ExampleComputeMethod.cs rename to RFEM6_Engine/Compute/ExampleComputeMethod.cs index 21580803..ac44554c 100644 --- a/SoftwareName_Engine/Compute/ExampleComputeMethod.cs +++ b/RFEM6_Engine/Compute/ExampleComputeMethod.cs @@ -1,4 +1,4 @@ -/* +/* * This file is part of the Buildings and Habitats object Model (BHoM) * Copyright (c) 2015 - 2022, the respective contributors. All rights reserved. * @@ -27,7 +27,7 @@ using System.ComponentModel; using System.Linq; -namespace BH.Engine.Adapters.SoftwareName +namespace BH.Engine.Adapters.RFEM6 { public static partial class Compute { diff --git a/SoftwareName_Engine/Create/ExampleCreateMethod.cs b/RFEM6_Engine/Create/ExampleCreateMethod.cs similarity index 96% rename from SoftwareName_Engine/Create/ExampleCreateMethod.cs rename to RFEM6_Engine/Create/ExampleCreateMethod.cs index 7513469a..89a4ebdb 100644 --- a/SoftwareName_Engine/Create/ExampleCreateMethod.cs +++ b/RFEM6_Engine/Create/ExampleCreateMethod.cs @@ -1,4 +1,4 @@ -/* +/* * This file is part of the Buildings and Habitats object Model (BHoM) * Copyright (c) 2015 - 2022, the respective contributors. All rights reserved. * @@ -20,7 +20,7 @@ * along with this code. If not, see . */ -using BH.oM.Adapters.SoftwareName; +using BH.oM.Adapters.RFEM6; using BH.oM.Base; using BH.oM.Base.Attributes; using System; @@ -28,7 +28,7 @@ using System.ComponentModel; using System.Linq; -namespace BH.Engine.Adapters.SoftwareName +namespace BH.Engine.Adapters.RFEM6 { public static partial class Create { diff --git a/SoftwareName_Engine/Modify/ExampleModifyMethod.cs b/RFEM6_Engine/Modify/ExampleModifyMethod.cs similarity index 96% rename from SoftwareName_Engine/Modify/ExampleModifyMethod.cs rename to RFEM6_Engine/Modify/ExampleModifyMethod.cs index 0f29996e..0c29593f 100644 --- a/SoftwareName_Engine/Modify/ExampleModifyMethod.cs +++ b/RFEM6_Engine/Modify/ExampleModifyMethod.cs @@ -1,4 +1,4 @@ -/* +/* * This file is part of the Buildings and Habitats object Model (BHoM) * Copyright (c) 2015 - 2022, the respective contributors. All rights reserved. * @@ -22,13 +22,13 @@ using BH.oM.Base; using BH.oM.Base.Attributes; -using BH.oM.Adapters.SoftwareName; +using BH.oM.Adapters.RFEM6; using System; using System.Collections.Generic; using System.ComponentModel; using System.Linq; -namespace BH.Engine.Adapters.SoftwareName +namespace BH.Engine.Adapters.RFEM6 { public static partial class Modify { diff --git a/SoftwareName_Engine/Query/ExampleQueryMethod.cs b/RFEM6_Engine/Query/ExampleQueryMethod.cs similarity index 97% rename from SoftwareName_Engine/Query/ExampleQueryMethod.cs rename to RFEM6_Engine/Query/ExampleQueryMethod.cs index 1fb202d6..6734a7d6 100644 --- a/SoftwareName_Engine/Query/ExampleQueryMethod.cs +++ b/RFEM6_Engine/Query/ExampleQueryMethod.cs @@ -1,4 +1,4 @@ -/* +/* * This file is part of the Buildings and Habitats object Model (BHoM) * Copyright (c) 2015 - 2022, the respective contributors. All rights reserved. * @@ -20,7 +20,7 @@ * along with this code. If not, see . */ -using BH.oM.Adapters.SoftwareName; +using BH.oM.Adapters.RFEM6; using BH.oM.Base; using BH.oM.Base.Attributes; using System; @@ -28,7 +28,7 @@ using System.ComponentModel; using System.Linq; -namespace BH.Engine.Adapters.SoftwareName +namespace BH.Engine.Adapters.RFEM6 { public static partial class Query { diff --git a/SoftwareName_oM/SoftwareName_oM.csproj b/RFEM6_Engine/RFEM6_Engine.csproj similarity index 72% rename from SoftwareName_oM/SoftwareName_oM.csproj rename to RFEM6_Engine/RFEM6_Engine.csproj index b796ce0a..9e8e8eb2 100644 --- a/SoftwareName_oM/SoftwareName_oM.csproj +++ b/RFEM6_Engine/RFEM6_Engine.csproj @@ -4,6 +4,14 @@ netstandard2.0 + + + + + + + + C:\ProgramData\BHoM\Assemblies\BHoM.dll diff --git a/SoftwareName_Toolkit.sln b/RFEM6_Toolkit.sln similarity index 76% rename from SoftwareName_Toolkit.sln rename to RFEM6_Toolkit.sln index 4d7481e8..c9396f95 100644 --- a/SoftwareName_Toolkit.sln +++ b/RFEM6_Toolkit.sln @@ -1,13 +1,13 @@ - + Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio Version 16 VisualStudioVersion = 16.0.32901.82 MinimumVisualStudioVersion = 10.0.40219.1 -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SoftwareName_Adapter", "SoftwareName_Adapter\SoftwareName_Adapter.csproj", "{F84BEFC2-C702-4A86-9626-C7FA48785606}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "RFEM6_Adapter", "RFEM6_Adapter\RFEM6_Adapter.csproj", "{F84BEFC2-C702-4A86-9626-C7FA48785606}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SoftwareName_Engine", "SoftwareName_Engine\SoftwareName_Engine.csproj", "{C68B4D77-E46D-41C9-A72C-F29984D8AB4A}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "RFEM6_Engine", "RFEM6_Engine\RFEM6_Engine.csproj", "{C68B4D77-E46D-41C9-A72C-F29984D8AB4A}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SoftwareName_oM", "SoftwareName_oM\SoftwareName_oM.csproj", "{FA23407E-1C08-4183-A02E-A57FA9D09BCA}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "RFEM6_oM", "RFEM6_oM\RFEM6_oM.csproj", "{FA23407E-1C08-4183-A02E-A57FA9D09BCA}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution diff --git a/SoftwareName_oM/ExampleObject.cs b/RFEM6_oM/ExampleObject.cs similarity index 98% rename from SoftwareName_oM/ExampleObject.cs rename to RFEM6_oM/ExampleObject.cs index f9b5db17..00e859c6 100644 --- a/SoftwareName_oM/ExampleObject.cs +++ b/RFEM6_oM/ExampleObject.cs @@ -1,4 +1,4 @@ -/* +/* * This file is part of the Buildings and Habitats object Model (BHoM) * Copyright (c) 2015 - 2022, the respective contributors. All rights reserved. * @@ -27,7 +27,7 @@ using System.ComponentModel; using System.Linq; -namespace BH.oM.Adapters.SoftwareName +namespace BH.oM.Adapters.RFEM6 { [Description("Object description in here. Will appear in the UI tooltip.")] public class ExampleObject : BHoMObject diff --git a/SoftwareName_Engine/SoftwareName_Engine.csproj b/RFEM6_oM/RFEM6_oM.csproj similarity index 87% rename from SoftwareName_Engine/SoftwareName_Engine.csproj rename to RFEM6_oM/RFEM6_oM.csproj index 55715bb8..f92468e8 100644 --- a/SoftwareName_Engine/SoftwareName_Engine.csproj +++ b/RFEM6_oM/RFEM6_oM.csproj @@ -5,7 +5,7 @@ - + diff --git a/RenameToolkitFiles.bat b/RenameToolkitFiles.bat index 00c2b2ee..6beadb9a 100644 --- a/RenameToolkitFiles.bat +++ b/RenameToolkitFiles.bat @@ -1 +1 @@ -PowerShell -NoProfile -ExecutionPolicy Bypass -Command "& './PowershellScript.ps1'" \ No newline at end of file +PowerShell -NoProfile -ExecutionPolicy Bypass -Command "& './PowershellScript.ps1'" diff --git a/dependencies.txt b/dependencies.txt index c859174b..7c8f6217 100644 --- a/dependencies.txt +++ b/dependencies.txt @@ -1,3 +1,3 @@ BHoM/BHoM BHoM/BHoM_Engine -BHoM/BHoM_Adapter \ No newline at end of file +BHoM/BHoM_Adapter From 4b8b832c1a2e59b3730bf33884f3fc03106500ea Mon Sep 17 00:00:00 2001 From: "Martin B. Henriksen" Date: Wed, 19 Oct 2022 17:01:44 +0200 Subject: [PATCH 02/15] add required references and initial adapter setup --- RFEM6_Adapter/RFEM6Adapter.cs | 71 +++++++++++++++++++++++++++--- RFEM6_Adapter/RFEM6_Adapter.csproj | 27 ++++++++++++ 2 files changed, 93 insertions(+), 5 deletions(-) diff --git a/RFEM6_Adapter/RFEM6Adapter.cs b/RFEM6_Adapter/RFEM6Adapter.cs index fb9ad970..eddd9150 100644 --- a/RFEM6_Adapter/RFEM6Adapter.cs +++ b/RFEM6_Adapter/RFEM6Adapter.cs @@ -22,6 +22,8 @@ using BH.Adapter; using BH.oM.Base.Attributes; + + using System; using System.Collections.Generic; using System.ComponentModel; @@ -29,6 +31,17 @@ using System.Text; using System.Threading.Tasks; +using Dlubal.WS.Rfem6.Application; +using Dlubal.WS.Rfem6.Model; +using BH.oM.Structure.Elements; +using BH.oM.Structure.SectionProperties; +using BH.oM.Structure.MaterialFragments; +using BH.oM.Structure.Constraints; +using BH.Engine.Base.Objects; +using BH.oM.Structure.SurfaceProperties; +using BH.oM.Structure.Loads; +using System.ServiceModel; + namespace BH.Adapter.RFEM6 { public partial class RFEM6Adapter : BHoMAdapter @@ -39,17 +52,51 @@ public partial class RFEM6Adapter : BHoMAdapter [Description("Adapter for RFEM6.")] [Output("The created RFEM6 adapter.")] - public RFEM6Adapter() + public RFEM6Adapter(bool active = false) { // The Adapter constructor can be used to configure the Adapter behaviour. // For example: m_AdapterSettings.DefaultPushType = oM.Adapter.PushType.CreateOnly; // Adapter `Push` Action simply calls "Create" method. - + // See the wiki, the AdapterSettings object and other Adapters to see how it can be configured. + //AdapterIdFragmentType = typeof(RFEMId); + BH.Adapter.Modules.Structure.ModuleLoader.LoadModules(this); + + AdapterComparers = new Dictionary + { + {typeof(Bar), new BH.Engine.Structure.BarEndNodesDistanceComparer(3) }, + {typeof(Node), new BH.Engine.Structure.NodeDistanceComparer(3) }, + {typeof(ISectionProperty), new BHoMObjectNameOrToStringComparer() }, + {typeof(IMaterialFragment), new BHoMObjectNameComparer() }, + {typeof(LinkConstraint), new BHoMObjectNameComparer() }, + }; + + DependencyTypes = new Dictionary> + { + {typeof(Bar), new List { typeof(ISectionProperty), typeof(Node) } }, + {typeof(ISectionProperty), new List { typeof(IMaterialFragment) } }, + {typeof(RigidLink), new List { typeof(LinkConstraint), typeof(Node) } }, + {typeof(FEMesh), new List { typeof(ISurfaceProperty), typeof(Node) } }, + {typeof(ISurfaceProperty), new List { typeof(IMaterialFragment) } }, + {typeof(Panel), new List { typeof(ISurfaceProperty) } }, + {typeof(ILoad), new List { typeof(Loadcase) } }, + {typeof(LoadCombination), new List { typeof(Loadcase) } } + }; + + - // If your toolkit needs to define this.AdapterComparers and or this.DependencyTypes, - // this constructor has to populate those properties. - // See the wiki for more information. + if (active) + { + // creates new model + string modelName = "MyTestModel"; + string modelUrl = application.new_model(modelName); + + // connects to RFEM6/RSTAB9 model + RfemModelClient model = new RfemModelClient(Binding, new EndpointAddress(modelUrl)); + model.reset(); + + + } } // You can add any other constructors that take more inputs here. @@ -64,6 +111,20 @@ public RFEM6Adapter() // we place them in the Engine project, and then reference them from the Adapter. // See the wiki for more information. + + //RFEM stuff ---------------------------- + public static EndpointAddress Address { get; set; } = new EndpointAddress("http://localhost:8081"); + + private static BasicHttpBinding Binding + { + get + { + BasicHttpBinding binding = new BasicHttpBinding { SendTimeout = new TimeSpan(0, 0, 180), UseDefaultWebProxy = true, }; + return binding; + } + } + private static RfemApplicationClient application = null; + /***************************************************/ } } diff --git a/RFEM6_Adapter/RFEM6_Adapter.csproj b/RFEM6_Adapter/RFEM6_Adapter.csproj index 2f1bf595..594d07a4 100644 --- a/RFEM6_Adapter/RFEM6_Adapter.csproj +++ b/RFEM6_Adapter/RFEM6_Adapter.csproj @@ -27,6 +27,9 @@ false false + + ..\..\..\ProgramData\BHoM\Assemblies\Analytical_oM.dll + C:\ProgramData\BHoM\Assemblies\BHoM.dll false @@ -42,6 +45,30 @@ false false + + ..\..\..\ProgramData\BHoM\Assemblies\Data_oM.dll + + + ..\..\..\ProgramData\BHoM\Assemblies\Geometry_Engine.dll + + + ..\..\..\ProgramData\BHoM\Assemblies\Geometry_oM.dll + + + ..\..\..\ProgramData\BHoM\Assemblies\Spatial_Engine.dll + + + ..\..\..\ProgramData\BHoM\Assemblies\Spatial_oM.dll + + + ..\..\..\ProgramData\BHoM\Assemblies\Structure_AdapterModules.dll + + + ..\..\..\ProgramData\BHoM\Assemblies\Structure_Engine.dll + + + ..\..\..\ProgramData\BHoM\Assemblies\Structure_oM.dll + From 092a02556c118973c22525d9f7f6478228c71494 Mon Sep 17 00:00:00 2001 From: "Martin B. Henriksen" Date: Wed, 19 Oct 2022 17:32:54 +0200 Subject: [PATCH 03/15] initial read node class --- RFEM6_Adapter/CRUD/Create/Node.cs | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 RFEM6_Adapter/CRUD/Create/Node.cs diff --git a/RFEM6_Adapter/CRUD/Create/Node.cs b/RFEM6_Adapter/CRUD/Create/Node.cs new file mode 100644 index 00000000..f778ab9e --- /dev/null +++ b/RFEM6_Adapter/CRUD/Create/Node.cs @@ -0,0 +1,28 @@ +using System; +using System.Collections.Generic; +using System.Text; + +using BH.oM.Adapter; +using BH.oM.Structure.Elements; + +using rfModel = Dlubal.WS.Rfem6.Model; + +namespace BH.Adapter.RFEM6 +{ + public partial class RFEM6Adapter + { + private bool Create(Node bhNode) + { + rfModel.node n1 = new rfModel.node() + { + no = 1, + coordinates = new rfModel.vector_3d() { x = bhNode.Position.X, y = bhNode.Position.Y, z = bhNode.Position.Z}, + coordinate_system_type = rfModel.node_coordinate_system_type.COORDINATE_SYSTEM_CARTESIAN, + coordinate_system_typeSpecified = true, + comment = "concrete part" + }; + + return true; + } + } +} From 9686f02ea5ac6e2a202c1008ebcb21be1206e261 Mon Sep 17 00:00:00 2001 From: "Martin B. Henriksen" Date: Thu, 20 Oct 2022 17:03:38 +0200 Subject: [PATCH 04/15] initial create Node class --- RFEM6_Adapter/CRUD/Create/Node.cs | 29 +++++++++++++++++++-------- RFEM6_Adapter/CRUD/Create/_ICreate.cs | 20 +++++++++++++++--- RFEM6_Adapter/RFEM6Adapter.cs | 3 ++- RFEM6_Adapter/RFEM6_Adapter.csproj | 3 +++ 4 files changed, 43 insertions(+), 12 deletions(-) diff --git a/RFEM6_Adapter/CRUD/Create/Node.cs b/RFEM6_Adapter/CRUD/Create/Node.cs index f778ab9e..af22ad33 100644 --- a/RFEM6_Adapter/CRUD/Create/Node.cs +++ b/RFEM6_Adapter/CRUD/Create/Node.cs @@ -1,5 +1,6 @@ using System; using System.Collections.Generic; +using System.Linq; using System.Text; using BH.oM.Adapter; @@ -11,16 +12,28 @@ namespace BH.Adapter.RFEM6 { public partial class RFEM6Adapter { - private bool Create(Node bhNode) + private bool CreateCollection(IEnumerable bhNodes) { - rfModel.node n1 = new rfModel.node() + + //NOTE:A geometric object has, in general, a parent_no = 0. The parent_no parameter becomes significant for example with loads. + int nodeId = model.get_first_free_number(rfModel.object_types.E_OBJECT_TYPE_NODE, 0); + + for(int i = 0; i < bhNodes.Count(); i++) { - no = 1, - coordinates = new rfModel.vector_3d() { x = bhNode.Position.X, y = bhNode.Position.Y, z = bhNode.Position.Z}, - coordinate_system_type = rfModel.node_coordinate_system_type.COORDINATE_SYSTEM_CARTESIAN, - coordinate_system_typeSpecified = true, - comment = "concrete part" - }; + Node bhNode = bhNodes.ToList()[i]; + + rfModel.node rfNode = new rfModel.node() + { + no = nodeId+i, + coordinates = new rfModel.vector_3d() { x = bhNode.Position.X, y = bhNode.Position.Y, z = bhNode.Position.Z }, + coordinate_system_type = rfModel.node_coordinate_system_type.COORDINATE_SYSTEM_CARTESIAN, + coordinate_system_typeSpecified = true, + comment = "concrete part" + }; + model.set_node(rfNode); + + } + return true; } diff --git a/RFEM6_Adapter/CRUD/Create/_ICreate.cs b/RFEM6_Adapter/CRUD/Create/_ICreate.cs index 2c37420f..fd65d1e7 100644 --- a/RFEM6_Adapter/CRUD/Create/_ICreate.cs +++ b/RFEM6_Adapter/CRUD/Create/_ICreate.cs @@ -48,9 +48,23 @@ protected override bool ICreate(IEnumerable objects, ActionConfig actionCo // In other words: foreach (T obj in objects) { - success &= Create(obj as dynamic); - } + //success &= Create(obj as dynamic); + if (objects.Count() > 0) + { + //AppLock(); + try + { + model.begin_modification("Geometry"); + success = CreateCollection(objects as dynamic); //Calls the correct CreateCollection method based on dynamic casting + } + finally + { + //AppUnlock(); + model.finish_modification(); + } + } + } // Then place the specific Create methods below this method or, better, in separate file for each object type. return success; } @@ -70,7 +84,7 @@ protected override bool ICreate(IEnumerable objects, ActionConfig actionCo // Fallback case. If no specific Create is found, here we should handle what happens then. protected bool Create(IBHoMObject obj) { - BH.Engine.Base.Compute.RecordError("No specific Create method found for {obj.GetType().Name}."); + BH.Engine.Base.Compute.RecordError("No specific Create method found for" + obj.GetType().Name); return false; } } diff --git a/RFEM6_Adapter/RFEM6Adapter.cs b/RFEM6_Adapter/RFEM6Adapter.cs index eddd9150..20846f59 100644 --- a/RFEM6_Adapter/RFEM6Adapter.cs +++ b/RFEM6_Adapter/RFEM6Adapter.cs @@ -92,7 +92,7 @@ public RFEM6Adapter(bool active = false) string modelUrl = application.new_model(modelName); // connects to RFEM6/RSTAB9 model - RfemModelClient model = new RfemModelClient(Binding, new EndpointAddress(modelUrl)); + model = new RfemModelClient(Binding, new EndpointAddress(modelUrl)); model.reset(); @@ -113,6 +113,7 @@ public RFEM6Adapter(bool active = false) //RFEM stuff ---------------------------- + RfemModelClient model; public static EndpointAddress Address { get; set; } = new EndpointAddress("http://localhost:8081"); private static BasicHttpBinding Binding diff --git a/RFEM6_Adapter/RFEM6_Adapter.csproj b/RFEM6_Adapter/RFEM6_Adapter.csproj index 594d07a4..938a5e52 100644 --- a/RFEM6_Adapter/RFEM6_Adapter.csproj +++ b/RFEM6_Adapter/RFEM6_Adapter.csproj @@ -48,6 +48,9 @@ ..\..\..\ProgramData\BHoM\Assemblies\Data_oM.dll + + ..\..\..\ProgramData\BHoM\Assemblies\Dimensional_oM.dll + ..\..\..\ProgramData\BHoM\Assemblies\Geometry_Engine.dll From 7c363490eaa8003210ec332c71e68129173637e4 Mon Sep 17 00:00:00 2001 From: "Martin B. Henriksen" Date: Thu, 20 Oct 2022 17:30:38 +0200 Subject: [PATCH 05/15] add system.ServiceModel as a test --- RFEM6_Adapter/RFEM6_Adapter.csproj | 2 ++ RFEM6_Engine/RFEM6_Engine.csproj | 2 ++ RFEM6_oM/RFEM6_oM.csproj | 2 ++ 3 files changed, 6 insertions(+) diff --git a/RFEM6_Adapter/RFEM6_Adapter.csproj b/RFEM6_Adapter/RFEM6_Adapter.csproj index 938a5e52..ca80f489 100644 --- a/RFEM6_Adapter/RFEM6_Adapter.csproj +++ b/RFEM6_Adapter/RFEM6_Adapter.csproj @@ -9,6 +9,8 @@ + + diff --git a/RFEM6_Engine/RFEM6_Engine.csproj b/RFEM6_Engine/RFEM6_Engine.csproj index 9e8e8eb2..1693e54c 100644 --- a/RFEM6_Engine/RFEM6_Engine.csproj +++ b/RFEM6_Engine/RFEM6_Engine.csproj @@ -6,6 +6,8 @@ + + diff --git a/RFEM6_oM/RFEM6_oM.csproj b/RFEM6_oM/RFEM6_oM.csproj index f92468e8..5aa7303e 100644 --- a/RFEM6_oM/RFEM6_oM.csproj +++ b/RFEM6_oM/RFEM6_oM.csproj @@ -6,6 +6,8 @@ + + From eb349ff7bcb505d0d3eb1db8e229c299eba89287 Mon Sep 17 00:00:00 2001 From: "Martin B. Henriksen" Date: Mon, 24 Oct 2022 13:37:40 +0200 Subject: [PATCH 06/15] Update nuget packages and remove test with serviceModel packages --- RFEM6_Adapter/RFEM6_Adapter.csproj | 4 +--- RFEM6_Engine/RFEM6_Engine.csproj | 4 +--- RFEM6_oM/RFEM6_oM.csproj | 4 +--- 3 files changed, 3 insertions(+), 9 deletions(-) diff --git a/RFEM6_Adapter/RFEM6_Adapter.csproj b/RFEM6_Adapter/RFEM6_Adapter.csproj index ca80f489..1c2e7506 100644 --- a/RFEM6_Adapter/RFEM6_Adapter.csproj +++ b/RFEM6_Adapter/RFEM6_Adapter.csproj @@ -7,10 +7,8 @@ - + - - diff --git a/RFEM6_Engine/RFEM6_Engine.csproj b/RFEM6_Engine/RFEM6_Engine.csproj index 1693e54c..5c7931ac 100644 --- a/RFEM6_Engine/RFEM6_Engine.csproj +++ b/RFEM6_Engine/RFEM6_Engine.csproj @@ -5,9 +5,7 @@ - - - + diff --git a/RFEM6_oM/RFEM6_oM.csproj b/RFEM6_oM/RFEM6_oM.csproj index 5aa7303e..5dcf8e2b 100644 --- a/RFEM6_oM/RFEM6_oM.csproj +++ b/RFEM6_oM/RFEM6_oM.csproj @@ -5,9 +5,7 @@ - - - + From 132c935b94624754d348a4013980748746a78667 Mon Sep 17 00:00:00 2001 From: "Martin B. Henriksen" Date: Mon, 24 Oct 2022 13:55:43 +0200 Subject: [PATCH 07/15] change target framework to net6.0 --- RFEM6_Adapter/RFEM6_Adapter.csproj | 2 +- RFEM6_Engine/RFEM6_Engine.csproj | 2 +- RFEM6_oM/RFEM6_oM.csproj | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/RFEM6_Adapter/RFEM6_Adapter.csproj b/RFEM6_Adapter/RFEM6_Adapter.csproj index 1c2e7506..04d93ebe 100644 --- a/RFEM6_Adapter/RFEM6_Adapter.csproj +++ b/RFEM6_Adapter/RFEM6_Adapter.csproj @@ -1,7 +1,7 @@ - netstandard2.0 + net6.0 RFEM6_Adapter BH.Adapter.RFEM6 diff --git a/RFEM6_Engine/RFEM6_Engine.csproj b/RFEM6_Engine/RFEM6_Engine.csproj index 5c7931ac..4d19def7 100644 --- a/RFEM6_Engine/RFEM6_Engine.csproj +++ b/RFEM6_Engine/RFEM6_Engine.csproj @@ -1,7 +1,7 @@ - netstandard2.0 + net6.0 diff --git a/RFEM6_oM/RFEM6_oM.csproj b/RFEM6_oM/RFEM6_oM.csproj index 5dcf8e2b..49a38c4a 100644 --- a/RFEM6_oM/RFEM6_oM.csproj +++ b/RFEM6_oM/RFEM6_oM.csproj @@ -1,7 +1,7 @@ - netstandard2.0 + net6.0 From 319ddb6bfecc18624bf8d110402d0388be5eb4d6 Mon Sep 17 00:00:00 2001 From: "Martin B. Henriksen" Date: Mon, 24 Oct 2022 14:46:53 +0200 Subject: [PATCH 08/15] revert to target framework netstandard2.0 --- RFEM6_Adapter/RFEM6_Adapter.csproj | 2 +- RFEM6_Engine/RFEM6_Engine.csproj | 2 +- RFEM6_oM/RFEM6_oM.csproj | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/RFEM6_Adapter/RFEM6_Adapter.csproj b/RFEM6_Adapter/RFEM6_Adapter.csproj index 04d93ebe..1c2e7506 100644 --- a/RFEM6_Adapter/RFEM6_Adapter.csproj +++ b/RFEM6_Adapter/RFEM6_Adapter.csproj @@ -1,7 +1,7 @@ - net6.0 + netstandard2.0 RFEM6_Adapter BH.Adapter.RFEM6 diff --git a/RFEM6_Engine/RFEM6_Engine.csproj b/RFEM6_Engine/RFEM6_Engine.csproj index 4d19def7..5c7931ac 100644 --- a/RFEM6_Engine/RFEM6_Engine.csproj +++ b/RFEM6_Engine/RFEM6_Engine.csproj @@ -1,7 +1,7 @@ - net6.0 + netstandard2.0 diff --git a/RFEM6_oM/RFEM6_oM.csproj b/RFEM6_oM/RFEM6_oM.csproj index 49a38c4a..5dcf8e2b 100644 --- a/RFEM6_oM/RFEM6_oM.csproj +++ b/RFEM6_oM/RFEM6_oM.csproj @@ -1,7 +1,7 @@ - net6.0 + netstandard2.0 From 029322900704a38484ca5f7c0f7e244a8cf0bbee Mon Sep 17 00:00:00 2001 From: "Martin B. Henriksen" Date: Mon, 24 Oct 2022 15:15:46 +0200 Subject: [PATCH 09/15] replace rfem-nuGet with dll in packages built on netstandard2.0 --- RFEM6_Adapter/RFEM6_Adapter.csproj | 6 +++++- RFEM6_Engine/RFEM6_Engine.csproj | 4 ---- RFEM6_oM/RFEM6_oM.csproj | 4 ---- 3 files changed, 5 insertions(+), 9 deletions(-) diff --git a/RFEM6_Adapter/RFEM6_Adapter.csproj b/RFEM6_Adapter/RFEM6_Adapter.csproj index 1c2e7506..4485539f 100644 --- a/RFEM6_Adapter/RFEM6_Adapter.csproj +++ b/RFEM6_Adapter/RFEM6_Adapter.csproj @@ -7,8 +7,9 @@ - + + @@ -57,6 +58,9 @@ ..\..\..\ProgramData\BHoM\Assemblies\Geometry_oM.dll + + ..\packages\BHoM.Interop.RFEM6\RFEMWebServiceLibrary.dll + ..\..\..\ProgramData\BHoM\Assemblies\Spatial_Engine.dll diff --git a/RFEM6_Engine/RFEM6_Engine.csproj b/RFEM6_Engine/RFEM6_Engine.csproj index 5c7931ac..57987a03 100644 --- a/RFEM6_Engine/RFEM6_Engine.csproj +++ b/RFEM6_Engine/RFEM6_Engine.csproj @@ -4,10 +4,6 @@ netstandard2.0 - - - - diff --git a/RFEM6_oM/RFEM6_oM.csproj b/RFEM6_oM/RFEM6_oM.csproj index 5dcf8e2b..b796ce0a 100644 --- a/RFEM6_oM/RFEM6_oM.csproj +++ b/RFEM6_oM/RFEM6_oM.csproj @@ -4,10 +4,6 @@ netstandard2.0 - - - - C:\ProgramData\BHoM\Assemblies\BHoM.dll From 11eb0c1d5c90cfc239d12a39b9842b6825a65f4e Mon Sep 17 00:00:00 2001 From: "Martin B. Henriksen" Date: Thu, 27 Oct 2022 13:48:21 +0200 Subject: [PATCH 10/15] fix dependency loading --- RFEM6_Adapter/RFEM6Adapter.cs | 8 ++++++-- RFEM6_Adapter/RFEM6_Adapter.csproj | 2 ++ RFEM6_Engine/RFEM6_Engine.csproj | 1 + RFEM6_oM/RFEM6_oM.csproj | 1 + 4 files changed, 10 insertions(+), 2 deletions(-) diff --git a/RFEM6_Adapter/RFEM6Adapter.cs b/RFEM6_Adapter/RFEM6Adapter.cs index 20846f59..9acd2285 100644 --- a/RFEM6_Adapter/RFEM6Adapter.cs +++ b/RFEM6_Adapter/RFEM6Adapter.cs @@ -87,9 +87,13 @@ public RFEM6Adapter(bool active = false) if (active) { + System.Security.Permissions.ReflectionPermission permission = new System.Security.Permissions.ReflectionPermission(System.Security.Permissions.ReflectionPermissionFlag.ReflectionEmit); // creates new model string modelName = "MyTestModel"; - string modelUrl = application.new_model(modelName); + string modelUrl = application.new_model(modelName);//throws error: This operation is not supported on .NET Standard as Reflection.Emit is not available.' + + + //string modelUrl = application.get_active_model(); // connects to RFEM6/RSTAB9 model model = new RfemModelClient(Binding, new EndpointAddress(modelUrl)); @@ -124,7 +128,7 @@ private static BasicHttpBinding Binding return binding; } } - private static RfemApplicationClient application = null; + private static RfemApplicationClient application = new RfemApplicationClient(Binding, Address); /***************************************************/ } diff --git a/RFEM6_Adapter/RFEM6_Adapter.csproj b/RFEM6_Adapter/RFEM6_Adapter.csproj index 4485539f..10379f7e 100644 --- a/RFEM6_Adapter/RFEM6_Adapter.csproj +++ b/RFEM6_Adapter/RFEM6_Adapter.csproj @@ -4,6 +4,8 @@ netstandard2.0 RFEM6_Adapter BH.Adapter.RFEM6 + true + ..\Build\ diff --git a/RFEM6_Engine/RFEM6_Engine.csproj b/RFEM6_Engine/RFEM6_Engine.csproj index 57987a03..c0146526 100644 --- a/RFEM6_Engine/RFEM6_Engine.csproj +++ b/RFEM6_Engine/RFEM6_Engine.csproj @@ -2,6 +2,7 @@ netstandard2.0 + ..\Build diff --git a/RFEM6_oM/RFEM6_oM.csproj b/RFEM6_oM/RFEM6_oM.csproj index b796ce0a..4b0dc134 100644 --- a/RFEM6_oM/RFEM6_oM.csproj +++ b/RFEM6_oM/RFEM6_oM.csproj @@ -2,6 +2,7 @@ netstandard2.0 + ..\Build From 51a428d93fc31f8caa743e6d3edd38c1c7b46a60 Mon Sep 17 00:00:00 2001 From: "Martin B. Henriksen" Date: Thu, 27 Oct 2022 13:59:47 +0200 Subject: [PATCH 11/15] change target framework to net6.0 --- RFEM6_Adapter/RFEM6Adapter.cs | 2 +- RFEM6_Adapter/RFEM6_Adapter.csproj | 2 +- RFEM6_Engine/RFEM6_Engine.csproj | 2 +- RFEM6_oM/RFEM6_oM.csproj | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/RFEM6_Adapter/RFEM6Adapter.cs b/RFEM6_Adapter/RFEM6Adapter.cs index 9acd2285..ec2c5e09 100644 --- a/RFEM6_Adapter/RFEM6Adapter.cs +++ b/RFEM6_Adapter/RFEM6Adapter.cs @@ -87,7 +87,7 @@ public RFEM6Adapter(bool active = false) if (active) { - System.Security.Permissions.ReflectionPermission permission = new System.Security.Permissions.ReflectionPermission(System.Security.Permissions.ReflectionPermissionFlag.ReflectionEmit); + //System.Security.Permissions.ReflectionPermission permission = new System.Security.Permissions.ReflectionPermission(System.Security.Permissions.ReflectionPermissionFlag.ReflectionEmit); // creates new model string modelName = "MyTestModel"; string modelUrl = application.new_model(modelName);//throws error: This operation is not supported on .NET Standard as Reflection.Emit is not available.' diff --git a/RFEM6_Adapter/RFEM6_Adapter.csproj b/RFEM6_Adapter/RFEM6_Adapter.csproj index 10379f7e..594217c3 100644 --- a/RFEM6_Adapter/RFEM6_Adapter.csproj +++ b/RFEM6_Adapter/RFEM6_Adapter.csproj @@ -1,7 +1,7 @@ - netstandard2.0 + net6.0-windows RFEM6_Adapter BH.Adapter.RFEM6 true diff --git a/RFEM6_Engine/RFEM6_Engine.csproj b/RFEM6_Engine/RFEM6_Engine.csproj index c0146526..70cae163 100644 --- a/RFEM6_Engine/RFEM6_Engine.csproj +++ b/RFEM6_Engine/RFEM6_Engine.csproj @@ -1,7 +1,7 @@ - netstandard2.0 + net6.0 ..\Build diff --git a/RFEM6_oM/RFEM6_oM.csproj b/RFEM6_oM/RFEM6_oM.csproj index 4b0dc134..15ff16da 100644 --- a/RFEM6_oM/RFEM6_oM.csproj +++ b/RFEM6_oM/RFEM6_oM.csproj @@ -1,7 +1,7 @@ - netstandard2.0 + net6.0 ..\Build From 04e3abc1b445e38e6a39c264be9f1d13fe45a6fc Mon Sep 17 00:00:00 2001 From: "Martin B. Henriksen" Date: Fri, 28 Oct 2022 10:32:03 +0200 Subject: [PATCH 12/15] move to target framework v4.7.2 --- RFEM6_Adapter/RFEM6_Adapter.csproj | 2 +- RFEM6_Engine/RFEM6_Engine.csproj | 2 +- RFEM6_oM/RFEM6_oM.csproj | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/RFEM6_Adapter/RFEM6_Adapter.csproj b/RFEM6_Adapter/RFEM6_Adapter.csproj index 594217c3..bcd50dc3 100644 --- a/RFEM6_Adapter/RFEM6_Adapter.csproj +++ b/RFEM6_Adapter/RFEM6_Adapter.csproj @@ -1,7 +1,7 @@ - net6.0-windows + v4.7.2 RFEM6_Adapter BH.Adapter.RFEM6 true diff --git a/RFEM6_Engine/RFEM6_Engine.csproj b/RFEM6_Engine/RFEM6_Engine.csproj index 70cae163..19ca2b05 100644 --- a/RFEM6_Engine/RFEM6_Engine.csproj +++ b/RFEM6_Engine/RFEM6_Engine.csproj @@ -1,7 +1,7 @@ - net6.0 + v4.7.2 ..\Build diff --git a/RFEM6_oM/RFEM6_oM.csproj b/RFEM6_oM/RFEM6_oM.csproj index 15ff16da..4823b058 100644 --- a/RFEM6_oM/RFEM6_oM.csproj +++ b/RFEM6_oM/RFEM6_oM.csproj @@ -1,7 +1,7 @@ - net6.0 + v4.7.2 ..\Build From 251e52b9f6793ae3a8fbb6578b93573c80dbcb0d Mon Sep 17 00:00:00 2001 From: "Martin B. Henriksen" Date: Fri, 28 Oct 2022 11:32:36 +0200 Subject: [PATCH 13/15] downgrade rfem API for net472 --- RFEM6_Adapter/RFEM6Adapter.cs | 1 + RFEM6_Adapter/RFEM6_Adapter.csproj | 8 +++++--- RFEM6_Engine/RFEM6_Engine.csproj | 2 +- RFEM6_oM/RFEM6_oM.csproj | 2 +- 4 files changed, 8 insertions(+), 5 deletions(-) diff --git a/RFEM6_Adapter/RFEM6Adapter.cs b/RFEM6_Adapter/RFEM6Adapter.cs index ec2c5e09..dcd4175b 100644 --- a/RFEM6_Adapter/RFEM6Adapter.cs +++ b/RFEM6_Adapter/RFEM6Adapter.cs @@ -41,6 +41,7 @@ using BH.oM.Structure.SurfaceProperties; using BH.oM.Structure.Loads; using System.ServiceModel; +using System.ServiceModel.Primitives; namespace BH.Adapter.RFEM6 { diff --git a/RFEM6_Adapter/RFEM6_Adapter.csproj b/RFEM6_Adapter/RFEM6_Adapter.csproj index bcd50dc3..15695c9e 100644 --- a/RFEM6_Adapter/RFEM6_Adapter.csproj +++ b/RFEM6_Adapter/RFEM6_Adapter.csproj @@ -1,7 +1,7 @@ - + - v4.7.2 + net472 RFEM6_Adapter BH.Adapter.RFEM6 true @@ -9,8 +9,10 @@ + - + + diff --git a/RFEM6_Engine/RFEM6_Engine.csproj b/RFEM6_Engine/RFEM6_Engine.csproj index 19ca2b05..1f4bc516 100644 --- a/RFEM6_Engine/RFEM6_Engine.csproj +++ b/RFEM6_Engine/RFEM6_Engine.csproj @@ -1,7 +1,7 @@ - v4.7.2 + net472 ..\Build diff --git a/RFEM6_oM/RFEM6_oM.csproj b/RFEM6_oM/RFEM6_oM.csproj index 4823b058..18d88cf7 100644 --- a/RFEM6_oM/RFEM6_oM.csproj +++ b/RFEM6_oM/RFEM6_oM.csproj @@ -1,7 +1,7 @@ - v4.7.2 + net472 ..\Build From 2de778d9a813e526c9738ede57aa71132f9feccb Mon Sep 17 00:00:00 2001 From: "Martin B. Henriksen" Date: Fri, 28 Oct 2022 11:52:29 +0200 Subject: [PATCH 14/15] net48 + update all nuget packages to latest + remove bin from project --- RFEM6_Adapter/RFEM6Adapter.cs | 1 - RFEM6_Adapter/RFEM6_Adapter.csproj | 7 +++---- RFEM6_Engine/RFEM6_Engine.csproj | 6 +++++- RFEM6_oM/RFEM6_oM.csproj | 6 +++++- 4 files changed, 13 insertions(+), 7 deletions(-) diff --git a/RFEM6_Adapter/RFEM6Adapter.cs b/RFEM6_Adapter/RFEM6Adapter.cs index dcd4175b..ec2c5e09 100644 --- a/RFEM6_Adapter/RFEM6Adapter.cs +++ b/RFEM6_Adapter/RFEM6Adapter.cs @@ -41,7 +41,6 @@ using BH.oM.Structure.SurfaceProperties; using BH.oM.Structure.Loads; using System.ServiceModel; -using System.ServiceModel.Primitives; namespace BH.Adapter.RFEM6 { diff --git a/RFEM6_Adapter/RFEM6_Adapter.csproj b/RFEM6_Adapter/RFEM6_Adapter.csproj index 15695c9e..c6395633 100644 --- a/RFEM6_Adapter/RFEM6_Adapter.csproj +++ b/RFEM6_Adapter/RFEM6_Adapter.csproj @@ -1,7 +1,7 @@ - + - net472 + net48 RFEM6_Adapter BH.Adapter.RFEM6 true @@ -9,10 +9,9 @@ - + - diff --git a/RFEM6_Engine/RFEM6_Engine.csproj b/RFEM6_Engine/RFEM6_Engine.csproj index 1f4bc516..779baa29 100644 --- a/RFEM6_Engine/RFEM6_Engine.csproj +++ b/RFEM6_Engine/RFEM6_Engine.csproj @@ -1,10 +1,14 @@ - net472 + net48 ..\Build + + + + diff --git a/RFEM6_oM/RFEM6_oM.csproj b/RFEM6_oM/RFEM6_oM.csproj index 18d88cf7..65cbf175 100644 --- a/RFEM6_oM/RFEM6_oM.csproj +++ b/RFEM6_oM/RFEM6_oM.csproj @@ -1,10 +1,14 @@ - net472 + net48 ..\Build + + + + C:\ProgramData\BHoM\Assemblies\BHoM.dll From d5c134679886ebfea5d565b62ffeb796924e7226 Mon Sep 17 00:00:00 2001 From: "Martin B. Henriksen" Date: Fri, 28 Oct 2022 12:47:08 +0200 Subject: [PATCH 15/15] remove packages-folder --- RFEM6_Adapter/RFEM6Adapter.cs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/RFEM6_Adapter/RFEM6Adapter.cs b/RFEM6_Adapter/RFEM6Adapter.cs index ec2c5e09..15877030 100644 --- a/RFEM6_Adapter/RFEM6Adapter.cs +++ b/RFEM6_Adapter/RFEM6Adapter.cs @@ -87,13 +87,12 @@ public RFEM6Adapter(bool active = false) if (active) { - //System.Security.Permissions.ReflectionPermission permission = new System.Security.Permissions.ReflectionPermission(System.Security.Permissions.ReflectionPermissionFlag.ReflectionEmit); // creates new model - string modelName = "MyTestModel"; - string modelUrl = application.new_model(modelName);//throws error: This operation is not supported on .NET Standard as Reflection.Emit is not available.' + //string modelName = "MyTestModel"; + //string modelUrl = application.new_model(modelName); - //string modelUrl = application.get_active_model(); + string modelUrl = application.get_active_model(); // connects to RFEM6/RSTAB9 model model = new RfemModelClient(Binding, new EndpointAddress(modelUrl));