Files
speckle-sharp-connectors/Converters/CSi/Speckle.Converters.CSiShared/ServiceRegistration.cs
T
Björn Steinhagen 0e65b6aa57 feat(etabs): geometric properties through new cDatabaseTable extractor (#584)
* feature: database table extractor

* feature: frame length extraction

* feat: shell area extraction

* feat: frame length extraction

* feat: shell area extraction

* docs: cleaned up object extractors

* refactor: extensible database table extraction

* flexible indexing (can be defined by user, defaults to typical use-case of "UniqueName")
* better variable naming and more descriptive (better than csi's api)
* some fail safes e.g. when forgetting to put indexingColumn in array of columns to fetch

* refactor: using DatabaseTableExtractor for material name lookup

* lookup for material name of a shell can use the database table extractor and simplifies EtabsShellPropertiesExtractor a lot

* fix: openings shouldn't look for material assignments

Frustrating way Etabs handles openings - they shouldn't be a SHELL. Anyways. Rant over

* refactor: database table extractor handles dictionary lookups
2025-02-12 18:43:44 +00:00

42 lines
1.5 KiB
C#

using System.Reflection;
using Microsoft.Extensions.DependencyInjection;
using Speckle.Converters.Common;
using Speckle.Converters.Common.Registration;
using Speckle.Converters.CSiShared.ToSpeckle.Helpers;
using Speckle.Sdk;
namespace Speckle.Converters.CSiShared;
public static class ServiceRegistration
{
public static IServiceCollection AddCsiConverters(this IServiceCollection serviceCollection)
{
var converterAssembly = Assembly.GetExecutingAssembly();
// Register top-level converters
serviceCollection.AddRootCommon<CsiRootToSpeckleConverter>(converterAssembly);
// Register property extractors
serviceCollection.AddScoped<CsiFramePropertiesExtractor>();
serviceCollection.AddScoped<CsiJointPropertiesExtractor>();
serviceCollection.AddScoped<CsiShellPropertiesExtractor>();
serviceCollection.AddScoped<DatabaseTableExtractor>();
serviceCollection.AddScoped<DisplayValueExtractor>();
serviceCollection.AddScoped<SharedPropertiesExtractor>();
// Register connector caches
serviceCollection.AddScoped<CsiToSpeckleCacheSingleton>();
// Settings and unit conversions
serviceCollection.AddApplicationConverters<CsiToSpeckleUnitConverter, eUnits>(converterAssembly);
serviceCollection.AddScoped<
IConverterSettingsStore<CsiConversionSettings>,
ConverterSettingsStore<CsiConversionSettings>
>();
serviceCollection.AddMatchingInterfacesAsTransient(converterAssembly);
return serviceCollection;
}
}