From 0ec1f105f7ad1d2c9c884b1c55de8015fdcd7baa Mon Sep 17 00:00:00 2001 From: Ralph Wessel <150629054+r-wessel@users.noreply.github.com> Date: Fri, 2 Aug 2024 16:10:22 +0100 Subject: [PATCH] Restored helper function for faster library/object creation (#3610) --- .../AddOn/Sources/AddOn/Commands/CreateCommand.cpp | 3 +++ ConnectorArchicad/AddOn/Sources/AddOn/Commands/CreateDoor.cpp | 1 + .../AddOn/Sources/AddOn/Commands/CreateGridElement.cpp | 1 + .../AddOn/Sources/AddOn/Commands/CreateObject.cpp | 3 +++ .../AddOn/Sources/AddOn/Commands/CreateSkylight.cpp | 1 + .../AddOn/Sources/AddOn/Commands/CreateWindow.cpp | 1 + 6 files changed, 10 insertions(+) diff --git a/ConnectorArchicad/AddOn/Sources/AddOn/Commands/CreateCommand.cpp b/ConnectorArchicad/AddOn/Sources/AddOn/Commands/CreateCommand.cpp index 95f74c0232..b159461dd1 100644 --- a/ConnectorArchicad/AddOn/Sources/AddOn/Commands/CreateCommand.cpp +++ b/ConnectorArchicad/AddOn/Sources/AddOn/Commands/CreateCommand.cpp @@ -4,6 +4,7 @@ #include "CreateCommand.hpp" #include "LibpartImportManager.hpp" #include "ClassificationImportManager.hpp" +#include "APIHelper.hpp" #include "FieldNames.hpp" #include "OnExit.hpp" #include "ExchangeManager.hpp" @@ -123,6 +124,8 @@ GS::ObjectState CreateCommand::Execute (const GS::ObjectState& parameters, GS::P parameters.Get (GetFieldName (), objectStates); ACAPI_CallUndoableCommand (GetUndoableCommandName (), [&] () -> GSErrCode { + LibraryHelper helper (false); + GS::Array applicationObjects; AttributeManager* attributeManager = AttributeManager::GetInstance (); diff --git a/ConnectorArchicad/AddOn/Sources/AddOn/Commands/CreateDoor.cpp b/ConnectorArchicad/AddOn/Sources/AddOn/Commands/CreateDoor.cpp index baa597270d..381589b14a 100644 --- a/ConnectorArchicad/AddOn/Sources/AddOn/Commands/CreateDoor.cpp +++ b/ConnectorArchicad/AddOn/Sources/AddOn/Commands/CreateDoor.cpp @@ -6,6 +6,7 @@ #include "RealNumber.h" #include "DGModule.hpp" #include "LibpartImportManager.hpp" +#include "APIHelper.hpp" #include "FieldNames.hpp" #include "OnExit.hpp" #include "ExchangeManager.hpp" diff --git a/ConnectorArchicad/AddOn/Sources/AddOn/Commands/CreateGridElement.cpp b/ConnectorArchicad/AddOn/Sources/AddOn/Commands/CreateGridElement.cpp index d18939ce1c..2b17b910a8 100644 --- a/ConnectorArchicad/AddOn/Sources/AddOn/Commands/CreateGridElement.cpp +++ b/ConnectorArchicad/AddOn/Sources/AddOn/Commands/CreateGridElement.cpp @@ -1,6 +1,7 @@ #include "CreateGridElement.hpp" #include "ResourceIds.hpp" #include "ObjectState.hpp" +#include "APIHelper.hpp" #include "Utility.hpp" #include "Objects/Level.hpp" #include "Objects/Point.hpp" diff --git a/ConnectorArchicad/AddOn/Sources/AddOn/Commands/CreateObject.cpp b/ConnectorArchicad/AddOn/Sources/AddOn/Commands/CreateObject.cpp index d94909765d..7381415197 100644 --- a/ConnectorArchicad/AddOn/Sources/AddOn/Commands/CreateObject.cpp +++ b/ConnectorArchicad/AddOn/Sources/AddOn/Commands/CreateObject.cpp @@ -1,6 +1,7 @@ #include "CreateObject.hpp" #include "APIMigrationHelper.hpp" +#include "APIHelper.hpp" #include "LibpartImportManager.hpp" #include "ResourceIds.hpp" #include "Utility.hpp" @@ -130,6 +131,8 @@ GS::ObjectState CreateObject::Execute (const GS::ObjectState& parameters, GS::Pr parameters.Get (FieldNames::MeshModels, meshModels); ACAPI_CallUndoableCommand (GetUndoableCommandName (), [&] () -> GSErrCode { + LibraryHelper helper (false); + AttributeManager* attributeManager = AttributeManager::GetInstance (); LibpartImportManager* libpartImportManager = LibpartImportManager::GetInstance (); for (ModelInfo meshModel : meshModels) { diff --git a/ConnectorArchicad/AddOn/Sources/AddOn/Commands/CreateSkylight.cpp b/ConnectorArchicad/AddOn/Sources/AddOn/Commands/CreateSkylight.cpp index fd56fb1efb..dab3d245cb 100644 --- a/ConnectorArchicad/AddOn/Sources/AddOn/Commands/CreateSkylight.cpp +++ b/ConnectorArchicad/AddOn/Sources/AddOn/Commands/CreateSkylight.cpp @@ -7,6 +7,7 @@ #include "RealNumber.h" #include "DGModule.hpp" #include "LibpartImportManager.hpp" +#include "APIHelper.hpp" #include "FieldNames.hpp" #include "OnExit.hpp" #include "ExchangeManager.hpp" diff --git a/ConnectorArchicad/AddOn/Sources/AddOn/Commands/CreateWindow.cpp b/ConnectorArchicad/AddOn/Sources/AddOn/Commands/CreateWindow.cpp index 1cf6a03e98..aac1284db6 100644 --- a/ConnectorArchicad/AddOn/Sources/AddOn/Commands/CreateWindow.cpp +++ b/ConnectorArchicad/AddOn/Sources/AddOn/Commands/CreateWindow.cpp @@ -7,6 +7,7 @@ #include "RealNumber.h" #include "DGModule.hpp" #include "LibpartImportManager.hpp" +#include "APIHelper.hpp" #include "FieldNames.hpp" #include "OnExit.hpp" #include "ExchangeManager.hpp"