From 54e9297ca020b9cb5412f7d1d99e9cca1ecd4a2f Mon Sep 17 00:00:00 2001 From: Dogukan Karatas Date: Tue, 22 Oct 2024 15:52:03 +0200 Subject: [PATCH 01/29] creates tekla converter --- .../Speckle.Connector.Tekla2024.csproj | 1 + .../packages.lock.json | 15 + .../ServiceRegistration.cs | 20 + .../Speckle.Converter.Tekla2024.csproj | 17 + .../TeklaConversionSettings.cs | 5 + .../TeklaConversionSettingsFactory.cs | 19 + .../TeklaRootToSpeckleConverter.cs | 48 +++ .../TeklaToSpeckleUnitConverter.cs | 36 ++ .../packages.lock.json | 380 ++++++++++++++++++ Directory.Packages.props | 1 + Speckle.Connectors.sln | 9 + 11 files changed, 551 insertions(+) create mode 100644 Converters/Tekla/Speckle.Converter.Tekla2024/ServiceRegistration.cs create mode 100644 Converters/Tekla/Speckle.Converter.Tekla2024/Speckle.Converter.Tekla2024.csproj create mode 100644 Converters/Tekla/Speckle.Converter.Tekla2024/TeklaConversionSettings.cs create mode 100644 Converters/Tekla/Speckle.Converter.Tekla2024/TeklaConversionSettingsFactory.cs create mode 100644 Converters/Tekla/Speckle.Converter.Tekla2024/TeklaRootToSpeckleConverter.cs create mode 100644 Converters/Tekla/Speckle.Converter.Tekla2024/TeklaToSpeckleUnitConverter.cs create mode 100644 Converters/Tekla/Speckle.Converter.Tekla2024/packages.lock.json diff --git a/Connectors/Tekla/Speckle.Connector.Tekla2024/Speckle.Connector.Tekla2024.csproj b/Connectors/Tekla/Speckle.Connector.Tekla2024/Speckle.Connector.Tekla2024.csproj index 4dde51c8..5e11e7dc 100644 --- a/Connectors/Tekla/Speckle.Connector.Tekla2024/Speckle.Connector.Tekla2024.csproj +++ b/Connectors/Tekla/Speckle.Connector.Tekla2024/Speckle.Connector.Tekla2024.csproj @@ -16,6 +16,7 @@ + diff --git a/Connectors/Tekla/Speckle.Connector.Tekla2024/packages.lock.json b/Connectors/Tekla/Speckle.Connector.Tekla2024/packages.lock.json index 18e93fa1..1b40d118 100644 --- a/Connectors/Tekla/Speckle.Connector.Tekla2024/packages.lock.json +++ b/Connectors/Tekla/Speckle.Connector.Tekla2024/packages.lock.json @@ -52,6 +52,21 @@ "Trimble.Technology.MsgLib": "2.2.22326" } }, + "Tekla.Structures.Drawing": { + "type": "Direct", + "requested": "[2024.0.2, )", + "resolved": "2024.0.2", + "contentHash": "1/rlqkt/Wy9sdMvGXm8GH6fUm9fEASnRPCftvAn0nrtV5qinKbbwEpcxfWrlDneoSVAZY8qL/V8UsXztqO2YRQ==", + "dependencies": { + "Tekla.Common.Geometry": "4.6.2", + "Tekla.Structures": "2024.0.2", + "Tekla.Structures.Datatype": "2024.0.2", + "Tekla.Structures.Model": "2024.0.2", + "Tekla.Structures.Plugins": "2024.0.2", + "Tekla.Technology.Serialization": "4.1.1", + "Trimble.Remoting": "1.0.2" + } + }, "Tekla.Structures.Model": { "type": "Direct", "requested": "[2024.0.2, )", diff --git a/Converters/Tekla/Speckle.Converter.Tekla2024/ServiceRegistration.cs b/Converters/Tekla/Speckle.Converter.Tekla2024/ServiceRegistration.cs new file mode 100644 index 00000000..c9b3f87d --- /dev/null +++ b/Converters/Tekla/Speckle.Converter.Tekla2024/ServiceRegistration.cs @@ -0,0 +1,20 @@ +using System.Reflection; +using Microsoft.Extensions.DependencyInjection; +using Speckle.Converters.Common.Registration; +using Speckle.Sdk; +using Tekla.Structures.Drawing; + +namespace Speckle.Converter.Tekla2024; + +public static class ServiceRegistration +{ + public static IServiceCollection AddTeklaConverters(this IServiceCollection serviceCollection) + { + var converterAssembly = Assembly.GetExecutingAssembly(); + serviceCollection.AddMatchingInterfacesAsTransient(converterAssembly); + + serviceCollection.AddApplicationConverters(converterAssembly); + + return serviceCollection; + } +} diff --git a/Converters/Tekla/Speckle.Converter.Tekla2024/Speckle.Converter.Tekla2024.csproj b/Converters/Tekla/Speckle.Converter.Tekla2024/Speckle.Converter.Tekla2024.csproj new file mode 100644 index 00000000..9b3b1569 --- /dev/null +++ b/Converters/Tekla/Speckle.Converter.Tekla2024/Speckle.Converter.Tekla2024.csproj @@ -0,0 +1,17 @@ + + + + net8.0 + enable + enable + + + + + + + + + + + diff --git a/Converters/Tekla/Speckle.Converter.Tekla2024/TeklaConversionSettings.cs b/Converters/Tekla/Speckle.Converter.Tekla2024/TeklaConversionSettings.cs new file mode 100644 index 00000000..c2e45b95 --- /dev/null +++ b/Converters/Tekla/Speckle.Converter.Tekla2024/TeklaConversionSettings.cs @@ -0,0 +1,5 @@ +using Tekla.Structures.Model; + +namespace Speckle.Converter.Tekla2024; + +public record TeklaConversionSettings(Model Document, string SpeckleUnits); diff --git a/Converters/Tekla/Speckle.Converter.Tekla2024/TeklaConversionSettingsFactory.cs b/Converters/Tekla/Speckle.Converter.Tekla2024/TeklaConversionSettingsFactory.cs new file mode 100644 index 00000000..fcf07162 --- /dev/null +++ b/Converters/Tekla/Speckle.Converter.Tekla2024/TeklaConversionSettingsFactory.cs @@ -0,0 +1,19 @@ +using Speckle.Converters.Common; +using Speckle.InterfaceGenerator; +using Tekla.Structures.Model; +using TSD = Tekla.Structures.Drawing; + +namespace Speckle.Converter.Tekla2024; + +[GenerateAutoInterface] +public class TeklaConversionSettingsFactory( + IHostToSpeckleUnitConverter unitsConverter, + IConverterSettingsStore settingsStore +) : ITeklaConversionSettingsFactory +{ + public TeklaConversionSettings Current => settingsStore.Current; + + // only handles automatic rn + public TeklaConversionSettings Create(Model document) => + new(document, unitsConverter.ConvertOrThrow(TSD.Units.Automatic)); +} diff --git a/Converters/Tekla/Speckle.Converter.Tekla2024/TeklaRootToSpeckleConverter.cs b/Converters/Tekla/Speckle.Converter.Tekla2024/TeklaRootToSpeckleConverter.cs new file mode 100644 index 00000000..51a5f10a --- /dev/null +++ b/Converters/Tekla/Speckle.Converter.Tekla2024/TeklaRootToSpeckleConverter.cs @@ -0,0 +1,48 @@ +using Microsoft.Extensions.Logging; +using Speckle.Converters.Common; +using Speckle.Converters.Common.Objects; +using Speckle.Converters.Common.Registration; +using Speckle.Sdk.Common.Exceptions; +using Speckle.Sdk.Models; +using Tekla.Structures.Model; + +namespace Speckle.Converter.Tekla2024; + +public class TeklaRootToSpeckleConverter : IRootToSpeckleConverter +{ + private readonly IConverterManager _toSpeckle; + private readonly IConverterSettingsStore _settingsStore; + private readonly ILogger _logger; + + public TeklaRootToSpeckleConverter( + IConverterManager toSpeckle, + IConverterSettingsStore settingsStore, + ILogger logger + ) + { + _toSpeckle = toSpeckle; + _settingsStore = settingsStore; + _logger = logger; + } + + public Base Convert(object target) + { + if (target is not ModelObject modelObject) + { + throw new ValidationException($"Target object is not a ModelObject. It's a ${target.GetType()}"); + } + + Type type = target.GetType(); + var objectConverter = _toSpeckle.ResolveConverter(type, true); + + Base result = objectConverter.Convert(target); + + // add tekla specific identifiers + result.applicationId = modelObject.Identifier.GUID.ToString(); + result["modelObjectID"] = modelObject.Identifier.ID.ToString(); + + //TODO: attach properties + + return result; + } +} diff --git a/Converters/Tekla/Speckle.Converter.Tekla2024/TeklaToSpeckleUnitConverter.cs b/Converters/Tekla/Speckle.Converter.Tekla2024/TeklaToSpeckleUnitConverter.cs new file mode 100644 index 00000000..91187fa2 --- /dev/null +++ b/Converters/Tekla/Speckle.Converter.Tekla2024/TeklaToSpeckleUnitConverter.cs @@ -0,0 +1,36 @@ +using Speckle.Converters.Common; +using Speckle.Sdk.Common.Exceptions; +using SSC = Speckle.Sdk.Common; +using TSD = Tekla.Structures.Drawing; + +namespace Speckle.Converter.Tekla2024; + +public class TeklaToSpeckleUnitConverter : IHostToSpeckleUnitConverter +{ + private readonly Dictionary _unitMapping = new(); + + public TeklaToSpeckleUnitConverter() + { + _unitMapping[TSD.Units.Automatic] = SSC.Units.Millimeters; + _unitMapping[TSD.Units.Millimeters] = SSC.Units.Millimeters; + _unitMapping[TSD.Units.Centimeters] = SSC.Units.Centimeters; + _unitMapping[TSD.Units.Meters] = SSC.Units.Meters; + _unitMapping[TSD.Units.Inches] = SSC.Units.Inches; + _unitMapping[TSD.Units.Feet] = SSC.Units.Feet; + + // there are also other units in tekla, not sure how to handle them in speckle + // auto unit option in tekla is based on the selected environment + //_unitMapping[TSD.Units.FeetAndInches] + //_unitMapping[TSD.Units.CentimetersOrMeters] + } + + public string ConvertOrThrow(TSD.Units hostUnit) + { + if (_unitMapping.TryGetValue(hostUnit, out string? value)) + { + return value; + } + + throw new UnitNotSupportedException($"The Unit System \"{hostUnit}\" is unsupported."); + } +} diff --git a/Converters/Tekla/Speckle.Converter.Tekla2024/packages.lock.json b/Converters/Tekla/Speckle.Converter.Tekla2024/packages.lock.json new file mode 100644 index 00000000..1b783ff5 --- /dev/null +++ b/Converters/Tekla/Speckle.Converter.Tekla2024/packages.lock.json @@ -0,0 +1,380 @@ +{ + "version": 2, + "dependencies": { + "net8.0": { + "Microsoft.NETFramework.ReferenceAssemblies": { + "type": "Direct", + "requested": "[1.0.3, )", + "resolved": "1.0.3", + "contentHash": "vUc9Npcs14QsyOD01tnv/m8sQUnGTGOw1BCmKcv77LBJY7OxhJ+zJF7UD/sCL3lYNFuqmQEVlkfS4Quif6FyYg==", + "dependencies": { + "Microsoft.NETFramework.ReferenceAssemblies.net461": "1.0.3" + } + }, + "Microsoft.SourceLink.GitHub": { + "type": "Direct", + "requested": "[8.0.0, )", + "resolved": "8.0.0", + "contentHash": "G5q7OqtwIyGTkeIOAc3u2ZuV/kicQaec5EaRnc0pIeSnh9LUjj+PYQrJYBURvDt7twGl2PKA7nSN0kz1Zw5bnQ==", + "dependencies": { + "Microsoft.Build.Tasks.Git": "8.0.0", + "Microsoft.SourceLink.Common": "8.0.0" + } + }, + "PolySharp": { + "type": "Direct", + "requested": "[1.14.1, )", + "resolved": "1.14.1", + "contentHash": "mOOmFYwad3MIOL14VCjj02LljyF1GNw1wP0YVlxtcPvqdxjGGMNdNJJxHptlry3MOd8b40Flm8RPOM8JOlN2sQ==" + }, + "Speckle.InterfaceGenerator": { + "type": "Direct", + "requested": "[0.9.6, )", + "resolved": "0.9.6", + "contentHash": "HKH7tYrYYlCK1ct483hgxERAdVdMtl7gUKW9ijWXxA1UsYR4Z+TrRHYmzZ9qmpu1NnTycSrp005NYM78GDKV1w==" + }, + "Tekla.Structures.Drawing": { + "type": "Direct", + "requested": "[2024.0.2, )", + "resolved": "2024.0.2", + "contentHash": "1/rlqkt/Wy9sdMvGXm8GH6fUm9fEASnRPCftvAn0nrtV5qinKbbwEpcxfWrlDneoSVAZY8qL/V8UsXztqO2YRQ==", + "dependencies": { + "Tekla.Common.Geometry": "4.6.2", + "Tekla.Structures": "2024.0.2", + "Tekla.Structures.Datatype": "2024.0.2", + "Tekla.Structures.Model": "2024.0.2", + "Tekla.Structures.Plugins": "2024.0.2", + "Tekla.Technology.Serialization": "4.1.1", + "Trimble.Remoting": "1.0.2" + } + }, + "GraphQL.Client": { + "type": "Transitive", + "resolved": "6.0.0", + "contentHash": "8yPNBbuVBpTptivyAlak4GZvbwbUcjeQTL4vN1HKHRuOykZ4r7l5fcLS6vpyPyLn0x8FsL31xbOIKyxbmR9rbA==", + "dependencies": { + "GraphQL.Client.Abstractions": "6.0.0", + "GraphQL.Client.Abstractions.Websocket": "6.0.0", + "System.Reactive": "5.0.0" + } + }, + "GraphQL.Client.Abstractions": { + "type": "Transitive", + "resolved": "6.0.0", + "contentHash": "h7uzWFORHZ+CCjwr/ThAyXMr0DPpzEANDa4Uo54wqCQ+j7qUKwqYTgOrb1W40sqbvNaZm9v/X7It31SUw0maHA==", + "dependencies": { + "GraphQL.Primitives": "6.0.0" + } + }, + "GraphQL.Client.Abstractions.Websocket": { + "type": "Transitive", + "resolved": "6.0.0", + "contentHash": "Nr9bPf8gIOvLuXpqEpqr9z9jslYFJOvd0feHth3/kPqeR3uMbjF5pjiwh4jxyMcxHdr8Pb6QiXkV3hsSyt0v7A==", + "dependencies": { + "GraphQL.Client.Abstractions": "6.0.0" + } + }, + "GraphQL.Primitives": { + "type": "Transitive", + "resolved": "6.0.0", + "contentHash": "yg72rrYDapfsIUrul7aF6wwNnTJBOFvuA9VdDTQpPa8AlAriHbufeXYLBcodKjfUdkCnaiggX1U/nEP08Zb5GA==" + }, + "Microsoft.Build.Tasks.Git": { + "type": "Transitive", + "resolved": "8.0.0", + "contentHash": "bZKfSIKJRXLTuSzLudMFte/8CempWjVamNUR5eHJizsy+iuOuO/k2gnh7W0dHJmYY0tBf+gUErfluCv5mySAOQ==" + }, + "Microsoft.CSharp": { + "type": "Transitive", + "resolved": "4.7.0", + "contentHash": "pTj+D3uJWyN3My70i2Hqo+OXixq3Os2D1nJ2x92FFo6sk8fYS1m1WLNTs0Dc1uPaViH0YvEEwvzddQ7y4rhXmA==" + }, + "Microsoft.Data.Sqlite": { + "type": "Transitive", + "resolved": "7.0.7", + "contentHash": "tiNmV1oPy+Z2R7Wd0bPB/FxCr8B+/5q11OpDMG751GA/YuOL7MZrBFfzv5oFRlFe08K6sjrnbrauzzGIeNrzLQ==", + "dependencies": { + "Microsoft.Data.Sqlite.Core": "7.0.7", + "SQLitePCLRaw.bundle_e_sqlite3": "2.1.4" + } + }, + "Microsoft.Data.Sqlite.Core": { + "type": "Transitive", + "resolved": "7.0.7", + "contentHash": "21FRzcJhaTrlv7kTrqr/ltFcSQM2TyuTTPhUcjO8H73od7Bb3QraNW90c7lUucNI/245XPkKZG4fp7/7OsKCSg==", + "dependencies": { + "SQLitePCLRaw.core": "2.1.4" + } + }, + "Microsoft.Extensions.Configuration": { + "type": "Transitive", + "resolved": "2.2.0", + "contentHash": "nOP8R1mVb/6mZtm2qgAJXn/LFm/2kMjHDAg/QJLFG6CuWYJtaD3p1BwQhufBVvRzL9ceJ/xF0SQ0qsI2GkDQAA==", + "dependencies": { + "Microsoft.Extensions.Configuration.Abstractions": "2.2.0" + } + }, + "Microsoft.Extensions.Configuration.Abstractions": { + "type": "Transitive", + "resolved": "2.2.0", + "contentHash": "65MrmXCziWaQFrI0UHkQbesrX5wTwf9XPjY5yFm/VkgJKFJ5gqvXRoXjIZcf2wLi5ZlwGz/oMYfyURVCWbM5iw==", + "dependencies": { + "Microsoft.Extensions.Primitives": "2.2.0" + } + }, + "Microsoft.Extensions.Configuration.Binder": { + "type": "Transitive", + "resolved": "2.2.0", + "contentHash": "vJ9xvOZCnUAIHcGC3SU35r3HKmHTVIeHzo6u/qzlHAqD8m6xv92MLin4oJntTvkpKxVX3vI1GFFkIQtU3AdlsQ==", + "dependencies": { + "Microsoft.Extensions.Configuration": "2.2.0" + } + }, + "Microsoft.Extensions.DependencyInjection.Abstractions": { + "type": "Transitive", + "resolved": "2.2.0", + "contentHash": "f9hstgjVmr6rmrfGSpfsVOl2irKAgr1QjrSi3FgnS7kulxband50f2brRLwySAQTADPZeTdow0mpSMcoAdadCw==" + }, + "Microsoft.Extensions.Options": { + "type": "Transitive", + "resolved": "2.2.0", + "contentHash": "UpZLNLBpIZ0GTebShui7xXYh6DmBHjWM8NxGxZbdQh/bPZ5e6YswqI+bru6BnEL5eWiOdodsXtEz3FROcgi/qg==", + "dependencies": { + "Microsoft.Extensions.DependencyInjection.Abstractions": "2.2.0", + "Microsoft.Extensions.Primitives": "2.2.0", + "System.ComponentModel.Annotations": "4.5.0" + } + }, + "Microsoft.Extensions.Primitives": { + "type": "Transitive", + "resolved": "2.2.0", + "contentHash": "azyQtqbm4fSaDzZHD/J+V6oWMFaf2tWP4WEGIYePLCMw3+b2RQdj9ybgbQyjCshcitQKQ4lEDOZjmSlTTrHxUg==", + "dependencies": { + "System.Memory": "4.5.1", + "System.Runtime.CompilerServices.Unsafe": "4.5.1" + } + }, + "Microsoft.NETFramework.ReferenceAssemblies.net461": { + "type": "Transitive", + "resolved": "1.0.3", + "contentHash": "AmOJZwCqnOCNp6PPcf9joyogScWLtwy0M1WkqfEQ0M9nYwyDD7EX9ZjscKS5iYnyvteX7kzSKFCKt9I9dXA6mA==" + }, + "Microsoft.SourceLink.Common": { + "type": "Transitive", + "resolved": "8.0.0", + "contentHash": "dk9JPxTCIevS75HyEQ0E4OVAFhB2N+V9ShCXf8Q6FkUQZDkgLI12y679Nym1YqsiSysuQskT7Z+6nUf3yab6Vw==" + }, + "Mono.Cecil": { + "type": "Transitive", + "resolved": "0.11.4", + "contentHash": "IC1h5g0NeJGHIUgzM1P82ld57knhP0IcQfrYITDPXlNpMYGUrsG5TxuaWTjaeqDNQMBDNZkB8L0rBnwsY6JHuQ==" + }, + "Polly": { + "type": "Transitive", + "resolved": "7.2.3", + "contentHash": "DeCY0OFbNdNxsjntr1gTXHJ5pKUwYzp04Er2LLeN3g6pWhffsGuKVfMBLe1lw7x76HrPkLxKEFxBlpRxS2nDEQ==" + }, + "Polly.Contrib.WaitAndRetry": { + "type": "Transitive", + "resolved": "1.1.1", + "contentHash": "1MUQLiSo4KDkQe6nzQRhIU05lm9jlexX5BVsbuw0SL82ynZ+GzAHQxJVDPVBboxV37Po3SG077aX8DuSy8TkaA==" + }, + "Polly.Extensions.Http": { + "type": "Transitive", + "resolved": "3.0.0", + "contentHash": "drrG+hB3pYFY7w1c3BD+lSGYvH2oIclH8GRSehgfyP5kjnFnHKQuuBhuHLv+PWyFuaTDyk/vfRpnxOzd11+J8g==", + "dependencies": { + "Polly": "7.1.0" + } + }, + "Speckle.DoubleNumerics": { + "type": "Transitive", + "resolved": "4.0.1", + "contentHash": "MzEQ1Im0zTja+tEsdRIk/WlPiKqb22NmTOJcR1ZKm/mz46pezyyID3/wRz6vJUELMpSLnG7LhsxBL+nxbr7V0w==" + }, + "Speckle.Newtonsoft.Json": { + "type": "Transitive", + "resolved": "13.0.2", + "contentHash": "g1BejUZwax5PRfL6xHgLEK23sqHWOgOj9hE7RvfRRlN00AGt8GnPYt8HedSK7UB3HiRW8zCA9Pn0iiYxCK24BA==" + }, + "SQLitePCLRaw.bundle_e_sqlite3": { + "type": "Transitive", + "resolved": "2.1.4", + "contentHash": "EWI1olKDjFEBMJu0+3wuxwziIAdWDVMYLhuZ3Qs84rrz+DHwD00RzWPZCa+bLnHCf3oJwuFZIRsHT5p236QXww==", + "dependencies": { + "SQLitePCLRaw.lib.e_sqlite3": "2.1.4", + "SQLitePCLRaw.provider.e_sqlite3": "2.1.4" + } + }, + "SQLitePCLRaw.core": { + "type": "Transitive", + "resolved": "2.1.4", + "contentHash": "inBjvSHo9UDKneGNzfUfDjK08JzlcIhn1+SP5Y3m6cgXpCxXKCJDy6Mka7LpgSV+UZmKSnC8rTwB0SQ0xKu5pA==", + "dependencies": { + "System.Memory": "4.5.3" + } + }, + "SQLitePCLRaw.lib.e_sqlite3": { + "type": "Transitive", + "resolved": "2.1.4", + "contentHash": "2C9Q9eX7CPLveJA0rIhf9RXAvu+7nWZu1A2MdG6SD/NOu26TakGgL1nsbc0JAspGijFOo3HoN79xrx8a368fBg==" + }, + "SQLitePCLRaw.provider.e_sqlite3": { + "type": "Transitive", + "resolved": "2.1.4", + "contentHash": "CSlb5dUp1FMIkez9Iv5EXzpeq7rHryVNqwJMWnpq87j9zWZexaEMdisDktMsnnrzKM6ahNrsTkjqNodTBPBxtQ==", + "dependencies": { + "SQLitePCLRaw.core": "2.1.4" + } + }, + "System.ComponentModel.Annotations": { + "type": "Transitive", + "resolved": "4.5.0", + "contentHash": "UxYQ3FGUOtzJ7LfSdnYSFd7+oEv6M8NgUatatIN2HxNtDdlcvFAf+VIq4Of9cDMJEJC0aSRv/x898RYhB4Yppg==" + }, + "System.Memory": { + "type": "Transitive", + "resolved": "4.5.5", + "contentHash": "XIWiDvKPXaTveaB7HVganDlOCRoj03l+jrwNvcge/t8vhGYKvqV+dMv6G4SAX2NoNmN0wZfVPTAlFwZcZvVOUw==" + }, + "System.Reactive": { + "type": "Transitive", + "resolved": "5.0.0", + "contentHash": "erBZjkQHWL9jpasCE/0qKAryzVBJFxGHVBAvgRN1bzM0q2s1S4oYREEEL0Vb+1kA/6BKb5FjUZMp5VXmy+gzkQ==" + }, + "System.Reflection.Emit.Lightweight": { + "type": "Transitive", + "resolved": "4.7.0", + "contentHash": "a4OLB4IITxAXJeV74MDx49Oq2+PsF6Sml54XAFv+2RyWwtDBcabzoxiiJRhdhx+gaohLh4hEGCLQyBozXoQPqA==" + }, + "System.Runtime.CompilerServices.Unsafe": { + "type": "Transitive", + "resolved": "6.0.0", + "contentHash": "/iUeP3tq1S0XdNNoMz5C9twLSrM/TH+qElHkXWaPvuNOt+99G75NrV0OS2EqHx5wMN7popYjpc8oTjC1y16DLg==" + }, + "Tekla.Common.Geometry": { + "type": "Transitive", + "resolved": "4.6.2", + "contentHash": "5+jJDmzC363ys51JbrQap0LdtflTpSJVpW9oUQbtlem+SBcwrFQkA16xg3ddKv6tQ0iMXwPe7DP0PbV+Qj9GMw==" + }, + "Tekla.Structures": { + "type": "Transitive", + "resolved": "2024.0.2", + "contentHash": "m7URRYK7sEzumr/+TJRNd4q2nutF9qMUbIIPmbr36cbaKiBGW0xxAgveTL8+7kkDqodhAGyUTVai5gOtvYi2SQ==", + "dependencies": { + "Tekla.Common.Geometry": "4.6.2", + "Tekla.Technology.Serialization": "4.1.1", + "Trimble.Remoting": "1.0.2" + } + }, + "Tekla.Structures.Datatype": { + "type": "Transitive", + "resolved": "2024.0.2", + "contentHash": "LtLUtkYuni+R1F0UAPXWmgjAPBZORabG+/2YVOhJBj6+0x6Fg0PxgDtABNMNniN7A7BFXaYQRI/fuP35VL8BFQ==" + }, + "Tekla.Technology.Scripting.Plugins": { + "type": "Transitive", + "resolved": "5.5.0", + "contentHash": "tuPQlV/hJHHRrY6LH0FMxVtmjs6TUw0u4WaXbd4GVbj9YAyJyiZCA2Q1YeOmy6rs2IoCyGivURaZsSkdg/5JPA==", + "dependencies": { + "Mono.Cecil": "0.11.4" + } + }, + "Tekla.Technology.Serialization": { + "type": "Transitive", + "resolved": "4.1.1", + "contentHash": "C++1hdVfSmoB+0M5cFvXxmLzVl3azi0CiI3owLZt4vHWI+EgYWEGMAlCk6ED4zfhR2FzT9VLu4RCFDHvopTERw==", + "dependencies": { + "System.Reflection.Emit.Lightweight": "4.7.0" + } + }, + "Trimble.Remoting": { + "type": "Transitive", + "resolved": "1.0.2", + "contentHash": "vwaLu07qxgUaSt5FRaR0xrH+6OuVTibfrOYoCVta/NmdA2XZlAqAF8/pIkBITRTqpY8Z8uBhV+mYfVfr+oevcg==", + "dependencies": { + "System.Memory": "4.5.5", + "System.Runtime.CompilerServices.Unsafe": "6.0.0", + "Tekla.Technology.Serialization": "4.1.1" + } + }, + "speckle.converters.common": { + "type": "Project", + "dependencies": { + "Microsoft.Extensions.Logging.Abstractions": "[2.2.0, )", + "Speckle.Objects": "[3.1.0-dev.164, )" + } + }, + "Microsoft.Extensions.Logging": { + "type": "CentralTransitive", + "requested": "[2.2.0, )", + "resolved": "2.2.0", + "contentHash": "Nxqhadc9FCmFHzU+fz3oc8sFlE6IadViYg8dfUdGzJZ2JUxnCsRghBhhOWdM4B2zSZqEc+0BjliBh/oNdRZuig==", + "dependencies": { + "Microsoft.Extensions.Configuration.Binder": "2.2.0", + "Microsoft.Extensions.DependencyInjection.Abstractions": "2.2.0", + "Microsoft.Extensions.Logging.Abstractions": "2.2.0", + "Microsoft.Extensions.Options": "2.2.0" + } + }, + "Microsoft.Extensions.Logging.Abstractions": { + "type": "CentralTransitive", + "requested": "[2.2.0, )", + "resolved": "2.2.0", + "contentHash": "B2WqEox8o+4KUOpL7rZPyh6qYjik8tHi2tN8Z9jZkHzED8ElYgZa/h6K+xliB435SqUcWT290Fr2aa8BtZjn8A==" + }, + "Speckle.Objects": { + "type": "CentralTransitive", + "requested": "[3.1.0-dev.164, )", + "resolved": "3.1.0-dev.164", + "contentHash": "bvQ7xwOWFm9fYdWr111Q/PKgHaMEfV08uE0erQyZuLYCJ9sFJKRcbQlaf4d6VRzl/fVJm8ypqIdtXgQtsiMSlQ==", + "dependencies": { + "Speckle.Sdk": "3.1.0-dev.164" + } + }, + "Speckle.Sdk": { + "type": "CentralTransitive", + "requested": "[3.1.0-dev.164, )", + "resolved": "3.1.0-dev.164", + "contentHash": "b88QWWSPYs3h9H2Af78TrKclyjYd7OxmKwx4p2C7IgFzaDW51dSd9o0pEB7H3Ao4ydCoOW9Xey8v1lhfckl09w==", + "dependencies": { + "GraphQL.Client": "6.0.0", + "Microsoft.CSharp": "4.7.0", + "Microsoft.Data.Sqlite": "7.0.7", + "Microsoft.Extensions.DependencyInjection.Abstractions": "2.2.0", + "Microsoft.Extensions.Logging": "2.2.0", + "Polly": "7.2.3", + "Polly.Contrib.WaitAndRetry": "1.1.1", + "Polly.Extensions.Http": "3.0.0", + "Speckle.DoubleNumerics": "4.0.1", + "Speckle.Newtonsoft.Json": "13.0.2" + } + }, + "Tekla.Structures.Model": { + "type": "CentralTransitive", + "requested": "[2024.0.2, )", + "resolved": "2024.0.2", + "contentHash": "GV7mqc3TX7h3QeCLmjCI8GlnbhAMYOvLMEED1TY+hpdeWtMuHxGS7GwfLgG10iUdjumqy5Qmn2VE3PIRhw5hWg==", + "dependencies": { + "Tekla.Common.Geometry": "4.6.2", + "Tekla.Structures": "2024.0.2", + "Tekla.Structures.Datatype": "2024.0.2", + "Tekla.Technology.Serialization": "4.1.1", + "Trimble.Remoting": "1.0.2" + } + }, + "Tekla.Structures.Plugins": { + "type": "CentralTransitive", + "requested": "[2024.0.2, )", + "resolved": "2024.0.2", + "contentHash": "40Dn4sAcfLJc1Gi6sK95tVz8BwmB4vvRjcZcFJ55F3HMr2mwtcJhvDQED0exlZuU3pbibjhUZaNz0/I16Mms/w==", + "dependencies": { + "Tekla.Structures": "2024.0.2", + "Tekla.Technology.Scripting.Plugins": "5.5.0", + "Tekla.Technology.Serialization": "4.1.1", + "Trimble.Remoting": "1.0.2" + } + } + } + } +} \ No newline at end of file diff --git a/Directory.Packages.props b/Directory.Packages.props index 319af5ed..44ab076b 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -21,6 +21,7 @@ + diff --git a/Speckle.Connectors.sln b/Speckle.Connectors.sln index 20a475d0..fb9b853f 100644 --- a/Speckle.Connectors.sln +++ b/Speckle.Connectors.sln @@ -173,6 +173,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Speckle.Connectors.Civil3d2 EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Speckle.Converters.Civil3d2025", "Converters\Civil3d\Speckle.Converters.Civil3d2025\Speckle.Converters.Civil3d2025.csproj", "{DB31E57B-60FC-49BE-91E0-1374290BCF03}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Speckle.Converter.Tekla2024", "Converters\Tekla\Speckle.Converter.Tekla2024\Speckle.Converter.Tekla2024.csproj", "{EA00D499-F1DF-42A2-86AD-40B28073A45D}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -450,6 +452,12 @@ Global {DB31E57B-60FC-49BE-91E0-1374290BCF03}.Local|Any CPU.Build.0 = Debug|Any CPU {DB31E57B-60FC-49BE-91E0-1374290BCF03}.Release|Any CPU.ActiveCfg = Release|Any CPU {DB31E57B-60FC-49BE-91E0-1374290BCF03}.Release|Any CPU.Build.0 = Release|Any CPU + {EA00D499-F1DF-42A2-86AD-40B28073A45D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {EA00D499-F1DF-42A2-86AD-40B28073A45D}.Debug|Any CPU.Build.0 = Debug|Any CPU + {EA00D499-F1DF-42A2-86AD-40B28073A45D}.Local|Any CPU.ActiveCfg = Debug|Any CPU + {EA00D499-F1DF-42A2-86AD-40B28073A45D}.Local|Any CPU.Build.0 = Debug|Any CPU + {EA00D499-F1DF-42A2-86AD-40B28073A45D}.Release|Any CPU.ActiveCfg = Release|Any CPU + {EA00D499-F1DF-42A2-86AD-40B28073A45D}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -528,6 +536,7 @@ Global {842F4BFD-3997-485D-BAB5-9419C1D982F2} = {52D71CA4-AE77-4DD4-9456-1E1489413607} {4459F2B1-A340-488E-A856-EB2AE9C72AD4} = {B2BF1FAE-D0F4-4961-84CB-A00D3CABD236} {DB31E57B-60FC-49BE-91E0-1374290BCF03} = {B2BF1FAE-D0F4-4961-84CB-A00D3CABD236} + {EA00D499-F1DF-42A2-86AD-40B28073A45D} = {696086E4-D8CC-4FE0-A9B3-5F10B9089B55} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {EE253116-7070-4E9A-BCE8-2911C251B8C8} From 0a9d4e847713b9435bda997f9f948b4502018f1b Mon Sep 17 00:00:00 2001 From: Dogukan Karatas Date: Wed, 23 Oct 2024 16:39:41 +0200 Subject: [PATCH 02/29] adds send operation --- .../Bindings/TeklaSendBinding.cs | 188 +++++++++++++++++- .../Operations/Send/TeklaRootObjectBuilder.cs | 111 +++++++++++ .../ServiceRegistration.cs | 60 ++++-- .../Speckle.Connector.Tekla2024.csproj | 1 + .../packages.lock.json | 16 ++ .../Properties/AssemblyInfo.cs | 35 ++++ .../ServiceRegistration.cs | 7 + .../Speckle.Converter.Tekla2024.csproj | 73 ++++++- .../TeklaConversionSettings.cs | 2 +- .../TeklaConversionSettingsFactory.cs | 2 +- .../TeklaRootToSpeckleConverter.cs | 1 + .../TeklaToSpeckleUnitConverter.cs | 1 + .../packages.lock.json | 132 ++++++++---- Speckle.Connectors.sln | 16 +- 14 files changed, 568 insertions(+), 77 deletions(-) create mode 100644 Connectors/Tekla/Speckle.Connector.Tekla2024/Operations/Send/TeklaRootObjectBuilder.cs create mode 100644 Converters/Tekla/Speckle.Converter.Tekla2024/Properties/AssemblyInfo.cs diff --git a/Connectors/Tekla/Speckle.Connector.Tekla2024/Bindings/TeklaSendBinding.cs b/Connectors/Tekla/Speckle.Connector.Tekla2024/Bindings/TeklaSendBinding.cs index 2a9d2116..5175c760 100644 --- a/Connectors/Tekla/Speckle.Connector.Tekla2024/Bindings/TeklaSendBinding.cs +++ b/Connectors/Tekla/Speckle.Connector.Tekla2024/Bindings/TeklaSendBinding.cs @@ -1,29 +1,205 @@ +using System.Collections.Concurrent; +using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.Logging; +using Speckle.Connectors.Common.Caching; +using Speckle.Connectors.Common.Cancellation; +using Speckle.Connectors.Common.Operations; using Speckle.Connectors.DUI.Bindings; using Speckle.Connectors.DUI.Bridge; +using Speckle.Connectors.DUI.Exceptions; +using Speckle.Connectors.DUI.Logging; +using Speckle.Connectors.DUI.Models; +using Speckle.Connectors.DUI.Models.Card; using Speckle.Connectors.DUI.Models.Card.SendFilter; using Speckle.Connectors.DUI.Settings; +using Speckle.Converter.Tekla2024; +using Speckle.Converters.Common; +using Speckle.Sdk; +using Speckle.Sdk.Common; +using Speckle.Sdk.Logging; +using Tekla.Structures; +using Tekla.Structures.Model; +using Task = System.Threading.Tasks.Task; namespace Speckle.Connector.Tekla2024.Bindings; -public class TeklaSendBinding : ISendBinding +public sealed class TeklaSendBinding : ISendBinding, IDisposable { public string Name => "sendBinding"; + public SendBindingUICommands Commands { get; } public IBrowserBridge Parent { get; } + + private readonly DocumentModelStore _store; + private readonly IAppIdleManager _idleManager; + private readonly IServiceProvider _serviceProvider; private readonly List _sendFilters; + private readonly CancellationManager _cancellationManager; + private readonly ISendConversionCache _sendConversionCache; + private readonly IOperationProgressManager _operationProgressManager; + private readonly ILogger _logger; + private readonly ITeklaConversionSettingsFactory _teklaConversionSettingsFactory; + private readonly ISpeckleApplication _speckleApplication; + private readonly ISdkActivityFactory _activityFactory; + private readonly Model _model; + private readonly Events _events; - public TeklaSendBinding(IBrowserBridge parent, IEnumerable sendFilters) + private ConcurrentDictionary ChangedObjectIds { get; set; } = new(); + + public TeklaSendBinding( + DocumentModelStore store, + IAppIdleManager idleManager, + IBrowserBridge parent, + IEnumerable sendFilters, + IServiceProvider serviceProvider, + CancellationManager cancellationManager, + ISendConversionCache sendConversionCache, + IOperationProgressManager operationProgressManager, + ILogger logger, + ITeklaConversionSettingsFactory teklaConversionSettingsFactory, + ISpeckleApplication speckleApplication, + ISdkActivityFactory activityFactory + ) { - Parent = parent; + _store = store; + _idleManager = idleManager; + _serviceProvider = serviceProvider; _sendFilters = sendFilters.ToList(); + _cancellationManager = cancellationManager; + _sendConversionCache = sendConversionCache; + _operationProgressManager = operationProgressManager; + _logger = logger; + _teklaConversionSettingsFactory = teklaConversionSettingsFactory; + _speckleApplication = speckleApplication; + Parent = parent; + Commands = new SendBindingUICommands(parent); + _activityFactory = activityFactory; + + _model = new Model(); + _events = new Events(); + SubscribeToTeklaEvents(); + } + + private void SubscribeToTeklaEvents() + { + _events.ModelObjectChanged += ModelHandler_OnChange; + _events.Register(); + } + + private void ModelHandler_OnChange(List changes) + { + foreach (var change in changes) + { + if (change.Object is ModelObject modelObj) + { + ChangedObjectIds[modelObj.Identifier.ID.ToString()] = 1; + } + } + + if (changes.Count > 0) + { + _idleManager.SubscribeToIdle(nameof(TeklaSendBinding), () => RunExpirationChecks()); + } } public List GetSendFilters() => _sendFilters; public List GetSendSettings() => []; - public Task Send(string modelCardId) => Task.CompletedTask; + public async Task Send(string modelCardId) + { + using var activity = _activityFactory.Start(); + using var scope = _serviceProvider.CreateScope(); + scope + .ServiceProvider.GetRequiredService>() + .Initialize(_teklaConversionSettingsFactory.Create(_model)); + + try + { + if (_store.GetModelById(modelCardId) is not SenderModelCard modelCard) + { + throw new InvalidOperationException("No publish model card was found."); + } - public void CancelSend(string modelCardId) => throw new NotImplementedException(); + CancellationToken cancellationToken = _cancellationManager.InitCancellationTokenSource(modelCardId); - public SendBindingUICommands Commands { get; } + List teklaObjects = modelCard + .SendFilter.NotNull() + .GetObjectIds() + .Select(id => _model.SelectModelObject(new Identifier(Convert.ToInt32(id)))) + .Where(obj => obj != null) + .ToList(); + + if (teklaObjects.Count == 0) + { + throw new SpeckleSendFilterException("No objects were found to convert. Please update your publish filter!"); + } + + var sendResult = await scope + .ServiceProvider.GetRequiredService>() + .Execute( + teklaObjects, + modelCard.GetSendInfo(_speckleApplication.Slug), + _operationProgressManager.CreateOperationProgressEventHandler(Parent, modelCardId, cancellationToken), + cancellationToken + ) + .ConfigureAwait(false); + + await Commands + .SetModelSendResult(modelCardId, sendResult.RootObjId, sendResult.ConversionResults) + .ConfigureAwait(false); + } + catch (OperationCanceledException) + { + return; + } + catch (Exception ex) when (!ex.IsFatal()) + { + _logger.LogModelCardHandledError(ex); + await Commands.SetModelError(modelCardId, ex).ConfigureAwait(false); + } + } + + public void CancelSend(string modelCardId) => _cancellationManager.CancelOperation(modelCardId); + + private async Task RunExpirationChecks() + { + if (!_model.GetConnectionStatus()) + { + _logger.LogError("Tekla expiration checks were running without an active model."); + return; + } + + var senders = _store.GetSenders(); + string[] objectIdsList = ChangedObjectIds.Keys.ToArray(); + List expiredSenderIds = new(); + + _sendConversionCache.EvictObjects(objectIdsList); + + foreach (SenderModelCard modelCard in senders) + { + var intersection = modelCard.SendFilter.NotNull().GetObjectIds().Intersect(objectIdsList).ToList(); + var isExpired = intersection.Count != 0; + if (isExpired) + { + expiredSenderIds.Add(modelCard.ModelCardId.NotNull()); + } + } + + await Commands.SetModelsExpired(expiredSenderIds).ConfigureAwait(false); + ChangedObjectIds = new(); + } + + private bool _disposed; + + public void Dispose() + { + if (!_disposed) + { + if (_events != null) + { + _events.UnRegister(); + } + _disposed = true; + } + } } diff --git a/Connectors/Tekla/Speckle.Connector.Tekla2024/Operations/Send/TeklaRootObjectBuilder.cs b/Connectors/Tekla/Speckle.Connector.Tekla2024/Operations/Send/TeklaRootObjectBuilder.cs new file mode 100644 index 00000000..40e7b247 --- /dev/null +++ b/Connectors/Tekla/Speckle.Connector.Tekla2024/Operations/Send/TeklaRootObjectBuilder.cs @@ -0,0 +1,111 @@ +using Microsoft.Extensions.Logging; +using Speckle.Connectors.Common.Builders; +using Speckle.Connectors.Common.Caching; +using Speckle.Connectors.Common.Conversion; +using Speckle.Connectors.Common.Operations; +using Speckle.Converter.Tekla2024; +using Speckle.Converters.Common; +using Speckle.Sdk; +using Speckle.Sdk.Logging; +using Speckle.Sdk.Models; +using Speckle.Sdk.Models.Collections; +using Tekla.Structures.Model; +using Task = System.Threading.Tasks.Task; + +namespace Speckle.Connector.Tekla2024.Operations.Send; + +public class TeklaRootObjectBuilder : IRootObjectBuilder +{ + private readonly IRootToSpeckleConverter _rootToSpeckleConverter; + private readonly ISendConversionCache _sendConversionCache; + private readonly IConverterSettingsStore _converterSettings; + private readonly ILogger _logger; + private readonly ISdkActivityFactory _activityFactory; + + public TeklaRootObjectBuilder( + IRootToSpeckleConverter rootToSpeckleConverter, + ISendConversionCache sendConversionCache, + IConverterSettingsStore converterSettings, + ILogger logger, + ISdkActivityFactory activityFactory + ) + { + _sendConversionCache = sendConversionCache; + _converterSettings = converterSettings; + _rootToSpeckleConverter = rootToSpeckleConverter; + _logger = logger; + _activityFactory = activityFactory; + } + + public async Task Build( + IReadOnlyList teklaObjects, + SendInfo sendInfo, + IProgress onOperationProgressed, + CancellationToken cancellationToken = default + ) + { + using var activity = _activityFactory.Start("Build"); + + var model = new Model(); + string modelName = model.GetInfo().ModelName ?? "Unnamed model"; + + Collection rootObjectCollection = new() { name = modelName }; + rootObjectCollection["units"] = _converterSettings.Current.SpeckleUnits; + + List results = new(teklaObjects.Count); + int count = 0; + + using (var _ = _activityFactory.Start("Convert all")) + { + foreach (ModelObject teklaObject in teklaObjects) + { + using var _2 = _activityFactory.Start("Convert"); + cancellationToken.ThrowIfCancellationRequested(); + + var result = ConvertTeklaObject(teklaObject, rootObjectCollection, sendInfo.ProjectId); + results.Add(result); + + ++count; + onOperationProgressed.Report(new("Converting", (double)count / teklaObjects.Count)); + } + } + + if (results.All(x => x.Status == Status.ERROR)) + { + throw new SpeckleException("Failed to convert all objects."); + } + + await Task.Yield(); + return new RootObjectBuilderResult(rootObjectCollection, results); + } + + private SendConversionResult ConvertTeklaObject(ModelObject teklaObject, Collection collectionHost, string projectId) + { + string applicationId = teklaObject.Identifier.ToString(); + string sourceType = teklaObject.GetType().Name; + + try + { + Base converted; + if (_sendConversionCache.TryGetValue(projectId, applicationId, out ObjectReference? value)) + { + converted = value; + } + else + { + converted = _rootToSpeckleConverter.Convert(teklaObject); + converted.applicationId = applicationId; + } + + // Add to host collection + collectionHost.elements.Add(converted); + + return new(Status.SUCCESS, applicationId, sourceType, converted); + } + catch (Exception ex) when (!ex.IsFatal()) + { + _logger.LogError(ex, sourceType); + return new(Status.ERROR, applicationId, sourceType, null, ex); + } + } +} diff --git a/Connectors/Tekla/Speckle.Connector.Tekla2024/ServiceRegistration.cs b/Connectors/Tekla/Speckle.Connector.Tekla2024/ServiceRegistration.cs index 8489e85f..e6fbabf4 100644 --- a/Connectors/Tekla/Speckle.Connector.Tekla2024/ServiceRegistration.cs +++ b/Connectors/Tekla/Speckle.Connector.Tekla2024/ServiceRegistration.cs @@ -2,41 +2,67 @@ using Speckle.Connector.Tekla2024.Bindings; using Speckle.Connector.Tekla2024.Filters; using Speckle.Connector.Tekla2024.HostApp; +using Speckle.Connector.Tekla2024.Operations.Send; using Speckle.Connectors.Common; +using Speckle.Connectors.Common.Builders; +using Speckle.Connectors.Common.Caching; +using Speckle.Connectors.Common.Cancellation; +using Speckle.Connectors.Common.Operations; using Speckle.Connectors.DUI; using Speckle.Connectors.DUI.Bindings; using Speckle.Connectors.DUI.Bridge; using Speckle.Connectors.DUI.Models; using Speckle.Connectors.DUI.Models.Card.SendFilter; using Speckle.Connectors.DUI.WebView; +using Speckle.Converter.Tekla2024; +using Speckle.Converters.Common; +using Speckle.Sdk.Models.GraphTraversal; +using Tekla.Structures.Model; namespace Speckle.Connector.Tekla2024; public static class ServiceRegistration { - public static void AddTekla(this IServiceCollection serviceCollection) + public static IServiceCollection AddTekla(this IServiceCollection services) { - serviceCollection.AddConnectorUtils(); - serviceCollection.AddDUI(); - serviceCollection.AddDUIView(); + services.AddSingleton(); - serviceCollection.AddSingleton(); - serviceCollection.AddSingleton(); - serviceCollection.AddSingleton(); + services.AddConnectorUtils(); + services.AddDUI(); + services.AddDUIView(); - serviceCollection.AddSingleton(); + services.AddSingleton(); + services.AddSingleton(); - serviceCollection.RegisterTopLevelExceptionHandler(); + services.AddSingleton(); + services.AddSingleton(); + services.AddSingleton(); + services.AddSingleton(); + services.AddSingleton(sp => sp.GetRequiredService()); + services.AddSingleton(); + services.AddSingleton(); - serviceCollection.AddSingleton(sp => sp.GetRequiredService()); - serviceCollection.AddSingleton(); + services.RegisterTopLevelExceptionHandler(); - serviceCollection.AddSingleton(); - serviceCollection.AddSingleton(); - serviceCollection.AddSingleton(); + services.AddSingleton(); + services.AddSingleton(); + services.AddSingleton(); - serviceCollection.AddScoped(); - serviceCollection.AddSingleton(new Tekla.Structures.Model.Events()); - serviceCollection.AddSingleton(new Tekla.Structures.Model.UI.ModelObjectSelector()); + services.AddScoped(); + services.AddSingleton(); + services.AddSingleton(DefaultTraversal.CreateTraversalFunc()); + services.AddScoped, TeklaRootObjectBuilder>(); + services.AddScoped>(); + + services.AddTransient(); + services.AddSingleton(); + + services.AddScoped(); + services.AddScoped< + IConverterSettingsStore, + ConverterSettingsStore + >(); + + return services; } } diff --git a/Connectors/Tekla/Speckle.Connector.Tekla2024/Speckle.Connector.Tekla2024.csproj b/Connectors/Tekla/Speckle.Connector.Tekla2024/Speckle.Connector.Tekla2024.csproj index 5e11e7dc..9a0583bd 100644 --- a/Connectors/Tekla/Speckle.Connector.Tekla2024/Speckle.Connector.Tekla2024.csproj +++ b/Connectors/Tekla/Speckle.Connector.Tekla2024/Speckle.Connector.Tekla2024.csproj @@ -22,6 +22,7 @@ + diff --git a/Connectors/Tekla/Speckle.Connector.Tekla2024/packages.lock.json b/Connectors/Tekla/Speckle.Connector.Tekla2024/packages.lock.json index 1b40d118..22c50676 100644 --- a/Connectors/Tekla/Speckle.Connector.Tekla2024/packages.lock.json +++ b/Connectors/Tekla/Speckle.Connector.Tekla2024/packages.lock.json @@ -437,6 +437,22 @@ "speckle.connectors.logging": { "type": "Project" }, + "speckle.converter.tekla2024": { + "type": "Project", + "dependencies": { + "Microsoft.Extensions.Logging": "[2.2.0, )", + "Speckle.Converters.Common": "[1.0.0, )", + "Tekla.Structures.Drawing": "[2024.0.2, )", + "Tekla.Structures.Model": "[2024.0.2, )" + } + }, + "speckle.converters.common": { + "type": "Project", + "dependencies": { + "Microsoft.Extensions.Logging.Abstractions": "[2.2.0, )", + "Speckle.Objects": "[3.1.0-dev.164, )" + } + }, "Microsoft.Extensions.DependencyInjection": { "type": "CentralTransitive", "requested": "[2.2.0, )", diff --git a/Converters/Tekla/Speckle.Converter.Tekla2024/Properties/AssemblyInfo.cs b/Converters/Tekla/Speckle.Converter.Tekla2024/Properties/AssemblyInfo.cs new file mode 100644 index 00000000..026e5924 --- /dev/null +++ b/Converters/Tekla/Speckle.Converter.Tekla2024/Properties/AssemblyInfo.cs @@ -0,0 +1,35 @@ +using System.Reflection; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("Speckle.Converter.Tekla2024")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("Speckle.Converter.Tekla2024")] +[assembly: AssemblyCopyright("Copyright © 2024")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("ACF75860-7FCE-4AE9-8C45-68AD1043550B")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/Converters/Tekla/Speckle.Converter.Tekla2024/ServiceRegistration.cs b/Converters/Tekla/Speckle.Converter.Tekla2024/ServiceRegistration.cs index c9b3f87d..6190998d 100644 --- a/Converters/Tekla/Speckle.Converter.Tekla2024/ServiceRegistration.cs +++ b/Converters/Tekla/Speckle.Converter.Tekla2024/ServiceRegistration.cs @@ -1,5 +1,6 @@ using System.Reflection; using Microsoft.Extensions.DependencyInjection; +using Speckle.Converters.Common; using Speckle.Converters.Common.Registration; using Speckle.Sdk; using Tekla.Structures.Drawing; @@ -12,8 +13,14 @@ public static IServiceCollection AddTeklaConverters(this IServiceCollection serv { var converterAssembly = Assembly.GetExecutingAssembly(); serviceCollection.AddMatchingInterfacesAsTransient(converterAssembly); + serviceCollection.AddRootCommon(converterAssembly); serviceCollection.AddApplicationConverters(converterAssembly); + serviceCollection.AddApplicationConverters(converterAssembly); + serviceCollection.AddScoped< + IConverterSettingsStore, + ConverterSettingsStore + >(); return serviceCollection; } diff --git a/Converters/Tekla/Speckle.Converter.Tekla2024/Speckle.Converter.Tekla2024.csproj b/Converters/Tekla/Speckle.Converter.Tekla2024/Speckle.Converter.Tekla2024.csproj index 9b3b1569..ebaadfe9 100644 --- a/Converters/Tekla/Speckle.Converter.Tekla2024/Speckle.Converter.Tekla2024.csproj +++ b/Converters/Tekla/Speckle.Converter.Tekla2024/Speckle.Converter.Tekla2024.csproj @@ -1,17 +1,70 @@ - - + + + - net8.0 - enable - enable + Debug + AnyCPU + {ACF75860-7FCE-4AE9-8C45-68AD1043550B} + Library + Properties + Speckle.Converter.Tekla2024 + Speckle.Converter.Tekla2024 + v4.8 + 512 - + + AnyCPU + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + AnyCPU + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + ..\..\..\..\..\..\.nuget\packages\speckle.sdk\3.1.0-dev.164\lib\netstandard2.0\Speckle.Sdk.dll + + + + + + + + + + + + + + + + - - + + {8aef06c0-ca5c-4460-bc2d-ade5f35d0434} + Speckle.Converters.Common + - - + + + \ No newline at end of file diff --git a/Converters/Tekla/Speckle.Converter.Tekla2024/TeklaConversionSettings.cs b/Converters/Tekla/Speckle.Converter.Tekla2024/TeklaConversionSettings.cs index c2e45b95..96b1926f 100644 --- a/Converters/Tekla/Speckle.Converter.Tekla2024/TeklaConversionSettings.cs +++ b/Converters/Tekla/Speckle.Converter.Tekla2024/TeklaConversionSettings.cs @@ -2,4 +2,4 @@ namespace Speckle.Converter.Tekla2024; -public record TeklaConversionSettings(Model Document, string SpeckleUnits); +public record TeklaConversionSettings(Model Document, string SpeckleUnits); \ No newline at end of file diff --git a/Converters/Tekla/Speckle.Converter.Tekla2024/TeklaConversionSettingsFactory.cs b/Converters/Tekla/Speckle.Converter.Tekla2024/TeklaConversionSettingsFactory.cs index fcf07162..17a97f38 100644 --- a/Converters/Tekla/Speckle.Converter.Tekla2024/TeklaConversionSettingsFactory.cs +++ b/Converters/Tekla/Speckle.Converter.Tekla2024/TeklaConversionSettingsFactory.cs @@ -16,4 +16,4 @@ IConverterSettingsStore settingsStore // only handles automatic rn public TeklaConversionSettings Create(Model document) => new(document, unitsConverter.ConvertOrThrow(TSD.Units.Automatic)); -} +} \ No newline at end of file diff --git a/Converters/Tekla/Speckle.Converter.Tekla2024/TeklaRootToSpeckleConverter.cs b/Converters/Tekla/Speckle.Converter.Tekla2024/TeklaRootToSpeckleConverter.cs index 51a5f10a..4ed35ec9 100644 --- a/Converters/Tekla/Speckle.Converter.Tekla2024/TeklaRootToSpeckleConverter.cs +++ b/Converters/Tekla/Speckle.Converter.Tekla2024/TeklaRootToSpeckleConverter.cs @@ -1,3 +1,4 @@ +using System; using Microsoft.Extensions.Logging; using Speckle.Converters.Common; using Speckle.Converters.Common.Objects; diff --git a/Converters/Tekla/Speckle.Converter.Tekla2024/TeklaToSpeckleUnitConverter.cs b/Converters/Tekla/Speckle.Converter.Tekla2024/TeklaToSpeckleUnitConverter.cs index 91187fa2..7431bc89 100644 --- a/Converters/Tekla/Speckle.Converter.Tekla2024/TeklaToSpeckleUnitConverter.cs +++ b/Converters/Tekla/Speckle.Converter.Tekla2024/TeklaToSpeckleUnitConverter.cs @@ -2,6 +2,7 @@ using Speckle.Sdk.Common.Exceptions; using SSC = Speckle.Sdk.Common; using TSD = Tekla.Structures.Drawing; +using System.Collections.Generic; namespace Speckle.Converter.Tekla2024; diff --git a/Converters/Tekla/Speckle.Converter.Tekla2024/packages.lock.json b/Converters/Tekla/Speckle.Converter.Tekla2024/packages.lock.json index 1b783ff5..ed13d2bd 100644 --- a/Converters/Tekla/Speckle.Converter.Tekla2024/packages.lock.json +++ b/Converters/Tekla/Speckle.Converter.Tekla2024/packages.lock.json @@ -1,14 +1,26 @@ { "version": 2, "dependencies": { - "net8.0": { + ".NETFramework,Version=v4.8": { + "Microsoft.Extensions.Logging": { + "type": "Direct", + "requested": "[2.2.0, )", + "resolved": "2.2.0", + "contentHash": "Nxqhadc9FCmFHzU+fz3oc8sFlE6IadViYg8dfUdGzJZ2JUxnCsRghBhhOWdM4B2zSZqEc+0BjliBh/oNdRZuig==", + "dependencies": { + "Microsoft.Extensions.Configuration.Binder": "2.2.0", + "Microsoft.Extensions.DependencyInjection.Abstractions": "2.2.0", + "Microsoft.Extensions.Logging.Abstractions": "2.2.0", + "Microsoft.Extensions.Options": "2.2.0" + } + }, "Microsoft.NETFramework.ReferenceAssemblies": { "type": "Direct", "requested": "[1.0.3, )", "resolved": "1.0.3", "contentHash": "vUc9Npcs14QsyOD01tnv/m8sQUnGTGOw1BCmKcv77LBJY7OxhJ+zJF7UD/sCL3lYNFuqmQEVlkfS4Quif6FyYg==", "dependencies": { - "Microsoft.NETFramework.ReferenceAssemblies.net461": "1.0.3" + "Microsoft.NETFramework.ReferenceAssemblies.net48": "1.0.3" } }, "Microsoft.SourceLink.GitHub": { @@ -48,6 +60,19 @@ "Trimble.Remoting": "1.0.2" } }, + "Tekla.Structures.Model": { + "type": "Direct", + "requested": "[2024.0.2, )", + "resolved": "2024.0.2", + "contentHash": "GV7mqc3TX7h3QeCLmjCI8GlnbhAMYOvLMEED1TY+hpdeWtMuHxGS7GwfLgG10iUdjumqy5Qmn2VE3PIRhw5hWg==", + "dependencies": { + "Tekla.Common.Geometry": "4.6.2", + "Tekla.Structures": "2024.0.2", + "Tekla.Structures.Datatype": "2024.0.2", + "Tekla.Technology.Serialization": "4.1.1", + "Trimble.Remoting": "1.0.2" + } + }, "GraphQL.Client": { "type": "Transitive", "resolved": "6.0.0", @@ -55,6 +80,7 @@ "dependencies": { "GraphQL.Client.Abstractions": "6.0.0", "GraphQL.Client.Abstractions.Websocket": "6.0.0", + "System.Net.WebSockets.Client.Managed": "1.0.22", "System.Reactive": "5.0.0" } }, @@ -154,10 +180,10 @@ "System.Runtime.CompilerServices.Unsafe": "4.5.1" } }, - "Microsoft.NETFramework.ReferenceAssemblies.net461": { + "Microsoft.NETFramework.ReferenceAssemblies.net48": { "type": "Transitive", "resolved": "1.0.3", - "contentHash": "AmOJZwCqnOCNp6PPcf9joyogScWLtwy0M1WkqfEQ0M9nYwyDD7EX9ZjscKS5iYnyvteX7kzSKFCKt9I9dXA6mA==" + "contentHash": "zMk4D+9zyiEWByyQ7oPImPN/Jhpj166Ky0Nlla4eXlNL8hI/BtSJsgR8Inldd4NNpIAH3oh8yym0W2DrhXdSLQ==" }, "Microsoft.SourceLink.Common": { "type": "Transitive", @@ -203,7 +229,7 @@ "contentHash": "EWI1olKDjFEBMJu0+3wuxwziIAdWDVMYLhuZ3Qs84rrz+DHwD00RzWPZCa+bLnHCf3oJwuFZIRsHT5p236QXww==", "dependencies": { "SQLitePCLRaw.lib.e_sqlite3": "2.1.4", - "SQLitePCLRaw.provider.e_sqlite3": "2.1.4" + "SQLitePCLRaw.provider.dynamic_cdecl": "2.1.4" } }, "SQLitePCLRaw.core": { @@ -219,14 +245,19 @@ "resolved": "2.1.4", "contentHash": "2C9Q9eX7CPLveJA0rIhf9RXAvu+7nWZu1A2MdG6SD/NOu26TakGgL1nsbc0JAspGijFOo3HoN79xrx8a368fBg==" }, - "SQLitePCLRaw.provider.e_sqlite3": { + "SQLitePCLRaw.provider.dynamic_cdecl": { "type": "Transitive", "resolved": "2.1.4", - "contentHash": "CSlb5dUp1FMIkez9Iv5EXzpeq7rHryVNqwJMWnpq87j9zWZexaEMdisDktMsnnrzKM6ahNrsTkjqNodTBPBxtQ==", + "contentHash": "ZsaKKhgYF9B1fvcnOGKl3EycNAwd9CRWX7v0rEfuPWhQQ5Jjpvf2VEHahiLIGHio3hxi3EIKFJw9KvyowWOUAw==", "dependencies": { "SQLitePCLRaw.core": "2.1.4" } }, + "System.Buffers": { + "type": "Transitive", + "resolved": "4.5.1", + "contentHash": "Rw7ijyl1qqRS0YQD/WycNst8hUUMgrMH4FCn1nNm27M4VxchZ1js3fVjQaANHO5f3sN4isvP4a+Met9Y4YomAg==" + }, "System.ComponentModel.Annotations": { "type": "Transitive", "resolved": "4.5.0", @@ -235,12 +266,34 @@ "System.Memory": { "type": "Transitive", "resolved": "4.5.5", - "contentHash": "XIWiDvKPXaTveaB7HVganDlOCRoj03l+jrwNvcge/t8vhGYKvqV+dMv6G4SAX2NoNmN0wZfVPTAlFwZcZvVOUw==" + "contentHash": "XIWiDvKPXaTveaB7HVganDlOCRoj03l+jrwNvcge/t8vhGYKvqV+dMv6G4SAX2NoNmN0wZfVPTAlFwZcZvVOUw==", + "dependencies": { + "System.Buffers": "4.5.1", + "System.Numerics.Vectors": "4.5.0", + "System.Runtime.CompilerServices.Unsafe": "4.5.3" + } + }, + "System.Net.WebSockets.Client.Managed": { + "type": "Transitive", + "resolved": "1.0.22", + "contentHash": "WqEOxPlXjuZrIjUtXNE9NxEfU/n5E35iV2PtoZdJSUC4tlrqwHnTee+wvMIM4OUaJWmwrymeqcgYrE0IkGAgLA==", + "dependencies": { + "System.Buffers": "4.4.0", + "System.Numerics.Vectors": "4.4.0" + } + }, + "System.Numerics.Vectors": { + "type": "Transitive", + "resolved": "4.5.0", + "contentHash": "QQTlPTl06J/iiDbJCiepZ4H//BVraReU4O4EoRw1U02H5TLUIT7xn3GnDp9AXPSlJUDyFs4uWjWafNX6WrAojQ==" }, "System.Reactive": { "type": "Transitive", "resolved": "5.0.0", - "contentHash": "erBZjkQHWL9jpasCE/0qKAryzVBJFxGHVBAvgRN1bzM0q2s1S4oYREEEL0Vb+1kA/6BKb5FjUZMp5VXmy+gzkQ==" + "contentHash": "erBZjkQHWL9jpasCE/0qKAryzVBJFxGHVBAvgRN1bzM0q2s1S4oYREEEL0Vb+1kA/6BKb5FjUZMp5VXmy+gzkQ==", + "dependencies": { + "System.Threading.Tasks.Extensions": "4.5.4" + } }, "System.Reflection.Emit.Lightweight": { "type": "Transitive", @@ -252,6 +305,14 @@ "resolved": "6.0.0", "contentHash": "/iUeP3tq1S0XdNNoMz5C9twLSrM/TH+qElHkXWaPvuNOt+99G75NrV0OS2EqHx5wMN7popYjpc8oTjC1y16DLg==" }, + "System.Threading.Tasks.Extensions": { + "type": "Transitive", + "resolved": "4.5.4", + "contentHash": "zteT+G8xuGu6mS+mzDzYXbzS7rd3K6Fjb9RiZlYlJPam2/hU7JCBZBVEcywNuR+oZ1ncTvc/cq0faRr3P01OVg==", + "dependencies": { + "System.Runtime.CompilerServices.Unsafe": "4.5.3" + } + }, "Tekla.Common.Geometry": { "type": "Transitive", "resolved": "4.6.2", @@ -305,18 +366,6 @@ "Speckle.Objects": "[3.1.0-dev.164, )" } }, - "Microsoft.Extensions.Logging": { - "type": "CentralTransitive", - "requested": "[2.2.0, )", - "resolved": "2.2.0", - "contentHash": "Nxqhadc9FCmFHzU+fz3oc8sFlE6IadViYg8dfUdGzJZ2JUxnCsRghBhhOWdM4B2zSZqEc+0BjliBh/oNdRZuig==", - "dependencies": { - "Microsoft.Extensions.Configuration.Binder": "2.2.0", - "Microsoft.Extensions.DependencyInjection.Abstractions": "2.2.0", - "Microsoft.Extensions.Logging.Abstractions": "2.2.0", - "Microsoft.Extensions.Options": "2.2.0" - } - }, "Microsoft.Extensions.Logging.Abstractions": { "type": "CentralTransitive", "requested": "[2.2.0, )", @@ -350,19 +399,6 @@ "Speckle.Newtonsoft.Json": "13.0.2" } }, - "Tekla.Structures.Model": { - "type": "CentralTransitive", - "requested": "[2024.0.2, )", - "resolved": "2024.0.2", - "contentHash": "GV7mqc3TX7h3QeCLmjCI8GlnbhAMYOvLMEED1TY+hpdeWtMuHxGS7GwfLgG10iUdjumqy5Qmn2VE3PIRhw5hWg==", - "dependencies": { - "Tekla.Common.Geometry": "4.6.2", - "Tekla.Structures": "2024.0.2", - "Tekla.Structures.Datatype": "2024.0.2", - "Tekla.Technology.Serialization": "4.1.1", - "Trimble.Remoting": "1.0.2" - } - }, "Tekla.Structures.Plugins": { "type": "CentralTransitive", "requested": "[2024.0.2, )", @@ -375,6 +411,34 @@ "Trimble.Remoting": "1.0.2" } } + }, + ".NETFramework,Version=v4.8/win": { + "SQLitePCLRaw.lib.e_sqlite3": { + "type": "Transitive", + "resolved": "2.1.4", + "contentHash": "2C9Q9eX7CPLveJA0rIhf9RXAvu+7nWZu1A2MdG6SD/NOu26TakGgL1nsbc0JAspGijFOo3HoN79xrx8a368fBg==" + } + }, + ".NETFramework,Version=v4.8/win-arm64": { + "SQLitePCLRaw.lib.e_sqlite3": { + "type": "Transitive", + "resolved": "2.1.4", + "contentHash": "2C9Q9eX7CPLveJA0rIhf9RXAvu+7nWZu1A2MdG6SD/NOu26TakGgL1nsbc0JAspGijFOo3HoN79xrx8a368fBg==" + } + }, + ".NETFramework,Version=v4.8/win-x64": { + "SQLitePCLRaw.lib.e_sqlite3": { + "type": "Transitive", + "resolved": "2.1.4", + "contentHash": "2C9Q9eX7CPLveJA0rIhf9RXAvu+7nWZu1A2MdG6SD/NOu26TakGgL1nsbc0JAspGijFOo3HoN79xrx8a368fBg==" + } + }, + ".NETFramework,Version=v4.8/win-x86": { + "SQLitePCLRaw.lib.e_sqlite3": { + "type": "Transitive", + "resolved": "2.1.4", + "contentHash": "2C9Q9eX7CPLveJA0rIhf9RXAvu+7nWZu1A2MdG6SD/NOu26TakGgL1nsbc0JAspGijFOo3HoN79xrx8a368fBg==" + } } } } \ No newline at end of file diff --git a/Speckle.Connectors.sln b/Speckle.Connectors.sln index fb9b853f..a7b16cf0 100644 --- a/Speckle.Connectors.sln +++ b/Speckle.Connectors.sln @@ -173,7 +173,7 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Speckle.Connectors.Civil3d2 EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Speckle.Converters.Civil3d2025", "Converters\Civil3d\Speckle.Converters.Civil3d2025\Speckle.Converters.Civil3d2025.csproj", "{DB31E57B-60FC-49BE-91E0-1374290BCF03}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Speckle.Converter.Tekla2024", "Converters\Tekla\Speckle.Converter.Tekla2024\Speckle.Converter.Tekla2024.csproj", "{EA00D499-F1DF-42A2-86AD-40B28073A45D}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Speckle.Converter.Tekla2024", "Converters\Tekla\Speckle.Converter.Tekla2024\Speckle.Converter.Tekla2024.csproj", "{ACF75860-7FCE-4AE9-8C45-68AD1043550B}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -452,12 +452,12 @@ Global {DB31E57B-60FC-49BE-91E0-1374290BCF03}.Local|Any CPU.Build.0 = Debug|Any CPU {DB31E57B-60FC-49BE-91E0-1374290BCF03}.Release|Any CPU.ActiveCfg = Release|Any CPU {DB31E57B-60FC-49BE-91E0-1374290BCF03}.Release|Any CPU.Build.0 = Release|Any CPU - {EA00D499-F1DF-42A2-86AD-40B28073A45D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {EA00D499-F1DF-42A2-86AD-40B28073A45D}.Debug|Any CPU.Build.0 = Debug|Any CPU - {EA00D499-F1DF-42A2-86AD-40B28073A45D}.Local|Any CPU.ActiveCfg = Debug|Any CPU - {EA00D499-F1DF-42A2-86AD-40B28073A45D}.Local|Any CPU.Build.0 = Debug|Any CPU - {EA00D499-F1DF-42A2-86AD-40B28073A45D}.Release|Any CPU.ActiveCfg = Release|Any CPU - {EA00D499-F1DF-42A2-86AD-40B28073A45D}.Release|Any CPU.Build.0 = Release|Any CPU + {ACF75860-7FCE-4AE9-8C45-68AD1043550B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {ACF75860-7FCE-4AE9-8C45-68AD1043550B}.Debug|Any CPU.Build.0 = Debug|Any CPU + {ACF75860-7FCE-4AE9-8C45-68AD1043550B}.Local|Any CPU.ActiveCfg = Debug|Any CPU + {ACF75860-7FCE-4AE9-8C45-68AD1043550B}.Local|Any CPU.Build.0 = Debug|Any CPU + {ACF75860-7FCE-4AE9-8C45-68AD1043550B}.Release|Any CPU.ActiveCfg = Release|Any CPU + {ACF75860-7FCE-4AE9-8C45-68AD1043550B}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -536,7 +536,7 @@ Global {842F4BFD-3997-485D-BAB5-9419C1D982F2} = {52D71CA4-AE77-4DD4-9456-1E1489413607} {4459F2B1-A340-488E-A856-EB2AE9C72AD4} = {B2BF1FAE-D0F4-4961-84CB-A00D3CABD236} {DB31E57B-60FC-49BE-91E0-1374290BCF03} = {B2BF1FAE-D0F4-4961-84CB-A00D3CABD236} - {EA00D499-F1DF-42A2-86AD-40B28073A45D} = {696086E4-D8CC-4FE0-A9B3-5F10B9089B55} + {ACF75860-7FCE-4AE9-8C45-68AD1043550B} = {696086E4-D8CC-4FE0-A9B3-5F10B9089B55} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {EE253116-7070-4E9A-BCE8-2911C251B8C8} From 168d8dfadaf16639a2ccf487484f46e830131509 Mon Sep 17 00:00:00 2001 From: Dogukan Karatas Date: Wed, 23 Oct 2024 17:17:47 +0200 Subject: [PATCH 03/29] services registrated --- .../ServiceRegistration.cs | 11 +++++++++-- .../ServiceRegistration.cs | 2 ++ 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/Connectors/Tekla/Speckle.Connector.Tekla2024/ServiceRegistration.cs b/Connectors/Tekla/Speckle.Connector.Tekla2024/ServiceRegistration.cs index e6fbabf4..e115877c 100644 --- a/Connectors/Tekla/Speckle.Connector.Tekla2024/ServiceRegistration.cs +++ b/Connectors/Tekla/Speckle.Connector.Tekla2024/ServiceRegistration.cs @@ -16,6 +16,7 @@ using Speckle.Connectors.DUI.WebView; using Speckle.Converter.Tekla2024; using Speckle.Converters.Common; +using Speckle.Sdk; using Speckle.Sdk.Models.GraphTraversal; using Tekla.Structures.Model; @@ -25,6 +26,8 @@ public static class ServiceRegistration { public static IServiceCollection AddTekla(this IServiceCollection services) { + var converterAssembly = System.Reflection.Assembly.GetExecutingAssembly(); + services.AddSingleton(); services.AddConnectorUtils(); @@ -38,12 +41,13 @@ public static IServiceCollection AddTekla(this IServiceCollection services) services.AddSingleton(); services.AddSingleton(); services.AddSingleton(); + + services.RegisterTopLevelExceptionHandler(); + services.AddSingleton(sp => sp.GetRequiredService()); services.AddSingleton(); services.AddSingleton(); - services.RegisterTopLevelExceptionHandler(); - services.AddSingleton(); services.AddSingleton(); services.AddSingleton(); @@ -62,6 +66,9 @@ public static IServiceCollection AddTekla(this IServiceCollection services) IConverterSettingsStore, ConverterSettingsStore >(); + services.AddScoped(); + + services.AddMatchingInterfacesAsTransient(converterAssembly); return services; } diff --git a/Converters/Tekla/Speckle.Converter.Tekla2024/ServiceRegistration.cs b/Converters/Tekla/Speckle.Converter.Tekla2024/ServiceRegistration.cs index 6190998d..a5c83509 100644 --- a/Converters/Tekla/Speckle.Converter.Tekla2024/ServiceRegistration.cs +++ b/Converters/Tekla/Speckle.Converter.Tekla2024/ServiceRegistration.cs @@ -22,6 +22,8 @@ public static IServiceCollection AddTeklaConverters(this IServiceCollection serv ConverterSettingsStore >(); + serviceCollection.AddMatchingInterfacesAsTransient(converterAssembly); + return serviceCollection; } } From ba3810864d794f2eeafb1e41d477c80475411881 Mon Sep 17 00:00:00 2001 From: Dogukan Karatas Date: Thu, 24 Oct 2024 12:21:57 +0200 Subject: [PATCH 04/29] updates the panel host --- .../Bindings/TeklaSendBinding.cs | 2 +- .../Speckle.Connector.Tekla2024/ServiceRegistration.cs | 1 - .../Speckle.Connector.Tekla2024/SpeckleTeklaPanelHost.cs | 8 ++++++-- .../Speckle.Converter.Tekla2024/ServiceRegistration.cs | 1 - 4 files changed, 7 insertions(+), 5 deletions(-) diff --git a/Connectors/Tekla/Speckle.Connector.Tekla2024/Bindings/TeklaSendBinding.cs b/Connectors/Tekla/Speckle.Connector.Tekla2024/Bindings/TeklaSendBinding.cs index 5175c760..9fbc0971 100644 --- a/Connectors/Tekla/Speckle.Connector.Tekla2024/Bindings/TeklaSendBinding.cs +++ b/Connectors/Tekla/Speckle.Connector.Tekla2024/Bindings/TeklaSendBinding.cs @@ -125,7 +125,7 @@ public async Task Send(string modelCardId) List teklaObjects = modelCard .SendFilter.NotNull() .GetObjectIds() - .Select(id => _model.SelectModelObject(new Identifier(Convert.ToInt32(id)))) + .Select(id => _model.SelectModelObject(new Identifier(new Guid(id)))) .Where(obj => obj != null) .ToList(); diff --git a/Connectors/Tekla/Speckle.Connector.Tekla2024/ServiceRegistration.cs b/Connectors/Tekla/Speckle.Connector.Tekla2024/ServiceRegistration.cs index e115877c..78653cef 100644 --- a/Connectors/Tekla/Speckle.Connector.Tekla2024/ServiceRegistration.cs +++ b/Connectors/Tekla/Speckle.Connector.Tekla2024/ServiceRegistration.cs @@ -66,7 +66,6 @@ public static IServiceCollection AddTekla(this IServiceCollection services) IConverterSettingsStore, ConverterSettingsStore >(); - services.AddScoped(); services.AddMatchingInterfacesAsTransient(converterAssembly); diff --git a/Connectors/Tekla/Speckle.Connector.Tekla2024/SpeckleTeklaPanelHost.cs b/Connectors/Tekla/Speckle.Connector.Tekla2024/SpeckleTeklaPanelHost.cs index 6eee33c5..3767461c 100644 --- a/Connectors/Tekla/Speckle.Connector.Tekla2024/SpeckleTeklaPanelHost.cs +++ b/Connectors/Tekla/Speckle.Connector.Tekla2024/SpeckleTeklaPanelHost.cs @@ -4,6 +4,7 @@ using Speckle.Connectors.Common; using Speckle.Connectors.DUI; using Speckle.Connectors.DUI.WebView; +using Speckle.Converter.Tekla2024; using Speckle.Sdk.Host; using Tekla.Structures.Dialog; using Tekla.Structures.Model; @@ -22,9 +23,12 @@ public class SpeckleTeklaPanelHost : PluginFormBase public SpeckleTeklaPanelHost() { + Show(); + var services = new ServiceCollection(); services.Initialize(HostApplications.TeklaStructures, GetVersion()); services.AddTekla(); + services.AddTeklaConverters(); // TODO: Add Tekla converters @@ -46,9 +50,9 @@ public SpeckleTeklaPanelHost() Controls.Add(Host); Operation.DisplayPrompt("Speckle connector initialized."); - Show(); + // below methods are not really needed Activate(); - Focus(); + //Focus(); } private HostAppVersion GetVersion() diff --git a/Converters/Tekla/Speckle.Converter.Tekla2024/ServiceRegistration.cs b/Converters/Tekla/Speckle.Converter.Tekla2024/ServiceRegistration.cs index a5c83509..c927e7cc 100644 --- a/Converters/Tekla/Speckle.Converter.Tekla2024/ServiceRegistration.cs +++ b/Converters/Tekla/Speckle.Converter.Tekla2024/ServiceRegistration.cs @@ -15,7 +15,6 @@ public static IServiceCollection AddTeklaConverters(this IServiceCollection serv serviceCollection.AddMatchingInterfacesAsTransient(converterAssembly); serviceCollection.AddRootCommon(converterAssembly); - serviceCollection.AddApplicationConverters(converterAssembly); serviceCollection.AddApplicationConverters(converterAssembly); serviceCollection.AddScoped< IConverterSettingsStore, From cdf4863335d913ec6a2589c6fcaa89f953f0f35e Mon Sep 17 00:00:00 2001 From: Dogukan Karatas Date: Thu, 24 Oct 2024 16:04:37 +0200 Subject: [PATCH 05/29] adds beam converter --- .../Speckle.Converter.Tekla2024.csproj | 2 ++ .../TeklaRootToSpeckleConverter.cs | 1 - .../ToSpeckle/Raw/BeamRawConverter.cs | 18 ++++++++++++++++++ .../ToSpeckle/TopLevel/BeamConverter.cs | 19 +++++++++++++++++++ 4 files changed, 39 insertions(+), 1 deletion(-) create mode 100644 Converters/Tekla/Speckle.Converter.Tekla2024/ToSpeckle/Raw/BeamRawConverter.cs create mode 100644 Converters/Tekla/Speckle.Converter.Tekla2024/ToSpeckle/TopLevel/BeamConverter.cs diff --git a/Converters/Tekla/Speckle.Converter.Tekla2024/Speckle.Converter.Tekla2024.csproj b/Converters/Tekla/Speckle.Converter.Tekla2024/Speckle.Converter.Tekla2024.csproj index ebaadfe9..33d43d9a 100644 --- a/Converters/Tekla/Speckle.Converter.Tekla2024/Speckle.Converter.Tekla2024.csproj +++ b/Converters/Tekla/Speckle.Converter.Tekla2024/Speckle.Converter.Tekla2024.csproj @@ -47,6 +47,8 @@ + + diff --git a/Converters/Tekla/Speckle.Converter.Tekla2024/TeklaRootToSpeckleConverter.cs b/Converters/Tekla/Speckle.Converter.Tekla2024/TeklaRootToSpeckleConverter.cs index 4ed35ec9..973d030a 100644 --- a/Converters/Tekla/Speckle.Converter.Tekla2024/TeklaRootToSpeckleConverter.cs +++ b/Converters/Tekla/Speckle.Converter.Tekla2024/TeklaRootToSpeckleConverter.cs @@ -41,7 +41,6 @@ public Base Convert(object target) // add tekla specific identifiers result.applicationId = modelObject.Identifier.GUID.ToString(); result["modelObjectID"] = modelObject.Identifier.ID.ToString(); - //TODO: attach properties return result; diff --git a/Converters/Tekla/Speckle.Converter.Tekla2024/ToSpeckle/Raw/BeamRawConverter.cs b/Converters/Tekla/Speckle.Converter.Tekla2024/ToSpeckle/Raw/BeamRawConverter.cs new file mode 100644 index 00000000..98a5185b --- /dev/null +++ b/Converters/Tekla/Speckle.Converter.Tekla2024/ToSpeckle/Raw/BeamRawConverter.cs @@ -0,0 +1,18 @@ +using Speckle.Converters.Common; +using Speckle.Converters.Common.Objects; +using Speckle.Sdk.Models; +using SOG = Speckle.Objects.Geometry; +using TG = Tekla.Structures.Geometry3d; +using Tekla.Structures.Model; + +namespace Speckle.Converter.Tekla2024.ToSpeckle.Raw; + +public class BeamRawConverter: ITypedConverter +{ + private readonly ITypedConverter _pointConverter; + private readonly IConverterSettingsStore _settingsStore; + public Base Convert(Beam target) + { + return new Base() { applicationId = target.Name , properties = target.StartPoint}; + } +} diff --git a/Converters/Tekla/Speckle.Converter.Tekla2024/ToSpeckle/TopLevel/BeamConverter.cs b/Converters/Tekla/Speckle.Converter.Tekla2024/ToSpeckle/TopLevel/BeamConverter.cs new file mode 100644 index 00000000..7c41ac59 --- /dev/null +++ b/Converters/Tekla/Speckle.Converter.Tekla2024/ToSpeckle/TopLevel/BeamConverter.cs @@ -0,0 +1,19 @@ +using Speckle.Converters.Common; +using Speckle.Converters.Common.Objects; +using Speckle.Sdk.Models; +using Tekla.Structures.Model; + +namespace Speckle.Converter.Tekla2024.ToSpeckle; + +[NameAndRankValue(nameof(Beam), NameAndRankValueAttribute.SPECKLE_DEFAULT_RANK)] +public class BeamConverter: IToSpeckleTopLevelConverter +{ + private readonly ITypedConverter _beamConverter; + + public BeamConverter(ITypedConverter beamConverter) + { + _beamConverter = beamConverter; + } + + public Base Convert(object target) => _beamConverter.Convert((Beam)target); +} From e49aebd7e2a6d3a7f626b7721c465509ce3af607 Mon Sep 17 00:00:00 2001 From: Dogukan Karatas Date: Thu, 24 Oct 2024 19:46:59 +0200 Subject: [PATCH 06/29] updates beam converter --- .../ToSpeckle/Raw/BeamRawConverter.cs | 9 +++++++-- .../ToSpeckle/TopLevel/BeamConverter.cs | 13 +++---------- 2 files changed, 10 insertions(+), 12 deletions(-) diff --git a/Converters/Tekla/Speckle.Converter.Tekla2024/ToSpeckle/Raw/BeamRawConverter.cs b/Converters/Tekla/Speckle.Converter.Tekla2024/ToSpeckle/Raw/BeamRawConverter.cs index 98a5185b..b7e1ef6c 100644 --- a/Converters/Tekla/Speckle.Converter.Tekla2024/ToSpeckle/Raw/BeamRawConverter.cs +++ b/Converters/Tekla/Speckle.Converter.Tekla2024/ToSpeckle/Raw/BeamRawConverter.cs @@ -9,10 +9,15 @@ namespace Speckle.Converter.Tekla2024.ToSpeckle.Raw; public class BeamRawConverter: ITypedConverter { - private readonly ITypedConverter _pointConverter; private readonly IConverterSettingsStore _settingsStore; + + public BeamRawConverter(IConverterSettingsStore settingsStore) + { + _settingsStore = settingsStore; + } + public Base Convert(Beam target) { - return new Base() { applicationId = target.Name , properties = target.StartPoint}; + return new Base() { applicationId = target.Name }; } } diff --git a/Converters/Tekla/Speckle.Converter.Tekla2024/ToSpeckle/TopLevel/BeamConverter.cs b/Converters/Tekla/Speckle.Converter.Tekla2024/ToSpeckle/TopLevel/BeamConverter.cs index 7c41ac59..74d0fa60 100644 --- a/Converters/Tekla/Speckle.Converter.Tekla2024/ToSpeckle/TopLevel/BeamConverter.cs +++ b/Converters/Tekla/Speckle.Converter.Tekla2024/ToSpeckle/TopLevel/BeamConverter.cs @@ -3,17 +3,10 @@ using Speckle.Sdk.Models; using Tekla.Structures.Model; -namespace Speckle.Converter.Tekla2024.ToSpeckle; +namespace Speckle.Converter.Tekla2024.ToSpeckle.TopLevel; [NameAndRankValue(nameof(Beam), NameAndRankValueAttribute.SPECKLE_DEFAULT_RANK)] -public class BeamConverter: IToSpeckleTopLevelConverter +public class BeamConverter(ITypedConverter beamConverter) : IToSpeckleTopLevelConverter { - private readonly ITypedConverter _beamConverter; - - public BeamConverter(ITypedConverter beamConverter) - { - _beamConverter = beamConverter; - } - - public Base Convert(object target) => _beamConverter.Convert((Beam)target); + public Base Convert(object target) => beamConverter.Convert((Beam)target); } From bd67a0313129234e0aeff7469699b1f624a60bad Mon Sep 17 00:00:00 2001 From: Dogukan Karatas Date: Thu, 24 Oct 2024 23:22:50 +0200 Subject: [PATCH 07/29] basic info attached --- .../ToSpeckle/Raw/BeamRawConverter.cs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/Converters/Tekla/Speckle.Converter.Tekla2024/ToSpeckle/Raw/BeamRawConverter.cs b/Converters/Tekla/Speckle.Converter.Tekla2024/ToSpeckle/Raw/BeamRawConverter.cs index b7e1ef6c..79de6829 100644 --- a/Converters/Tekla/Speckle.Converter.Tekla2024/ToSpeckle/Raw/BeamRawConverter.cs +++ b/Converters/Tekla/Speckle.Converter.Tekla2024/ToSpeckle/Raw/BeamRawConverter.cs @@ -18,6 +18,14 @@ public BeamRawConverter(IConverterSettingsStore setting public Base Convert(Beam target) { - return new Base() { applicationId = target.Name }; + var beamObject = new Base + { + ["type"] = nameof(Beam), + ["units"] = _settingsStore.Current.SpeckleUnits, + ["profile"] = target.Profile.ProfileString, + ["material"] = target.Material.MaterialString, + }; + + return beamObject; } } From b135f73c61f94dc8ba28c6ca67332df61448cbc8 Mon Sep 17 00:00:00 2001 From: Dogukan Karatas Date: Fri, 25 Oct 2024 10:36:06 +0200 Subject: [PATCH 08/29] creates the mesh from solid --- .../Speckle.Converter.Tekla2024.csproj | 3 + .../ToSpeckle/Raw/BeamRawConverter.cs | 28 ++++++- .../ToSpeckle/Raw/LineToSpeckleConverter.cs | 27 +++++++ .../ToSpeckle/Raw/PointToSpeckleConverter.cs | 19 +++++ .../ToSpeckle/Raw/SolidToSpeckleConverter.cs | 75 +++++++++++++++++++ 5 files changed, 148 insertions(+), 4 deletions(-) create mode 100644 Converters/Tekla/Speckle.Converter.Tekla2024/ToSpeckle/Raw/LineToSpeckleConverter.cs create mode 100644 Converters/Tekla/Speckle.Converter.Tekla2024/ToSpeckle/Raw/PointToSpeckleConverter.cs create mode 100644 Converters/Tekla/Speckle.Converter.Tekla2024/ToSpeckle/Raw/SolidToSpeckleConverter.cs diff --git a/Converters/Tekla/Speckle.Converter.Tekla2024/Speckle.Converter.Tekla2024.csproj b/Converters/Tekla/Speckle.Converter.Tekla2024/Speckle.Converter.Tekla2024.csproj index 33d43d9a..5936d693 100644 --- a/Converters/Tekla/Speckle.Converter.Tekla2024/Speckle.Converter.Tekla2024.csproj +++ b/Converters/Tekla/Speckle.Converter.Tekla2024/Speckle.Converter.Tekla2024.csproj @@ -48,6 +48,9 @@ + + + diff --git a/Converters/Tekla/Speckle.Converter.Tekla2024/ToSpeckle/Raw/BeamRawConverter.cs b/Converters/Tekla/Speckle.Converter.Tekla2024/ToSpeckle/Raw/BeamRawConverter.cs index 79de6829..fd88d1bd 100644 --- a/Converters/Tekla/Speckle.Converter.Tekla2024/ToSpeckle/Raw/BeamRawConverter.cs +++ b/Converters/Tekla/Speckle.Converter.Tekla2024/ToSpeckle/Raw/BeamRawConverter.cs @@ -1,4 +1,5 @@ -using Speckle.Converters.Common; +using System.Collections.Generic; +using Speckle.Converters.Common; using Speckle.Converters.Common.Objects; using Speckle.Sdk.Models; using SOG = Speckle.Objects.Geometry; @@ -10,12 +11,19 @@ namespace Speckle.Converter.Tekla2024.ToSpeckle.Raw; public class BeamRawConverter: ITypedConverter { private readonly IConverterSettingsStore _settingsStore; - - public BeamRawConverter(IConverterSettingsStore settingsStore) + private readonly ITypedConverter _pointConverter; + private readonly ITypedConverter _meshConverter; + + public BeamRawConverter( + IConverterSettingsStore settingsStore, + ITypedConverter pointConverter, + ITypedConverter meshConverter + ) { _settingsStore = settingsStore; + _pointConverter = pointConverter; + _meshConverter = meshConverter; } - public Base Convert(Beam target) { var beamObject = new Base @@ -26,6 +34,18 @@ public Base Convert(Beam target) ["material"] = target.Material.MaterialString, }; + var centerline = new SOG.Line + { + start = _pointConverter.Convert(target.StartPoint), + end = _pointConverter.Convert(target.EndPoint), + units = _settingsStore.Current.SpeckleUnits + }; + + var solid = target.GetSolid(); + var mesh = _meshConverter.Convert(solid); + + beamObject["displayValue"] = new List { centerline, mesh }; + return beamObject; } } diff --git a/Converters/Tekla/Speckle.Converter.Tekla2024/ToSpeckle/Raw/LineToSpeckleConverter.cs b/Converters/Tekla/Speckle.Converter.Tekla2024/ToSpeckle/Raw/LineToSpeckleConverter.cs new file mode 100644 index 00000000..769953f6 --- /dev/null +++ b/Converters/Tekla/Speckle.Converter.Tekla2024/ToSpeckle/Raw/LineToSpeckleConverter.cs @@ -0,0 +1,27 @@ +using Speckle.Converters.Common; +using Speckle.Converters.Common.Objects; +using SOG = Speckle.Objects.Geometry; +using TG = Tekla.Structures.Geometry3d; + +namespace Speckle.Converter.Tekla2024.ToSpeckle.Raw; + +public class TeklaLineConverter : ITypedConverter +{ + private readonly IConverterSettingsStore _settingsStore; + private readonly ITypedConverter _pointConverter; + + public TeklaLineConverter( + IConverterSettingsStore settingsStore, + ITypedConverter pointConverter) + { + _settingsStore = settingsStore; + this._pointConverter = pointConverter; + } + + public SOG.Line Convert(TG.LineSegment target) => new() + { + start = _pointConverter.Convert(target.StartPoint), + end = _pointConverter.Convert(target.EndPoint), + units = _settingsStore.Current.SpeckleUnits + }; +} diff --git a/Converters/Tekla/Speckle.Converter.Tekla2024/ToSpeckle/Raw/PointToSpeckleConverter.cs b/Converters/Tekla/Speckle.Converter.Tekla2024/ToSpeckle/Raw/PointToSpeckleConverter.cs new file mode 100644 index 00000000..d40ef3ff --- /dev/null +++ b/Converters/Tekla/Speckle.Converter.Tekla2024/ToSpeckle/Raw/PointToSpeckleConverter.cs @@ -0,0 +1,19 @@ +using Speckle.Converters.Common; +using Speckle.Converters.Common.Objects; +using SOG = Speckle.Objects.Geometry; +using TG = Tekla.Structures.Geometry3d; + +namespace Speckle.Converter.Tekla2024.ToSpeckle.Raw; + +public class TeklaPointConverter : ITypedConverter +{ + private readonly IConverterSettingsStore _settingsStore; + + public TeklaPointConverter(IConverterSettingsStore settingsStore) + { + _settingsStore = settingsStore; + } + + public SOG.Point Convert(TG.Point target) => + new SOG.Point(target.X, target.Y, target.Z, _settingsStore.Current.SpeckleUnits); +} diff --git a/Converters/Tekla/Speckle.Converter.Tekla2024/ToSpeckle/Raw/SolidToSpeckleConverter.cs b/Converters/Tekla/Speckle.Converter.Tekla2024/ToSpeckle/Raw/SolidToSpeckleConverter.cs new file mode 100644 index 00000000..681e1f83 --- /dev/null +++ b/Converters/Tekla/Speckle.Converter.Tekla2024/ToSpeckle/Raw/SolidToSpeckleConverter.cs @@ -0,0 +1,75 @@ +using Speckle.Converters.Common; +using Speckle.Converters.Common.Objects; +using SOG = Speckle.Objects.Geometry; +using TG = Tekla.Structures.Geometry3d; +using TSM = Tekla.Structures.Model; +using System.Collections.Generic; +using System.Linq; + +namespace Speckle.Converter.Tekla2024.ToSpeckle.Raw; + +public class TeklaMeshConverter : ITypedConverter +{ + private readonly IConverterSettingsStore _settingsStore; + private readonly ITypedConverter _pointConverter; + + public TeklaMeshConverter( + IConverterSettingsStore settingsStore, + ITypedConverter pointConverter) + { + _settingsStore = settingsStore; + _pointConverter = pointConverter; + } + + public SOG.Mesh Convert(TSM.Solid target) + { + var faceEnum = target.GetFaceEnumerator(); + List vertices = new(); + List faces = new(); + + while (faceEnum.MoveNext()) + { + if (faceEnum.Current is not null) + { + var face = faceEnum.Current; + var loopEnum = face.GetLoopEnumerator(); + + while (loopEnum.MoveNext()) + { + if (loopEnum.Current is not null) + { + var loop = loopEnum.Current; + var vertexEnum = loop.GetVertexEnumerator(); + List faceIndices = new(); + + while (vertexEnum.MoveNext()) + { + if (vertexEnum.Current is TG.Point vertex) + { + var specklePoint = _pointConverter.Convert(vertex); + int vertexIndex = vertices.Count; + vertices.Add(specklePoint); + faceIndices.Add(vertexIndex); + } + } + + // Triangulate face (assuming convex faces) + for (int i = 1; i < faceIndices.Count - 1; i++) + { + faces.Add(faceIndices[0]); + faces.Add(faceIndices[i]); + faces.Add(faceIndices[i + 1]); + } + } + } + } + } + + return new SOG.Mesh + { + vertices = vertices.SelectMany(p => new[] { p.x, p.y, p.z }).ToList(), + faces = faces, + units = _settingsStore.Current.SpeckleUnits + }; + } +} From a204c6e5570ed0679b33f96f94d8962c81973927 Mon Sep 17 00:00:00 2001 From: Dogukan Karatas Date: Fri, 25 Oct 2024 12:54:27 +0200 Subject: [PATCH 09/29] updates the mesh converter --- .../ToSpeckle/Raw/BeamRawConverter.cs | 9 +- .../ToSpeckle/Raw/SolidToSpeckleConverter.cs | 122 ++++++++++-------- 2 files changed, 67 insertions(+), 64 deletions(-) diff --git a/Converters/Tekla/Speckle.Converter.Tekla2024/ToSpeckle/Raw/BeamRawConverter.cs b/Converters/Tekla/Speckle.Converter.Tekla2024/ToSpeckle/Raw/BeamRawConverter.cs index fd88d1bd..59329d9f 100644 --- a/Converters/Tekla/Speckle.Converter.Tekla2024/ToSpeckle/Raw/BeamRawConverter.cs +++ b/Converters/Tekla/Speckle.Converter.Tekla2024/ToSpeckle/Raw/BeamRawConverter.cs @@ -33,18 +33,11 @@ public Base Convert(Beam target) ["profile"] = target.Profile.ProfileString, ["material"] = target.Material.MaterialString, }; - - var centerline = new SOG.Line - { - start = _pointConverter.Convert(target.StartPoint), - end = _pointConverter.Convert(target.EndPoint), - units = _settingsStore.Current.SpeckleUnits - }; var solid = target.GetSolid(); var mesh = _meshConverter.Convert(solid); - beamObject["displayValue"] = new List { centerline, mesh }; + beamObject["displayValue"] = new List { mesh }; return beamObject; } diff --git a/Converters/Tekla/Speckle.Converter.Tekla2024/ToSpeckle/Raw/SolidToSpeckleConverter.cs b/Converters/Tekla/Speckle.Converter.Tekla2024/ToSpeckle/Raw/SolidToSpeckleConverter.cs index 681e1f83..50a71a65 100644 --- a/Converters/Tekla/Speckle.Converter.Tekla2024/ToSpeckle/Raw/SolidToSpeckleConverter.cs +++ b/Converters/Tekla/Speckle.Converter.Tekla2024/ToSpeckle/Raw/SolidToSpeckleConverter.cs @@ -1,75 +1,85 @@ -using Speckle.Converters.Common; +using System.Collections.Generic; +using Speckle.Converters.Common; using Speckle.Converters.Common.Objects; using SOG = Speckle.Objects.Geometry; using TG = Tekla.Structures.Geometry3d; using TSM = Tekla.Structures.Model; -using System.Collections.Generic; -using System.Linq; namespace Speckle.Converter.Tekla2024.ToSpeckle.Raw; public class TeklaMeshConverter : ITypedConverter { - private readonly IConverterSettingsStore _settingsStore; - private readonly ITypedConverter _pointConverter; + private readonly IConverterSettingsStore _settingsStore; - public TeklaMeshConverter( - IConverterSettingsStore settingsStore, - ITypedConverter pointConverter) - { - _settingsStore = settingsStore; - _pointConverter = pointConverter; - } + public TeklaMeshConverter(IConverterSettingsStore settingsStore) + { + _settingsStore = settingsStore; + } - public SOG.Mesh Convert(TSM.Solid target) - { - var faceEnum = target.GetFaceEnumerator(); - List vertices = new(); - List faces = new(); + public SOG.Mesh Convert(TSM.Solid target) + { + var faceEnum = target.GetFaceEnumerator(); + List vertices = new List(); + List faces = new List(); + Dictionary uniqueVertices = new Dictionary(); + int currentIndex = 0; - while (faceEnum.MoveNext()) - { - if (faceEnum.Current is not null) - { - var face = faceEnum.Current; - var loopEnum = face.GetLoopEnumerator(); + while (faceEnum.MoveNext()) + { + var face = faceEnum.Current; + if (face == null) continue; - while (loopEnum.MoveNext()) - { - if (loopEnum.Current is not null) - { - var loop = loopEnum.Current; - var vertexEnum = loop.GetVertexEnumerator(); - List faceIndices = new(); + var loopEnum = face.GetLoopEnumerator(); + if (!loopEnum.MoveNext()) continue; + + var loop = loopEnum.Current; + if (loop == null) continue; - while (vertexEnum.MoveNext()) - { - if (vertexEnum.Current is TG.Point vertex) - { - var specklePoint = _pointConverter.Convert(vertex); - int vertexIndex = vertices.Count; - vertices.Add(specklePoint); - faceIndices.Add(vertexIndex); - } - } + // Get the four corners of each rectangular face + var corners = new List(); + var vertexEnum = loop.GetVertexEnumerator(); + + while (vertexEnum.MoveNext()) + { + var vertex = vertexEnum.Current as TG.Point; + if (vertex == null) continue; - // Triangulate face (assuming convex faces) - for (int i = 1; i < faceIndices.Count - 1; i++) - { - faces.Add(faceIndices[0]); - faces.Add(faceIndices[i]); - faces.Add(faceIndices[i + 1]); - } - } - } - } + string vertexKey = $"{vertex.X:F8},{vertex.Y:F8},{vertex.Z:F8}"; + + if (!uniqueVertices.ContainsKey(vertexKey)) + { + uniqueVertices[vertexKey] = currentIndex++; + vertices.Add(vertex.X); + vertices.Add(vertex.Y); + vertices.Add(vertex.Z); } + + corners.Add(uniqueVertices[vertexKey]); + } - return new SOG.Mesh - { - vertices = vertices.SelectMany(p => new[] { p.x, p.y, p.z }).ToList(), - faces = faces, - units = _settingsStore.Current.SpeckleUnits - }; + // Only process rectangular faces (4 corners) + if (corners.Count == 4) + { + // Create two triangles for the rectangle + // Triangle 1: 0-1-2 + faces.Add(3); + faces.Add(corners[0]); // First corner + faces.Add(corners[1]); // Second corner + faces.Add(corners[2]); // Third corner + + // Triangle 2: 0-2-3 + faces.Add(3); + faces.Add(corners[0]); // First corner + faces.Add(corners[2]); // Third corner + faces.Add(corners[3]); // Fourth corner + } } + + return new SOG.Mesh + { + vertices = vertices, + faces = faces, + units = _settingsStore.Current.SpeckleUnits + }; + } } From 78178e9f053b80d19d3e798463ecc213ea2d2a20 Mon Sep 17 00:00:00 2001 From: Dogukan Karatas Date: Fri, 25 Oct 2024 15:38:11 +0200 Subject: [PATCH 10/29] attachs colors to mesh --- .../ToSpeckle/Raw/BeamRawConverter.cs | 22 +++++++++++++++++-- .../ToSpeckle/Raw/SolidToSpeckleConverter.cs | 19 ++++++---------- 2 files changed, 27 insertions(+), 14 deletions(-) diff --git a/Converters/Tekla/Speckle.Converter.Tekla2024/ToSpeckle/Raw/BeamRawConverter.cs b/Converters/Tekla/Speckle.Converter.Tekla2024/ToSpeckle/Raw/BeamRawConverter.cs index 59329d9f..97546548 100644 --- a/Converters/Tekla/Speckle.Converter.Tekla2024/ToSpeckle/Raw/BeamRawConverter.cs +++ b/Converters/Tekla/Speckle.Converter.Tekla2024/ToSpeckle/Raw/BeamRawConverter.cs @@ -2,9 +2,10 @@ using Speckle.Converters.Common; using Speckle.Converters.Common.Objects; using Speckle.Sdk.Models; +using Tekla.Structures.Model; +using Tekla.Structures.Model.UI; using SOG = Speckle.Objects.Geometry; using TG = Tekla.Structures.Geometry3d; -using Tekla.Structures.Model; namespace Speckle.Converter.Tekla2024.ToSpeckle.Raw; @@ -18,12 +19,13 @@ public BeamRawConverter( IConverterSettingsStore settingsStore, ITypedConverter pointConverter, ITypedConverter meshConverter - ) + ) { _settingsStore = settingsStore; _pointConverter = pointConverter; _meshConverter = meshConverter; } + public Base Convert(Beam target) { var beamObject = new Base @@ -36,6 +38,22 @@ public Base Convert(Beam target) var solid = target.GetSolid(); var mesh = _meshConverter.Convert(solid); + + var color = new Color(); + ModelObjectVisualization.GetRepresentation(target, ref color); + + int r = (int)(color.Red * 255); + int g = (int)(color.Green * 255); + int b = (int)(color.Blue * 255); + int argb = (255 << 24) | (r << 16) | (g << 8) | b; + + int vertexCount = mesh.vertices.Count / 3; + + mesh.colors = new List(vertexCount); + for (int i = 0; i < vertexCount; i++) + { + mesh.colors.Add(argb); + } beamObject["displayValue"] = new List { mesh }; diff --git a/Converters/Tekla/Speckle.Converter.Tekla2024/ToSpeckle/Raw/SolidToSpeckleConverter.cs b/Converters/Tekla/Speckle.Converter.Tekla2024/ToSpeckle/Raw/SolidToSpeckleConverter.cs index 50a71a65..ea16dd70 100644 --- a/Converters/Tekla/Speckle.Converter.Tekla2024/ToSpeckle/Raw/SolidToSpeckleConverter.cs +++ b/Converters/Tekla/Speckle.Converter.Tekla2024/ToSpeckle/Raw/SolidToSpeckleConverter.cs @@ -35,7 +35,6 @@ public SOG.Mesh Convert(TSM.Solid target) var loop = loopEnum.Current; if (loop == null) continue; - // Get the four corners of each rectangular face var corners = new List(); var vertexEnum = loop.GetVertexEnumerator(); @@ -57,21 +56,17 @@ public SOG.Mesh Convert(TSM.Solid target) corners.Add(uniqueVertices[vertexKey]); } - // Only process rectangular faces (4 corners) if (corners.Count == 4) { - // Create two triangles for the rectangle - // Triangle 1: 0-1-2 faces.Add(3); - faces.Add(corners[0]); // First corner - faces.Add(corners[1]); // Second corner - faces.Add(corners[2]); // Third corner - - // Triangle 2: 0-2-3 + faces.Add(corners[0]); + faces.Add(corners[1]); + faces.Add(corners[2]); + faces.Add(3); - faces.Add(corners[0]); // First corner - faces.Add(corners[2]); // Third corner - faces.Add(corners[3]); // Fourth corner + faces.Add(corners[0]); + faces.Add(corners[2]); + faces.Add(corners[3]); } } From 0e62bd8c3d5e596df195707e1a20367bed55dd8b Mon Sep 17 00:00:00 2001 From: Dogukan Karatas Date: Fri, 25 Oct 2024 15:43:33 +0200 Subject: [PATCH 11/29] updates formatting --- .../ToSpeckle/Raw/BeamRawConverter.cs | 14 +++++----- .../ToSpeckle/Raw/LineToSpeckleConverter.cs | 18 +++++++------ .../ToSpeckle/Raw/PointToSpeckleConverter.cs | 4 +-- .../ToSpeckle/Raw/SolidToSpeckleConverter.cs | 26 +++++++++++-------- .../ToSpeckle/TopLevel/BeamConverter.cs | 4 +-- 5 files changed, 36 insertions(+), 30 deletions(-) diff --git a/Converters/Tekla/Speckle.Converter.Tekla2024/ToSpeckle/Raw/BeamRawConverter.cs b/Converters/Tekla/Speckle.Converter.Tekla2024/ToSpeckle/Raw/BeamRawConverter.cs index 97546548..41330364 100644 --- a/Converters/Tekla/Speckle.Converter.Tekla2024/ToSpeckle/Raw/BeamRawConverter.cs +++ b/Converters/Tekla/Speckle.Converter.Tekla2024/ToSpeckle/Raw/BeamRawConverter.cs @@ -1,4 +1,4 @@ -using System.Collections.Generic; +using System.Collections.Generic; using Speckle.Converters.Common; using Speckle.Converters.Common.Objects; using Speckle.Sdk.Models; @@ -9,14 +9,14 @@ namespace Speckle.Converter.Tekla2024.ToSpeckle.Raw; -public class BeamRawConverter: ITypedConverter +public class BeamRawConverter : ITypedConverter { private readonly IConverterSettingsStore _settingsStore; private readonly ITypedConverter _pointConverter; private readonly ITypedConverter _meshConverter; - + public BeamRawConverter( - IConverterSettingsStore settingsStore, + IConverterSettingsStore settingsStore, ITypedConverter pointConverter, ITypedConverter meshConverter ) @@ -48,15 +48,15 @@ public Base Convert(Beam target) int argb = (255 << 24) | (r << 16) | (g << 8) | b; int vertexCount = mesh.vertices.Count / 3; - + mesh.colors = new List(vertexCount); for (int i = 0; i < vertexCount; i++) { mesh.colors.Add(argb); } - + beamObject["displayValue"] = new List { mesh }; - + return beamObject; } } diff --git a/Converters/Tekla/Speckle.Converter.Tekla2024/ToSpeckle/Raw/LineToSpeckleConverter.cs b/Converters/Tekla/Speckle.Converter.Tekla2024/ToSpeckle/Raw/LineToSpeckleConverter.cs index 769953f6..2a70cfa6 100644 --- a/Converters/Tekla/Speckle.Converter.Tekla2024/ToSpeckle/Raw/LineToSpeckleConverter.cs +++ b/Converters/Tekla/Speckle.Converter.Tekla2024/ToSpeckle/Raw/LineToSpeckleConverter.cs @@ -1,4 +1,4 @@ -using Speckle.Converters.Common; +using Speckle.Converters.Common; using Speckle.Converters.Common.Objects; using SOG = Speckle.Objects.Geometry; using TG = Tekla.Structures.Geometry3d; @@ -12,16 +12,18 @@ public class TeklaLineConverter : ITypedConverter public TeklaLineConverter( IConverterSettingsStore settingsStore, - ITypedConverter pointConverter) + ITypedConverter pointConverter + ) { _settingsStore = settingsStore; this._pointConverter = pointConverter; } - public SOG.Line Convert(TG.LineSegment target) => new() - { - start = _pointConverter.Convert(target.StartPoint), - end = _pointConverter.Convert(target.EndPoint), - units = _settingsStore.Current.SpeckleUnits - }; + public SOG.Line Convert(TG.LineSegment target) => + new() + { + start = _pointConverter.Convert(target.StartPoint), + end = _pointConverter.Convert(target.EndPoint), + units = _settingsStore.Current.SpeckleUnits + }; } diff --git a/Converters/Tekla/Speckle.Converter.Tekla2024/ToSpeckle/Raw/PointToSpeckleConverter.cs b/Converters/Tekla/Speckle.Converter.Tekla2024/ToSpeckle/Raw/PointToSpeckleConverter.cs index d40ef3ff..d11628ec 100644 --- a/Converters/Tekla/Speckle.Converter.Tekla2024/ToSpeckle/Raw/PointToSpeckleConverter.cs +++ b/Converters/Tekla/Speckle.Converter.Tekla2024/ToSpeckle/Raw/PointToSpeckleConverter.cs @@ -1,4 +1,4 @@ -using Speckle.Converters.Common; +using Speckle.Converters.Common; using Speckle.Converters.Common.Objects; using SOG = Speckle.Objects.Geometry; using TG = Tekla.Structures.Geometry3d; @@ -14,6 +14,6 @@ public TeklaPointConverter(IConverterSettingsStore sett _settingsStore = settingsStore; } - public SOG.Point Convert(TG.Point target) => + public SOG.Point Convert(TG.Point target) => new SOG.Point(target.X, target.Y, target.Z, _settingsStore.Current.SpeckleUnits); } diff --git a/Converters/Tekla/Speckle.Converter.Tekla2024/ToSpeckle/Raw/SolidToSpeckleConverter.cs b/Converters/Tekla/Speckle.Converter.Tekla2024/ToSpeckle/Raw/SolidToSpeckleConverter.cs index ea16dd70..25ccf341 100644 --- a/Converters/Tekla/Speckle.Converter.Tekla2024/ToSpeckle/Raw/SolidToSpeckleConverter.cs +++ b/Converters/Tekla/Speckle.Converter.Tekla2024/ToSpeckle/Raw/SolidToSpeckleConverter.cs @@ -1,4 +1,4 @@ -using System.Collections.Generic; +using System.Collections.Generic; using Speckle.Converters.Common; using Speckle.Converters.Common.Objects; using SOG = Speckle.Objects.Geometry; @@ -7,7 +7,7 @@ namespace Speckle.Converter.Tekla2024.ToSpeckle.Raw; -public class TeklaMeshConverter : ITypedConverter +public class TeklaMeshConverter : ITypedConverter { private readonly IConverterSettingsStore _settingsStore; @@ -27,24 +27,28 @@ public SOG.Mesh Convert(TSM.Solid target) while (faceEnum.MoveNext()) { var face = faceEnum.Current; - if (face == null) continue; + if (face == null) + continue; var loopEnum = face.GetLoopEnumerator(); - if (!loopEnum.MoveNext()) continue; - + if (!loopEnum.MoveNext()) + continue; + var loop = loopEnum.Current; - if (loop == null) continue; + if (loop == null) + continue; var corners = new List(); var vertexEnum = loop.GetVertexEnumerator(); - + while (vertexEnum.MoveNext()) { var vertex = vertexEnum.Current as TG.Point; - if (vertex == null) continue; + if (vertex == null) + continue; string vertexKey = $"{vertex.X:F8},{vertex.Y:F8},{vertex.Z:F8}"; - + if (!uniqueVertices.ContainsKey(vertexKey)) { uniqueVertices[vertexKey] = currentIndex++; @@ -52,7 +56,7 @@ public SOG.Mesh Convert(TSM.Solid target) vertices.Add(vertex.Y); vertices.Add(vertex.Z); } - + corners.Add(uniqueVertices[vertexKey]); } @@ -62,7 +66,7 @@ public SOG.Mesh Convert(TSM.Solid target) faces.Add(corners[0]); faces.Add(corners[1]); faces.Add(corners[2]); - + faces.Add(3); faces.Add(corners[0]); faces.Add(corners[2]); diff --git a/Converters/Tekla/Speckle.Converter.Tekla2024/ToSpeckle/TopLevel/BeamConverter.cs b/Converters/Tekla/Speckle.Converter.Tekla2024/ToSpeckle/TopLevel/BeamConverter.cs index 74d0fa60..ea2243f8 100644 --- a/Converters/Tekla/Speckle.Converter.Tekla2024/ToSpeckle/TopLevel/BeamConverter.cs +++ b/Converters/Tekla/Speckle.Converter.Tekla2024/ToSpeckle/TopLevel/BeamConverter.cs @@ -1,4 +1,4 @@ -using Speckle.Converters.Common; +using Speckle.Converters.Common; using Speckle.Converters.Common.Objects; using Speckle.Sdk.Models; using Tekla.Structures.Model; @@ -8,5 +8,5 @@ namespace Speckle.Converter.Tekla2024.ToSpeckle.TopLevel; [NameAndRankValue(nameof(Beam), NameAndRankValueAttribute.SPECKLE_DEFAULT_RANK)] public class BeamConverter(ITypedConverter beamConverter) : IToSpeckleTopLevelConverter { - public Base Convert(object target) => beamConverter.Convert((Beam)target); + public Base Convert(object target) => beamConverter.Convert((Beam)target); } From 6028e433408c237b67611fa7e1ac8e78a683a4cd Mon Sep 17 00:00:00 2001 From: Dogukan Karatas Date: Fri, 25 Oct 2024 15:47:52 +0200 Subject: [PATCH 12/29] updates formatting again --- .../Speckle.Converter.Tekla2024/TeklaConversionSettings.cs | 2 +- .../TeklaConversionSettingsFactory.cs | 2 +- .../Speckle.Converter.Tekla2024/TeklaToSpeckleUnitConverter.cs | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Converters/Tekla/Speckle.Converter.Tekla2024/TeklaConversionSettings.cs b/Converters/Tekla/Speckle.Converter.Tekla2024/TeklaConversionSettings.cs index 96b1926f..c2e45b95 100644 --- a/Converters/Tekla/Speckle.Converter.Tekla2024/TeklaConversionSettings.cs +++ b/Converters/Tekla/Speckle.Converter.Tekla2024/TeklaConversionSettings.cs @@ -2,4 +2,4 @@ namespace Speckle.Converter.Tekla2024; -public record TeklaConversionSettings(Model Document, string SpeckleUnits); \ No newline at end of file +public record TeklaConversionSettings(Model Document, string SpeckleUnits); diff --git a/Converters/Tekla/Speckle.Converter.Tekla2024/TeklaConversionSettingsFactory.cs b/Converters/Tekla/Speckle.Converter.Tekla2024/TeklaConversionSettingsFactory.cs index 17a97f38..fcf07162 100644 --- a/Converters/Tekla/Speckle.Converter.Tekla2024/TeklaConversionSettingsFactory.cs +++ b/Converters/Tekla/Speckle.Converter.Tekla2024/TeklaConversionSettingsFactory.cs @@ -16,4 +16,4 @@ IConverterSettingsStore settingsStore // only handles automatic rn public TeklaConversionSettings Create(Model document) => new(document, unitsConverter.ConvertOrThrow(TSD.Units.Automatic)); -} \ No newline at end of file +} diff --git a/Converters/Tekla/Speckle.Converter.Tekla2024/TeklaToSpeckleUnitConverter.cs b/Converters/Tekla/Speckle.Converter.Tekla2024/TeklaToSpeckleUnitConverter.cs index 7431bc89..86945e65 100644 --- a/Converters/Tekla/Speckle.Converter.Tekla2024/TeklaToSpeckleUnitConverter.cs +++ b/Converters/Tekla/Speckle.Converter.Tekla2024/TeklaToSpeckleUnitConverter.cs @@ -1,8 +1,8 @@ +using System.Collections.Generic; using Speckle.Converters.Common; using Speckle.Sdk.Common.Exceptions; using SSC = Speckle.Sdk.Common; using TSD = Tekla.Structures.Drawing; -using System.Collections.Generic; namespace Speckle.Converter.Tekla2024; From f042e54a01d968f19292766d56bd9f0c60518f0a Mon Sep 17 00:00:00 2001 From: Dogukan Karatas Date: Fri, 25 Oct 2024 15:50:35 +0200 Subject: [PATCH 13/29] updates assemblyinfo --- .../Properties/AssemblyInfo.cs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Converters/Tekla/Speckle.Converter.Tekla2024/Properties/AssemblyInfo.cs b/Converters/Tekla/Speckle.Converter.Tekla2024/Properties/AssemblyInfo.cs index 026e5924..b66c47af 100644 --- a/Converters/Tekla/Speckle.Converter.Tekla2024/Properties/AssemblyInfo.cs +++ b/Converters/Tekla/Speckle.Converter.Tekla2024/Properties/AssemblyInfo.cs @@ -1,7 +1,7 @@ -using System.Reflection; +using System.Reflection; using System.Runtime.InteropServices; -// General Information about an assembly is controlled through the following +// General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information // associated with an assembly. [assembly: AssemblyTitle("Speckle.Converter.Tekla2024")] @@ -13,8 +13,8 @@ [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from // COM, set the ComVisible attribute to true on that type. [assembly: ComVisible(false)] @@ -24,11 +24,11 @@ // Version information for an assembly consists of the following four values: // // Major Version -// Minor Version +// Minor Version // Build Number // Revision // -// You can specify all the values or you can default the Build and Revision Numbers +// You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyVersion("1.0.0.0")] From ac0820dc6babca2f8799bdb03c630a7e34b04837 Mon Sep 17 00:00:00 2001 From: Dogukan Karatas Date: Fri, 25 Oct 2024 16:11:42 +0200 Subject: [PATCH 14/29] clean locks --- .../packages.lock.json | 28 ------------------- 1 file changed, 28 deletions(-) diff --git a/Converters/Tekla/Speckle.Converter.Tekla2024/packages.lock.json b/Converters/Tekla/Speckle.Converter.Tekla2024/packages.lock.json index ed13d2bd..f3c55e98 100644 --- a/Converters/Tekla/Speckle.Converter.Tekla2024/packages.lock.json +++ b/Converters/Tekla/Speckle.Converter.Tekla2024/packages.lock.json @@ -411,34 +411,6 @@ "Trimble.Remoting": "1.0.2" } } - }, - ".NETFramework,Version=v4.8/win": { - "SQLitePCLRaw.lib.e_sqlite3": { - "type": "Transitive", - "resolved": "2.1.4", - "contentHash": "2C9Q9eX7CPLveJA0rIhf9RXAvu+7nWZu1A2MdG6SD/NOu26TakGgL1nsbc0JAspGijFOo3HoN79xrx8a368fBg==" - } - }, - ".NETFramework,Version=v4.8/win-arm64": { - "SQLitePCLRaw.lib.e_sqlite3": { - "type": "Transitive", - "resolved": "2.1.4", - "contentHash": "2C9Q9eX7CPLveJA0rIhf9RXAvu+7nWZu1A2MdG6SD/NOu26TakGgL1nsbc0JAspGijFOo3HoN79xrx8a368fBg==" - } - }, - ".NETFramework,Version=v4.8/win-x64": { - "SQLitePCLRaw.lib.e_sqlite3": { - "type": "Transitive", - "resolved": "2.1.4", - "contentHash": "2C9Q9eX7CPLveJA0rIhf9RXAvu+7nWZu1A2MdG6SD/NOu26TakGgL1nsbc0JAspGijFOo3HoN79xrx8a368fBg==" - } - }, - ".NETFramework,Version=v4.8/win-x86": { - "SQLitePCLRaw.lib.e_sqlite3": { - "type": "Transitive", - "resolved": "2.1.4", - "contentHash": "2C9Q9eX7CPLveJA0rIhf9RXAvu+7nWZu1A2MdG6SD/NOu26TakGgL1nsbc0JAspGijFOo3HoN79xrx8a368fBg==" - } } } } \ No newline at end of file From 81398d4c3aff7065075f2f77d47d0e7cda4269f1 Mon Sep 17 00:00:00 2001 From: Dogukan Karatas Date: Fri, 25 Oct 2024 17:07:18 +0200 Subject: [PATCH 15/29] Merge branch 'dogukan/cnx-646-set-up-tekla-converter-project' of https://github.com/specklesystems/speckle-sharp-connectors into dogukan/cnx-646-set-up-tekla-converter-project --- .../packages.lock.json | 2 +- .../Civil3dRootToSpeckleConverter.cs | 2 +- .../Helpers/DisplayValueExtractor.cs | 39 +++++++++++++ .../CivilEntityToSpeckleTopLevelConverter.cs | 3 +- .../RevitRootToSpeckleConverter.cs | 2 +- .../FallbackToHostTopLevelConverter.cs | 6 +- .../packages.lock.json | 55 +++++++++---------- .../Registration/ConverterManager.cs | 2 +- .../Registration/IConverterManager.cs | 4 +- 9 files changed, 77 insertions(+), 38 deletions(-) diff --git a/Connectors/Tekla/Speckle.Connector.Tekla2024/packages.lock.json b/Connectors/Tekla/Speckle.Connector.Tekla2024/packages.lock.json index 1c8a9fd6..bae46900 100644 --- a/Connectors/Tekla/Speckle.Connector.Tekla2024/packages.lock.json +++ b/Connectors/Tekla/Speckle.Connector.Tekla2024/packages.lock.json @@ -442,7 +442,7 @@ "type": "Project", "dependencies": { "Microsoft.Extensions.Logging.Abstractions": "[2.2.0, )", - "Speckle.Objects": "[3.1.0-dev.164, )" + "Speckle.Objects": "[3.1.0-dev.167, )" } }, "Microsoft.Extensions.DependencyInjection": { diff --git a/Converters/Civil3d/Speckle.Converters.Civil3dShared/Civil3dRootToSpeckleConverter.cs b/Converters/Civil3d/Speckle.Converters.Civil3dShared/Civil3dRootToSpeckleConverter.cs index e6b8c554..a0d0430a 100644 --- a/Converters/Civil3d/Speckle.Converters.Civil3dShared/Civil3dRootToSpeckleConverter.cs +++ b/Converters/Civil3d/Speckle.Converters.Civil3dShared/Civil3dRootToSpeckleConverter.cs @@ -55,7 +55,7 @@ public Base Convert(object target) properties = GetCivilEntityProperties(civilEntity); } - var objectConverter = _toSpeckle.ResolveConverter(type, true); + var objectConverter = _toSpeckle.ResolveConverter(type); try { diff --git a/Converters/Civil3d/Speckle.Converters.Civil3dShared/Helpers/DisplayValueExtractor.cs b/Converters/Civil3d/Speckle.Converters.Civil3dShared/Helpers/DisplayValueExtractor.cs index af1c6ae2..2c3c2ebf 100644 --- a/Converters/Civil3d/Speckle.Converters.Civil3dShared/Helpers/DisplayValueExtractor.cs +++ b/Converters/Civil3d/Speckle.Converters.Civil3dShared/Helpers/DisplayValueExtractor.cs @@ -1,6 +1,7 @@ using Microsoft.Extensions.Logging; using Speckle.Converters.Common; using Speckle.Converters.Common.Objects; +using Speckle.Objects; using Speckle.Sdk.Models; namespace Speckle.Converters.Civil3dShared.Helpers; @@ -63,4 +64,42 @@ IConverterSettingsStore converterSettings return null; } } + + /// + /// Processes a list of ICurves for suitable display value curves. + /// + /// + /// + /// List of simple curves: lines, polylines, and arcs. + /// Null if no suitable display curves were found. + /// + public List? ProcessICurvesForDisplay(List? iCurves) + { + if (iCurves is null) + { + return null; + } + + List result = new(); + foreach (ICurve curve in iCurves) + { + switch (curve) + { + case SOG.Line: + case SOG.Polyline: + case SOG.Arc: + result.Add((Base)curve); + break; + case SOG.Polycurve polycurve: + List? processedSegments = ProcessICurvesForDisplay(polycurve.segments); + if (processedSegments is not null) + { + result.AddRange(processedSegments); + } + break; + } + } + + return result.Count > 0 ? result : null; + } } diff --git a/Converters/Civil3d/Speckle.Converters.Civil3dShared/ToSpeckle/BuiltElements/CivilEntityToSpeckleTopLevelConverter.cs b/Converters/Civil3d/Speckle.Converters.Civil3dShared/ToSpeckle/BuiltElements/CivilEntityToSpeckleTopLevelConverter.cs index 5f190690..02df1472 100644 --- a/Converters/Civil3d/Speckle.Converters.Civil3dShared/ToSpeckle/BuiltElements/CivilEntityToSpeckleTopLevelConverter.cs +++ b/Converters/Civil3d/Speckle.Converters.Civil3dShared/ToSpeckle/BuiltElements/CivilEntityToSpeckleTopLevelConverter.cs @@ -61,7 +61,8 @@ public Base Convert(CDB.Entity target) // extract display value. // If object has no display but has basecurves, use basecurves for display instead (for viewer selection) - List? display = _displayValueExtractor.GetDisplayValue(target) ?? baseCurves?.Select(o => (Base)o).ToList(); + List? display = + _displayValueExtractor.GetDisplayValue(target) ?? _displayValueExtractor.ProcessICurvesForDisplay(baseCurves); if (display is not null) { civilObject["displayValue"] = display; diff --git a/Converters/Revit/Speckle.Converters.RevitShared/RevitRootToSpeckleConverter.cs b/Converters/Revit/Speckle.Converters.RevitShared/RevitRootToSpeckleConverter.cs index a29910a2..cc112060 100644 --- a/Converters/Revit/Speckle.Converters.RevitShared/RevitRootToSpeckleConverter.cs +++ b/Converters/Revit/Speckle.Converters.RevitShared/RevitRootToSpeckleConverter.cs @@ -43,7 +43,7 @@ public Base Convert(object target) throw new ValidationException($"Target object is not a db element, it's a {target.GetType()}"); } - var objectConverter = _toSpeckle.ResolveConverter(target.GetType(), true); + var objectConverter = _toSpeckle.ResolveConverter(target.GetType()); Base result = objectConverter.Convert(target); diff --git a/Converters/Rhino/Speckle.Converters.RhinoShared/ToHost/TopLevel/FallbackToHostTopLevelConverter.cs b/Converters/Rhino/Speckle.Converters.RhinoShared/ToHost/TopLevel/FallbackToHostTopLevelConverter.cs index 3fd7a910..24beb37a 100644 --- a/Converters/Rhino/Speckle.Converters.RhinoShared/ToHost/TopLevel/FallbackToHostTopLevelConverter.cs +++ b/Converters/Rhino/Speckle.Converters.RhinoShared/ToHost/TopLevel/FallbackToHostTopLevelConverter.cs @@ -1,4 +1,4 @@ -using Speckle.Converters.Common; +using Speckle.Converters.Common; using Speckle.Converters.Common.Objects; using Speckle.Sdk.Common; using Speckle.Sdk.Common.Exceptions; @@ -14,6 +14,7 @@ public class FallbackToHostTopLevelConverter private readonly ITypedConverter _pointConverter; private readonly ITypedConverter _lineConverter; private readonly ITypedConverter _polylineConverter; + private readonly ITypedConverter _arcConverter; private readonly ITypedConverter _meshConverter; private readonly IConverterSettingsStore _settingsStore; @@ -21,6 +22,7 @@ public FallbackToHostTopLevelConverter( ITypedConverter pointConverter, ITypedConverter lineConverter, ITypedConverter polylineConverter, + ITypedConverter arcConverter, ITypedConverter meshConverter, IConverterSettingsStore settingsStore ) @@ -28,6 +30,7 @@ IConverterSettingsStore settingsStore _pointConverter = pointConverter; _lineConverter = lineConverter; _polylineConverter = polylineConverter; + _arcConverter = arcConverter; _meshConverter = meshConverter; _settingsStore = settingsStore; } @@ -43,6 +46,7 @@ IConverterSettingsStore settingsStore { SOG.Line line => _lineConverter.Convert(line), SOG.Polyline polyline => _polylineConverter.Convert(polyline), + SOG.Arc arc => _arcConverter.Convert(arc), SOG.Mesh mesh => _meshConverter.Convert(mesh), SOG.Point point => _pointConverter.Convert(point), _ => throw new ConversionException($"Found unsupported fallback geometry: {item.GetType()}") diff --git a/Converters/Tekla/Speckle.Converter.Tekla2024/packages.lock.json b/Converters/Tekla/Speckle.Converter.Tekla2024/packages.lock.json index f3c55e98..91e9851b 100644 --- a/Converters/Tekla/Speckle.Converter.Tekla2024/packages.lock.json +++ b/Converters/Tekla/Speckle.Converter.Tekla2024/packages.lock.json @@ -105,6 +105,14 @@ "resolved": "6.0.0", "contentHash": "yg72rrYDapfsIUrul7aF6wwNnTJBOFvuA9VdDTQpPa8AlAriHbufeXYLBcodKjfUdkCnaiggX1U/nEP08Zb5GA==" }, + "Microsoft.Bcl.AsyncInterfaces": { + "type": "Transitive", + "resolved": "5.0.0", + "contentHash": "W8DPQjkMScOMTtJbPwmPyj9c3zYSFGawDW3jwlBOOsnY+EzZFLgNQ/UMkK35JmkNOVPdCyPr2Tw7Vv9N+KA3ZQ==", + "dependencies": { + "System.Threading.Tasks.Extensions": "4.5.4" + } + }, "Microsoft.Build.Tasks.Git": { "type": "Transitive", "resolved": "8.0.0", @@ -195,24 +203,6 @@ "resolved": "0.11.4", "contentHash": "IC1h5g0NeJGHIUgzM1P82ld57knhP0IcQfrYITDPXlNpMYGUrsG5TxuaWTjaeqDNQMBDNZkB8L0rBnwsY6JHuQ==" }, - "Polly": { - "type": "Transitive", - "resolved": "7.2.3", - "contentHash": "DeCY0OFbNdNxsjntr1gTXHJ5pKUwYzp04Er2LLeN3g6pWhffsGuKVfMBLe1lw7x76HrPkLxKEFxBlpRxS2nDEQ==" - }, - "Polly.Contrib.WaitAndRetry": { - "type": "Transitive", - "resolved": "1.1.1", - "contentHash": "1MUQLiSo4KDkQe6nzQRhIU05lm9jlexX5BVsbuw0SL82ynZ+GzAHQxJVDPVBboxV37Po3SG077aX8DuSy8TkaA==" - }, - "Polly.Extensions.Http": { - "type": "Transitive", - "resolved": "3.0.0", - "contentHash": "drrG+hB3pYFY7w1c3BD+lSGYvH2oIclH8GRSehgfyP5kjnFnHKQuuBhuHLv+PWyFuaTDyk/vfRpnxOzd11+J8g==", - "dependencies": { - "Polly": "7.1.0" - } - }, "Speckle.DoubleNumerics": { "type": "Transitive", "resolved": "4.0.1", @@ -363,7 +353,7 @@ "type": "Project", "dependencies": { "Microsoft.Extensions.Logging.Abstractions": "[2.2.0, )", - "Speckle.Objects": "[3.1.0-dev.164, )" + "Speckle.Objects": "[3.1.0-dev.167, )" } }, "Microsoft.Extensions.Logging.Abstractions": { @@ -374,31 +364,36 @@ }, "Speckle.Objects": { "type": "CentralTransitive", - "requested": "[3.1.0-dev.164, )", - "resolved": "3.1.0-dev.164", - "contentHash": "bvQ7xwOWFm9fYdWr111Q/PKgHaMEfV08uE0erQyZuLYCJ9sFJKRcbQlaf4d6VRzl/fVJm8ypqIdtXgQtsiMSlQ==", + "requested": "[3.1.0-dev.167, )", + "resolved": "3.1.0-dev.167", + "contentHash": "VpMlOcApkQPLn90Xb5K+2nH64wN3NJ906u/YaM1oGAMw7v1SoYPbb5i03bFLuOw/Ho1KSGI0ccU82Jpi9p+n8A==", "dependencies": { - "Speckle.Sdk": "3.1.0-dev.164" + "Speckle.Sdk": "3.1.0-dev.167" } }, "Speckle.Sdk": { "type": "CentralTransitive", - "requested": "[3.1.0-dev.164, )", - "resolved": "3.1.0-dev.164", - "contentHash": "b88QWWSPYs3h9H2Af78TrKclyjYd7OxmKwx4p2C7IgFzaDW51dSd9o0pEB7H3Ao4ydCoOW9Xey8v1lhfckl09w==", + "requested": "[3.1.0-dev.167, )", + "resolved": "3.1.0-dev.167", + "contentHash": "KGbynDH2vFca7NqpVTp3KvNDE5zdX/ZuCtjdtqGG7rS8r5x2YMT6Ptk2RKJrpPNCaNL/YnuiZ425JLWua4lfqw==", "dependencies": { "GraphQL.Client": "6.0.0", + "Microsoft.Bcl.AsyncInterfaces": "5.0.0", "Microsoft.CSharp": "4.7.0", "Microsoft.Data.Sqlite": "7.0.7", "Microsoft.Extensions.DependencyInjection.Abstractions": "2.2.0", "Microsoft.Extensions.Logging": "2.2.0", - "Polly": "7.2.3", - "Polly.Contrib.WaitAndRetry": "1.1.1", - "Polly.Extensions.Http": "3.0.0", "Speckle.DoubleNumerics": "4.0.1", - "Speckle.Newtonsoft.Json": "13.0.2" + "Speckle.Newtonsoft.Json": "13.0.2", + "Speckle.Sdk.Dependencies": "3.1.0-dev.167" } }, + "Speckle.Sdk.Dependencies": { + "type": "CentralTransitive", + "requested": "[3.1.0-dev.167, )", + "resolved": "3.1.0-dev.167", + "contentHash": "LOV43Wn6IYWfK+ifz/XfcYDaL5ZFF6wLVJQGgSkaNEpGOBitCg6bQc2AuNuy5QHk85dbB1QS9XXEXjeoMxugLg==" + }, "Tekla.Structures.Plugins": { "type": "CentralTransitive", "requested": "[2024.0.2, )", diff --git a/Sdk/Speckle.Converters.Common/Registration/ConverterManager.cs b/Sdk/Speckle.Converters.Common/Registration/ConverterManager.cs index 9ef4d96c..49a1558f 100644 --- a/Sdk/Speckle.Converters.Common/Registration/ConverterManager.cs +++ b/Sdk/Speckle.Converters.Common/Registration/ConverterManager.cs @@ -9,7 +9,7 @@ public class ConverterManager(ConcurrentDictionary converterTyp { public string Name => typeof(T).Name; - public T ResolveConverter(Type type, bool recursive = false) + public T ResolveConverter(Type type, bool recursive = true) { var currentType = type; while (true) diff --git a/Sdk/Speckle.Converters.Common/Registration/IConverterManager.cs b/Sdk/Speckle.Converters.Common/Registration/IConverterManager.cs index dab7e628..6be88928 100644 --- a/Sdk/Speckle.Converters.Common/Registration/IConverterManager.cs +++ b/Sdk/Speckle.Converters.Common/Registration/IConverterManager.cs @@ -1,7 +1,7 @@ -namespace Speckle.Converters.Common.Registration; +namespace Speckle.Converters.Common.Registration; public interface IConverterManager { public string Name { get; } - public T ResolveConverter(Type type, bool recursive = false); + public T ResolveConverter(Type type, bool recursive = true); } From 03f07c21a8a777fa38297885ce767e7b333e7f9b Mon Sep 17 00:00:00 2001 From: Dogukan Karatas Date: Fri, 25 Oct 2024 17:32:10 +0200 Subject: [PATCH 16/29] updates package.lock --- .../packages.lock.json | 28 +++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/Converters/Tekla/Speckle.Converter.Tekla2024/packages.lock.json b/Converters/Tekla/Speckle.Converter.Tekla2024/packages.lock.json index 91e9851b..bddbb995 100644 --- a/Converters/Tekla/Speckle.Converter.Tekla2024/packages.lock.json +++ b/Converters/Tekla/Speckle.Converter.Tekla2024/packages.lock.json @@ -406,6 +406,34 @@ "Trimble.Remoting": "1.0.2" } } + }, + ".NETFramework,Version=v4.8/win": { + "SQLitePCLRaw.lib.e_sqlite3": { + "type": "Transitive", + "resolved": "2.1.4", + "contentHash": "2C9Q9eX7CPLveJA0rIhf9RXAvu+7nWZu1A2MdG6SD/NOu26TakGgL1nsbc0JAspGijFOo3HoN79xrx8a368fBg==" + } + }, + ".NETFramework,Version=v4.8/win-arm64": { + "SQLitePCLRaw.lib.e_sqlite3": { + "type": "Transitive", + "resolved": "2.1.4", + "contentHash": "2C9Q9eX7CPLveJA0rIhf9RXAvu+7nWZu1A2MdG6SD/NOu26TakGgL1nsbc0JAspGijFOo3HoN79xrx8a368fBg==" + } + }, + ".NETFramework,Version=v4.8/win-x64": { + "SQLitePCLRaw.lib.e_sqlite3": { + "type": "Transitive", + "resolved": "2.1.4", + "contentHash": "2C9Q9eX7CPLveJA0rIhf9RXAvu+7nWZu1A2MdG6SD/NOu26TakGgL1nsbc0JAspGijFOo3HoN79xrx8a368fBg==" + } + }, + ".NETFramework,Version=v4.8/win-x86": { + "SQLitePCLRaw.lib.e_sqlite3": { + "type": "Transitive", + "resolved": "2.1.4", + "contentHash": "2C9Q9eX7CPLveJA0rIhf9RXAvu+7nWZu1A2MdG6SD/NOu26TakGgL1nsbc0JAspGijFOo3HoN79xrx8a368fBg==" + } } } } \ No newline at end of file From 3b8a37843589fd1b2c088ef26bb461493d46dbe3 Mon Sep 17 00:00:00 2001 From: Dogukan Karatas Date: Mon, 28 Oct 2024 11:11:37 +0100 Subject: [PATCH 17/29] adds global using --- .../packages.lock.json | 1 - .../GlobalUsing.cs | 3 + .../Speckle.Converter.Tekla2024.csproj | 83 ++++--------------- .../TeklaRootToSpeckleConverter.cs | 1 - .../TeklaToSpeckleUnitConverter.cs | 1 - .../ToSpeckle/Raw/BeamRawConverter.cs | 18 ++-- .../ToSpeckle/Raw/LineToSpeckleConverter.cs | 1 - .../ToSpeckle/Raw/PointToSpeckleConverter.cs | 1 - .../ToSpeckle/Raw/SolidToSpeckleConverter.cs | 20 +++-- .../ToSpeckle/TopLevel/BeamConverter.cs | 7 +- .../packages.lock.json | 52 +++--------- 11 files changed, 52 insertions(+), 136 deletions(-) create mode 100644 Converters/Tekla/Speckle.Converter.Tekla2024/GlobalUsing.cs diff --git a/Connectors/Tekla/Speckle.Connector.Tekla2024/packages.lock.json b/Connectors/Tekla/Speckle.Connector.Tekla2024/packages.lock.json index bae46900..7e69d3c9 100644 --- a/Connectors/Tekla/Speckle.Connector.Tekla2024/packages.lock.json +++ b/Connectors/Tekla/Speckle.Connector.Tekla2024/packages.lock.json @@ -432,7 +432,6 @@ "speckle.converter.tekla2024": { "type": "Project", "dependencies": { - "Microsoft.Extensions.Logging": "[2.2.0, )", "Speckle.Converters.Common": "[1.0.0, )", "Tekla.Structures.Drawing": "[2024.0.2, )", "Tekla.Structures.Model": "[2024.0.2, )" diff --git a/Converters/Tekla/Speckle.Converter.Tekla2024/GlobalUsing.cs b/Converters/Tekla/Speckle.Converter.Tekla2024/GlobalUsing.cs new file mode 100644 index 00000000..09823d72 --- /dev/null +++ b/Converters/Tekla/Speckle.Converter.Tekla2024/GlobalUsing.cs @@ -0,0 +1,3 @@ +global using TSM = Tekla.Structures.Model; +global using TG = Tekla.Structures.Geometry3d; +global using TSMUI = Tekla.Structures.Model.UI; diff --git a/Converters/Tekla/Speckle.Converter.Tekla2024/Speckle.Converter.Tekla2024.csproj b/Converters/Tekla/Speckle.Converter.Tekla2024/Speckle.Converter.Tekla2024.csproj index 5936d693..54c7e376 100644 --- a/Converters/Tekla/Speckle.Converter.Tekla2024/Speckle.Converter.Tekla2024.csproj +++ b/Converters/Tekla/Speckle.Converter.Tekla2024/Speckle.Converter.Tekla2024.csproj @@ -1,75 +1,20 @@ - - - + + - Debug - AnyCPU - {ACF75860-7FCE-4AE9-8C45-68AD1043550B} - Library - Properties - Speckle.Converter.Tekla2024 - Speckle.Converter.Tekla2024 - v4.8 - 512 + net48 + x64 + true + Debug;Release;Local + false - - AnyCPU - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - - - AnyCPU - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - - - - ..\..\..\..\..\..\.nuget\packages\speckle.sdk\3.1.0-dev.164\lib\netstandard2.0\Speckle.Sdk.dll - - - - - - - - - - - - - - - - - - - + - - - + + + - - {8aef06c0-ca5c-4460-bc2d-ade5f35d0434} - Speckle.Converters.Common - + - - - \ No newline at end of file + + diff --git a/Converters/Tekla/Speckle.Converter.Tekla2024/TeklaRootToSpeckleConverter.cs b/Converters/Tekla/Speckle.Converter.Tekla2024/TeklaRootToSpeckleConverter.cs index 973d030a..fce5af34 100644 --- a/Converters/Tekla/Speckle.Converter.Tekla2024/TeklaRootToSpeckleConverter.cs +++ b/Converters/Tekla/Speckle.Converter.Tekla2024/TeklaRootToSpeckleConverter.cs @@ -1,4 +1,3 @@ -using System; using Microsoft.Extensions.Logging; using Speckle.Converters.Common; using Speckle.Converters.Common.Objects; diff --git a/Converters/Tekla/Speckle.Converter.Tekla2024/TeklaToSpeckleUnitConverter.cs b/Converters/Tekla/Speckle.Converter.Tekla2024/TeklaToSpeckleUnitConverter.cs index 86945e65..91187fa2 100644 --- a/Converters/Tekla/Speckle.Converter.Tekla2024/TeklaToSpeckleUnitConverter.cs +++ b/Converters/Tekla/Speckle.Converter.Tekla2024/TeklaToSpeckleUnitConverter.cs @@ -1,4 +1,3 @@ -using System.Collections.Generic; using Speckle.Converters.Common; using Speckle.Sdk.Common.Exceptions; using SSC = Speckle.Sdk.Common; diff --git a/Converters/Tekla/Speckle.Converter.Tekla2024/ToSpeckle/Raw/BeamRawConverter.cs b/Converters/Tekla/Speckle.Converter.Tekla2024/ToSpeckle/Raw/BeamRawConverter.cs index 41330364..765e8b38 100644 --- a/Converters/Tekla/Speckle.Converter.Tekla2024/ToSpeckle/Raw/BeamRawConverter.cs +++ b/Converters/Tekla/Speckle.Converter.Tekla2024/ToSpeckle/Raw/BeamRawConverter.cs @@ -1,24 +1,20 @@ -using System.Collections.Generic; using Speckle.Converters.Common; using Speckle.Converters.Common.Objects; using Speckle.Sdk.Models; -using Tekla.Structures.Model; -using Tekla.Structures.Model.UI; using SOG = Speckle.Objects.Geometry; -using TG = Tekla.Structures.Geometry3d; namespace Speckle.Converter.Tekla2024.ToSpeckle.Raw; -public class BeamRawConverter : ITypedConverter +public class BeamRawConverter : ITypedConverter { private readonly IConverterSettingsStore _settingsStore; private readonly ITypedConverter _pointConverter; - private readonly ITypedConverter _meshConverter; + private readonly ITypedConverter _meshConverter; public BeamRawConverter( IConverterSettingsStore settingsStore, ITypedConverter pointConverter, - ITypedConverter meshConverter + ITypedConverter meshConverter ) { _settingsStore = settingsStore; @@ -26,11 +22,11 @@ public BeamRawConverter( _meshConverter = meshConverter; } - public Base Convert(Beam target) + public Base Convert(TSM.Beam target) { var beamObject = new Base { - ["type"] = nameof(Beam), + ["type"] = nameof(TSM.Beam), ["units"] = _settingsStore.Current.SpeckleUnits, ["profile"] = target.Profile.ProfileString, ["material"] = target.Material.MaterialString, @@ -39,8 +35,8 @@ public Base Convert(Beam target) var solid = target.GetSolid(); var mesh = _meshConverter.Convert(solid); - var color = new Color(); - ModelObjectVisualization.GetRepresentation(target, ref color); + var color = new TSMUI.Color(); + TSMUI.ModelObjectVisualization.GetRepresentation(target, ref color); int r = (int)(color.Red * 255); int g = (int)(color.Green * 255); diff --git a/Converters/Tekla/Speckle.Converter.Tekla2024/ToSpeckle/Raw/LineToSpeckleConverter.cs b/Converters/Tekla/Speckle.Converter.Tekla2024/ToSpeckle/Raw/LineToSpeckleConverter.cs index 2a70cfa6..dea7cae7 100644 --- a/Converters/Tekla/Speckle.Converter.Tekla2024/ToSpeckle/Raw/LineToSpeckleConverter.cs +++ b/Converters/Tekla/Speckle.Converter.Tekla2024/ToSpeckle/Raw/LineToSpeckleConverter.cs @@ -1,7 +1,6 @@ using Speckle.Converters.Common; using Speckle.Converters.Common.Objects; using SOG = Speckle.Objects.Geometry; -using TG = Tekla.Structures.Geometry3d; namespace Speckle.Converter.Tekla2024.ToSpeckle.Raw; diff --git a/Converters/Tekla/Speckle.Converter.Tekla2024/ToSpeckle/Raw/PointToSpeckleConverter.cs b/Converters/Tekla/Speckle.Converter.Tekla2024/ToSpeckle/Raw/PointToSpeckleConverter.cs index d11628ec..104b5f35 100644 --- a/Converters/Tekla/Speckle.Converter.Tekla2024/ToSpeckle/Raw/PointToSpeckleConverter.cs +++ b/Converters/Tekla/Speckle.Converter.Tekla2024/ToSpeckle/Raw/PointToSpeckleConverter.cs @@ -1,7 +1,6 @@ using Speckle.Converters.Common; using Speckle.Converters.Common.Objects; using SOG = Speckle.Objects.Geometry; -using TG = Tekla.Structures.Geometry3d; namespace Speckle.Converter.Tekla2024.ToSpeckle.Raw; diff --git a/Converters/Tekla/Speckle.Converter.Tekla2024/ToSpeckle/Raw/SolidToSpeckleConverter.cs b/Converters/Tekla/Speckle.Converter.Tekla2024/ToSpeckle/Raw/SolidToSpeckleConverter.cs index 25ccf341..ff988e0a 100644 --- a/Converters/Tekla/Speckle.Converter.Tekla2024/ToSpeckle/Raw/SolidToSpeckleConverter.cs +++ b/Converters/Tekla/Speckle.Converter.Tekla2024/ToSpeckle/Raw/SolidToSpeckleConverter.cs @@ -1,9 +1,6 @@ -using System.Collections.Generic; using Speckle.Converters.Common; using Speckle.Converters.Common.Objects; using SOG = Speckle.Objects.Geometry; -using TG = Tekla.Structures.Geometry3d; -using TSM = Tekla.Structures.Model; namespace Speckle.Converter.Tekla2024.ToSpeckle.Raw; @@ -28,36 +25,45 @@ public SOG.Mesh Convert(TSM.Solid target) { var face = faceEnum.Current; if (face == null) + { continue; + } var loopEnum = face.GetLoopEnumerator(); if (!loopEnum.MoveNext()) + { continue; + } var loop = loopEnum.Current; if (loop == null) + { continue; + } var corners = new List(); var vertexEnum = loop.GetVertexEnumerator(); while (vertexEnum.MoveNext()) { - var vertex = vertexEnum.Current as TG.Point; + var vertex = vertexEnum.Current; if (vertex == null) + { continue; + } string vertexKey = $"{vertex.X:F8},{vertex.Y:F8},{vertex.Z:F8}"; - if (!uniqueVertices.ContainsKey(vertexKey)) + if (!uniqueVertices.TryGetValue(vertexKey, out int value)) { - uniqueVertices[vertexKey] = currentIndex++; + value = currentIndex++; + uniqueVertices[vertexKey] = value; vertices.Add(vertex.X); vertices.Add(vertex.Y); vertices.Add(vertex.Z); } - corners.Add(uniqueVertices[vertexKey]); + corners.Add(value); } if (corners.Count == 4) diff --git a/Converters/Tekla/Speckle.Converter.Tekla2024/ToSpeckle/TopLevel/BeamConverter.cs b/Converters/Tekla/Speckle.Converter.Tekla2024/ToSpeckle/TopLevel/BeamConverter.cs index ea2243f8..bb5cc663 100644 --- a/Converters/Tekla/Speckle.Converter.Tekla2024/ToSpeckle/TopLevel/BeamConverter.cs +++ b/Converters/Tekla/Speckle.Converter.Tekla2024/ToSpeckle/TopLevel/BeamConverter.cs @@ -1,12 +1,11 @@ using Speckle.Converters.Common; using Speckle.Converters.Common.Objects; using Speckle.Sdk.Models; -using Tekla.Structures.Model; namespace Speckle.Converter.Tekla2024.ToSpeckle.TopLevel; -[NameAndRankValue(nameof(Beam), NameAndRankValueAttribute.SPECKLE_DEFAULT_RANK)] -public class BeamConverter(ITypedConverter beamConverter) : IToSpeckleTopLevelConverter +[NameAndRankValue(nameof(TSM.Beam), NameAndRankValueAttribute.SPECKLE_DEFAULT_RANK)] +public class BeamConverter(ITypedConverter beamConverter) : IToSpeckleTopLevelConverter { - public Base Convert(object target) => beamConverter.Convert((Beam)target); + public Base Convert(object target) => beamConverter.Convert((TSM.Beam)target); } diff --git a/Converters/Tekla/Speckle.Converter.Tekla2024/packages.lock.json b/Converters/Tekla/Speckle.Converter.Tekla2024/packages.lock.json index bddbb995..cad6ec7d 100644 --- a/Converters/Tekla/Speckle.Converter.Tekla2024/packages.lock.json +++ b/Converters/Tekla/Speckle.Converter.Tekla2024/packages.lock.json @@ -2,18 +2,6 @@ "version": 2, "dependencies": { ".NETFramework,Version=v4.8": { - "Microsoft.Extensions.Logging": { - "type": "Direct", - "requested": "[2.2.0, )", - "resolved": "2.2.0", - "contentHash": "Nxqhadc9FCmFHzU+fz3oc8sFlE6IadViYg8dfUdGzJZ2JUxnCsRghBhhOWdM4B2zSZqEc+0BjliBh/oNdRZuig==", - "dependencies": { - "Microsoft.Extensions.Configuration.Binder": "2.2.0", - "Microsoft.Extensions.DependencyInjection.Abstractions": "2.2.0", - "Microsoft.Extensions.Logging.Abstractions": "2.2.0", - "Microsoft.Extensions.Options": "2.2.0" - } - }, "Microsoft.NETFramework.ReferenceAssemblies": { "type": "Direct", "requested": "[1.0.3, )", @@ -356,6 +344,18 @@ "Speckle.Objects": "[3.1.0-dev.167, )" } }, + "Microsoft.Extensions.Logging": { + "type": "CentralTransitive", + "requested": "[2.2.0, )", + "resolved": "2.2.0", + "contentHash": "Nxqhadc9FCmFHzU+fz3oc8sFlE6IadViYg8dfUdGzJZ2JUxnCsRghBhhOWdM4B2zSZqEc+0BjliBh/oNdRZuig==", + "dependencies": { + "Microsoft.Extensions.Configuration.Binder": "2.2.0", + "Microsoft.Extensions.DependencyInjection.Abstractions": "2.2.0", + "Microsoft.Extensions.Logging.Abstractions": "2.2.0", + "Microsoft.Extensions.Options": "2.2.0" + } + }, "Microsoft.Extensions.Logging.Abstractions": { "type": "CentralTransitive", "requested": "[2.2.0, )", @@ -406,34 +406,6 @@ "Trimble.Remoting": "1.0.2" } } - }, - ".NETFramework,Version=v4.8/win": { - "SQLitePCLRaw.lib.e_sqlite3": { - "type": "Transitive", - "resolved": "2.1.4", - "contentHash": "2C9Q9eX7CPLveJA0rIhf9RXAvu+7nWZu1A2MdG6SD/NOu26TakGgL1nsbc0JAspGijFOo3HoN79xrx8a368fBg==" - } - }, - ".NETFramework,Version=v4.8/win-arm64": { - "SQLitePCLRaw.lib.e_sqlite3": { - "type": "Transitive", - "resolved": "2.1.4", - "contentHash": "2C9Q9eX7CPLveJA0rIhf9RXAvu+7nWZu1A2MdG6SD/NOu26TakGgL1nsbc0JAspGijFOo3HoN79xrx8a368fBg==" - } - }, - ".NETFramework,Version=v4.8/win-x64": { - "SQLitePCLRaw.lib.e_sqlite3": { - "type": "Transitive", - "resolved": "2.1.4", - "contentHash": "2C9Q9eX7CPLveJA0rIhf9RXAvu+7nWZu1A2MdG6SD/NOu26TakGgL1nsbc0JAspGijFOo3HoN79xrx8a368fBg==" - } - }, - ".NETFramework,Version=v4.8/win-x86": { - "SQLitePCLRaw.lib.e_sqlite3": { - "type": "Transitive", - "resolved": "2.1.4", - "contentHash": "2C9Q9eX7CPLveJA0rIhf9RXAvu+7nWZu1A2MdG6SD/NOu26TakGgL1nsbc0JAspGijFOo3HoN79xrx8a368fBg==" - } } } } \ No newline at end of file From f22e97937b2d058b36f54e5b1eb4af81e8bb84f3 Mon Sep 17 00:00:00 2001 From: Dogukan Karatas Date: Mon, 28 Oct 2024 11:14:18 +0100 Subject: [PATCH 18/29] formats and cleans latest dev --- Converters/Tekla/Speckle.Converter.Tekla2024/GlobalUsing.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Converters/Tekla/Speckle.Converter.Tekla2024/GlobalUsing.cs b/Converters/Tekla/Speckle.Converter.Tekla2024/GlobalUsing.cs index 09823d72..1ee6d9a2 100644 --- a/Converters/Tekla/Speckle.Converter.Tekla2024/GlobalUsing.cs +++ b/Converters/Tekla/Speckle.Converter.Tekla2024/GlobalUsing.cs @@ -1,3 +1,3 @@ -global using TSM = Tekla.Structures.Model; global using TG = Tekla.Structures.Geometry3d; +global using TSM = Tekla.Structures.Model; global using TSMUI = Tekla.Structures.Model.UI; From e17c63b3a291f977ef6b49a0177e09274c0c22c5 Mon Sep 17 00:00:00 2001 From: Dogukan Karatas Date: Mon, 28 Oct 2024 11:26:26 +0100 Subject: [PATCH 19/29] updates teklasendbinding --- .../Bindings/TeklaSendBinding.cs | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/Connectors/Tekla/Speckle.Connector.Tekla2024/Bindings/TeklaSendBinding.cs b/Connectors/Tekla/Speckle.Connector.Tekla2024/Bindings/TeklaSendBinding.cs index 9fbc0971..25404b3e 100644 --- a/Connectors/Tekla/Speckle.Connector.Tekla2024/Bindings/TeklaSendBinding.cs +++ b/Connectors/Tekla/Speckle.Connector.Tekla2024/Bindings/TeklaSendBinding.cs @@ -89,7 +89,7 @@ private void ModelHandler_OnChange(List changes) { foreach (var change in changes) { - if (change.Object is ModelObject modelObj) + if (change.Object is { } modelObj) { ChangedObjectIds[modelObj.Identifier.ID.ToString()] = 1; } @@ -195,10 +195,7 @@ public void Dispose() { if (!_disposed) { - if (_events != null) - { - _events.UnRegister(); - } + _events.UnRegister(); _disposed = true; } } From e5495b9951a282e2a30c337589f620cdede2e59a Mon Sep 17 00:00:00 2001 From: Dogukan Karatas Date: Mon, 28 Oct 2024 11:36:07 +0100 Subject: [PATCH 20/29] update csproj --- .../Speckle.Converter.Tekla2024.csproj | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Converters/Tekla/Speckle.Converter.Tekla2024/Speckle.Converter.Tekla2024.csproj b/Converters/Tekla/Speckle.Converter.Tekla2024/Speckle.Converter.Tekla2024.csproj index 54c7e376..a726194d 100644 --- a/Converters/Tekla/Speckle.Converter.Tekla2024/Speckle.Converter.Tekla2024.csproj +++ b/Converters/Tekla/Speckle.Converter.Tekla2024/Speckle.Converter.Tekla2024.csproj @@ -6,6 +6,8 @@ true Debug;Release;Local false + Speckle.Converter.Tekla2024 + Speckle.Converter.Tekla2024 From 94fa0a2d7a066274cd63915832e9a808e5305f65 Mon Sep 17 00:00:00 2001 From: Dogukan Karatas Date: Mon, 28 Oct 2024 11:50:44 +0100 Subject: [PATCH 21/29] adds converter project to Local.sln --- Local.sln | 25 +++++++++---------------- 1 file changed, 9 insertions(+), 16 deletions(-) diff --git a/Local.sln b/Local.sln index e1ac6681..7cd9b498 100644 --- a/Local.sln +++ b/Local.sln @@ -110,10 +110,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Speckle.Converters.Revit202 EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "2022", "2022", "{0AF38BA3-65A0-481B-8CBB-B82E406E1575}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Speckle.Objects", "..\speckle-sharp-sdk\src\Speckle.Objects\Speckle.Objects.csproj", "{259A84F0-2D1E-49DE-9137-93BE6858A52C}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Speckle.Sdk", "..\speckle-sharp-sdk\src\Speckle.Sdk\Speckle.Sdk.csproj", "{347CECE7-99DC-49A6-A508-7DE9907B887B}" -EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "7", "7", "{201AF4EA-F049-4332-A746-42D3413DAE08}" EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "8", "8", "{9714467A-AECB-45B5-82D8-3E7BFF6E37C8}" @@ -176,6 +172,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Speckle.Converters.Civil3d2 EndProject Project("{D954291E-2A0B-460D-934E-DC6B0785DB48}") = "Speckle.Connectors.Civil3dShared", "Connectors\Autocad\Speckle.Connectors.Civil3dShared\Speckle.Connectors.Civil3dShared.shproj", "{EFD01520-93E8-4CCA-8E03-9CDC635F55F4}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Speckle.Converter.Tekla2024", "Converters\Tekla\Speckle.Converter.Tekla2024\Speckle.Converter.Tekla2024.csproj", "{EDC39963-C893-4E3E-8857-F1999301BD1D}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -333,18 +331,6 @@ Global {19424B55-058C-4E9C-B86F-700AEF9EAEC3}.Local|Any CPU.Build.0 = Local|Any CPU {19424B55-058C-4E9C-B86F-700AEF9EAEC3}.Release|Any CPU.ActiveCfg = Release|Any CPU {19424B55-058C-4E9C-B86F-700AEF9EAEC3}.Release|Any CPU.Build.0 = Release|Any CPU - {259A84F0-2D1E-49DE-9137-93BE6858A52C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {259A84F0-2D1E-49DE-9137-93BE6858A52C}.Debug|Any CPU.Build.0 = Debug|Any CPU - {259A84F0-2D1E-49DE-9137-93BE6858A52C}.Local|Any CPU.ActiveCfg = Local|Any CPU - {259A84F0-2D1E-49DE-9137-93BE6858A52C}.Local|Any CPU.Build.0 = Local|Any CPU - {259A84F0-2D1E-49DE-9137-93BE6858A52C}.Release|Any CPU.ActiveCfg = Release|Any CPU - {259A84F0-2D1E-49DE-9137-93BE6858A52C}.Release|Any CPU.Build.0 = Release|Any CPU - {347CECE7-99DC-49A6-A508-7DE9907B887B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {347CECE7-99DC-49A6-A508-7DE9907B887B}.Debug|Any CPU.Build.0 = Debug|Any CPU - {347CECE7-99DC-49A6-A508-7DE9907B887B}.Local|Any CPU.ActiveCfg = Local|Any CPU - {347CECE7-99DC-49A6-A508-7DE9907B887B}.Local|Any CPU.Build.0 = Local|Any CPU - {347CECE7-99DC-49A6-A508-7DE9907B887B}.Release|Any CPU.ActiveCfg = Release|Any CPU - {347CECE7-99DC-49A6-A508-7DE9907B887B}.Release|Any CPU.Build.0 = Release|Any CPU {6F3FD892-6315-4F75-BFBD-843A489F8B94}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {6F3FD892-6315-4F75-BFBD-843A489F8B94}.Debug|Any CPU.Build.0 = Debug|Any CPU {6F3FD892-6315-4F75-BFBD-843A489F8B94}.Local|Any CPU.ActiveCfg = Local|Any CPU @@ -465,6 +451,12 @@ Global {AE75B68F-3594-403B-9719-9C36DA0E3F8A}.Local|Any CPU.Build.0 = Local|Any CPU {AE75B68F-3594-403B-9719-9C36DA0E3F8A}.Release|Any CPU.ActiveCfg = Release|Any CPU {AE75B68F-3594-403B-9719-9C36DA0E3F8A}.Release|Any CPU.Build.0 = Release|Any CPU + {EDC39963-C893-4E3E-8857-F1999301BD1D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {EDC39963-C893-4E3E-8857-F1999301BD1D}.Debug|Any CPU.Build.0 = Debug|Any CPU + {EDC39963-C893-4E3E-8857-F1999301BD1D}.Local|Any CPU.ActiveCfg = Local|Any CPU + {EDC39963-C893-4E3E-8857-F1999301BD1D}.Local|Any CPU.Build.0 = Local|Any CPU + {EDC39963-C893-4E3E-8857-F1999301BD1D}.Release|Any CPU.ActiveCfg = Release|Any CPU + {EDC39963-C893-4E3E-8857-F1999301BD1D}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -543,6 +535,7 @@ Global {1F93164A-42EE-4D72-B7CD-9CA831F60E09} = {B32A4121-C9A1-4098-81CD-D799E1491F54} {AE75B68F-3594-403B-9719-9C36DA0E3F8A} = {48B7AC68-AA4D-4B36-A5DE-7F19607892A6} {EFD01520-93E8-4CCA-8E03-9CDC635F55F4} = {6186EF63-4978-4FA9-9893-7074F9FD0BA4} + {EDC39963-C893-4E3E-8857-F1999301BD1D} = {AB1AD13B-163E-45F8-8F96-52A921501FA0} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {EE253116-7070-4E9A-BCE8-2911C251B8C8} From 59505cef6db1ead0c813a51580e298b7e49f6935 Mon Sep 17 00:00:00 2001 From: Dogukan Karatas Date: Mon, 28 Oct 2024 12:08:11 +0100 Subject: [PATCH 22/29] update packages --- .../Speckle.Connector.Tekla2024.csproj | 1 + .../packages.lock.json | 19 ++++++++++--------- .../Speckle.Converter.Tekla2024.csproj | 1 + .../packages.lock.json | 18 +++++++++--------- 4 files changed, 21 insertions(+), 18 deletions(-) diff --git a/Connectors/Tekla/Speckle.Connector.Tekla2024/Speckle.Connector.Tekla2024.csproj b/Connectors/Tekla/Speckle.Connector.Tekla2024/Speckle.Connector.Tekla2024.csproj index 9a0583bd..6d7f142c 100644 --- a/Connectors/Tekla/Speckle.Connector.Tekla2024/Speckle.Connector.Tekla2024.csproj +++ b/Connectors/Tekla/Speckle.Connector.Tekla2024/Speckle.Connector.Tekla2024.csproj @@ -15,6 +15,7 @@ + diff --git a/Connectors/Tekla/Speckle.Connector.Tekla2024/packages.lock.json b/Connectors/Tekla/Speckle.Connector.Tekla2024/packages.lock.json index 7e69d3c9..ebe59080 100644 --- a/Connectors/Tekla/Speckle.Connector.Tekla2024/packages.lock.json +++ b/Connectors/Tekla/Speckle.Connector.Tekla2024/packages.lock.json @@ -33,6 +33,15 @@ "resolved": "0.9.6", "contentHash": "HKH7tYrYYlCK1ct483hgxERAdVdMtl7gUKW9ijWXxA1UsYR4Z+TrRHYmzZ9qmpu1NnTycSrp005NYM78GDKV1w==" }, + "Speckle.Objects": { + "type": "Direct", + "requested": "[3.1.0-dev.167, )", + "resolved": "3.1.0-dev.167", + "contentHash": "VpMlOcApkQPLn90Xb5K+2nH64wN3NJ906u/YaM1oGAMw7v1SoYPbb5i03bFLuOw/Ho1KSGI0ccU82Jpi9p+n8A==", + "dependencies": { + "Speckle.Sdk": "3.1.0-dev.167" + } + }, "Tekla.Structures.Dialog": { "type": "Direct", "requested": "[2024.0.2, )", @@ -433,6 +442,7 @@ "type": "Project", "dependencies": { "Speckle.Converters.Common": "[1.0.0, )", + "Speckle.Objects": "[3.1.0-dev.167, )", "Tekla.Structures.Drawing": "[2024.0.2, )", "Tekla.Structures.Model": "[2024.0.2, )" } @@ -477,15 +487,6 @@ "resolved": "1.0.1938.49", "contentHash": "z8KnFnaTYzhA/ZnyRX0qGfS1NU5ZBJeClAH64F0fVDvdDJTvME7xl6zTJ0Jlfe1BtL3C0NH9xTy64shg2baKdw==" }, - "Speckle.Objects": { - "type": "CentralTransitive", - "requested": "[3.1.0-dev.167, )", - "resolved": "3.1.0-dev.167", - "contentHash": "VpMlOcApkQPLn90Xb5K+2nH64wN3NJ906u/YaM1oGAMw7v1SoYPbb5i03bFLuOw/Ho1KSGI0ccU82Jpi9p+n8A==", - "dependencies": { - "Speckle.Sdk": "3.1.0-dev.167" - } - }, "Speckle.Sdk": { "type": "CentralTransitive", "requested": "[3.1.0-dev.167, )", diff --git a/Converters/Tekla/Speckle.Converter.Tekla2024/Speckle.Converter.Tekla2024.csproj b/Converters/Tekla/Speckle.Converter.Tekla2024/Speckle.Converter.Tekla2024.csproj index a726194d..2a86fc4c 100644 --- a/Converters/Tekla/Speckle.Converter.Tekla2024/Speckle.Converter.Tekla2024.csproj +++ b/Converters/Tekla/Speckle.Converter.Tekla2024/Speckle.Converter.Tekla2024.csproj @@ -11,6 +11,7 @@ + diff --git a/Converters/Tekla/Speckle.Converter.Tekla2024/packages.lock.json b/Converters/Tekla/Speckle.Converter.Tekla2024/packages.lock.json index cad6ec7d..972c5311 100644 --- a/Converters/Tekla/Speckle.Converter.Tekla2024/packages.lock.json +++ b/Converters/Tekla/Speckle.Converter.Tekla2024/packages.lock.json @@ -33,6 +33,15 @@ "resolved": "0.9.6", "contentHash": "HKH7tYrYYlCK1ct483hgxERAdVdMtl7gUKW9ijWXxA1UsYR4Z+TrRHYmzZ9qmpu1NnTycSrp005NYM78GDKV1w==" }, + "Speckle.Objects": { + "type": "Direct", + "requested": "[3.1.0-dev.167, )", + "resolved": "3.1.0-dev.167", + "contentHash": "VpMlOcApkQPLn90Xb5K+2nH64wN3NJ906u/YaM1oGAMw7v1SoYPbb5i03bFLuOw/Ho1KSGI0ccU82Jpi9p+n8A==", + "dependencies": { + "Speckle.Sdk": "3.1.0-dev.167" + } + }, "Tekla.Structures.Drawing": { "type": "Direct", "requested": "[2024.0.2, )", @@ -362,15 +371,6 @@ "resolved": "2.2.0", "contentHash": "B2WqEox8o+4KUOpL7rZPyh6qYjik8tHi2tN8Z9jZkHzED8ElYgZa/h6K+xliB435SqUcWT290Fr2aa8BtZjn8A==" }, - "Speckle.Objects": { - "type": "CentralTransitive", - "requested": "[3.1.0-dev.167, )", - "resolved": "3.1.0-dev.167", - "contentHash": "VpMlOcApkQPLn90Xb5K+2nH64wN3NJ906u/YaM1oGAMw7v1SoYPbb5i03bFLuOw/Ho1KSGI0ccU82Jpi9p+n8A==", - "dependencies": { - "Speckle.Sdk": "3.1.0-dev.167" - } - }, "Speckle.Sdk": { "type": "CentralTransitive", "requested": "[3.1.0-dev.167, )", From 54806f4567f4ca7318de4e1431c2fc0dffc25b40 Mon Sep 17 00:00:00 2001 From: Dogukan Karatas Date: Mon, 28 Oct 2024 13:43:03 +0100 Subject: [PATCH 23/29] updates csproj --- .../packages.lock.json | 1 + .../Speckle.Converter.Tekla2024.csproj | 3 +- .../packages.lock.json | 38 +++++++++++++++++++ 3 files changed, 40 insertions(+), 2 deletions(-) diff --git a/Connectors/Tekla/Speckle.Connector.Tekla2024/packages.lock.json b/Connectors/Tekla/Speckle.Connector.Tekla2024/packages.lock.json index ebe59080..0b9e57e3 100644 --- a/Connectors/Tekla/Speckle.Connector.Tekla2024/packages.lock.json +++ b/Connectors/Tekla/Speckle.Connector.Tekla2024/packages.lock.json @@ -441,6 +441,7 @@ "speckle.converter.tekla2024": { "type": "Project", "dependencies": { + "Speckle.Connectors.DUI": "[1.0.0, )", "Speckle.Converters.Common": "[1.0.0, )", "Speckle.Objects": "[3.1.0-dev.167, )", "Tekla.Structures.Drawing": "[2024.0.2, )", diff --git a/Converters/Tekla/Speckle.Converter.Tekla2024/Speckle.Converter.Tekla2024.csproj b/Converters/Tekla/Speckle.Converter.Tekla2024/Speckle.Converter.Tekla2024.csproj index 2a86fc4c..ceb97ee7 100644 --- a/Converters/Tekla/Speckle.Converter.Tekla2024/Speckle.Converter.Tekla2024.csproj +++ b/Converters/Tekla/Speckle.Converter.Tekla2024/Speckle.Converter.Tekla2024.csproj @@ -6,8 +6,6 @@ true Debug;Release;Local false - Speckle.Converter.Tekla2024 - Speckle.Converter.Tekla2024 @@ -18,6 +16,7 @@ + diff --git a/Converters/Tekla/Speckle.Converter.Tekla2024/packages.lock.json b/Converters/Tekla/Speckle.Converter.Tekla2024/packages.lock.json index 972c5311..e30f07c4 100644 --- a/Converters/Tekla/Speckle.Converter.Tekla2024/packages.lock.json +++ b/Converters/Tekla/Speckle.Converter.Tekla2024/packages.lock.json @@ -346,6 +346,29 @@ "Tekla.Technology.Serialization": "4.1.1" } }, + "speckle.connectors.common": { + "type": "Project", + "dependencies": { + "Microsoft.Extensions.DependencyInjection": "[2.2.0, )", + "Speckle.Connectors.Logging": "[1.0.0, )", + "Speckle.Objects": "[3.1.0-dev.167, )", + "Speckle.Sdk": "[3.1.0-dev.167, )", + "Speckle.Sdk.Dependencies": "[3.1.0-dev.167, )" + } + }, + "speckle.connectors.dui": { + "type": "Project", + "dependencies": { + "Microsoft.Extensions.Logging.Abstractions": "[2.2.0, )", + "Speckle.Connectors.Common": "[1.0.0, )", + "Speckle.Sdk": "[3.1.0-dev.167, )", + "Speckle.Sdk.Dependencies": "[3.1.0-dev.167, )", + "System.Threading.Tasks.Dataflow": "[6.0.0, )" + } + }, + "speckle.connectors.logging": { + "type": "Project" + }, "speckle.converters.common": { "type": "Project", "dependencies": { @@ -353,6 +376,15 @@ "Speckle.Objects": "[3.1.0-dev.167, )" } }, + "Microsoft.Extensions.DependencyInjection": { + "type": "CentralTransitive", + "requested": "[2.2.0, )", + "resolved": "2.2.0", + "contentHash": "MZtBIwfDFork5vfjpJdG5g8wuJFt7d/y3LOSVVtDK/76wlbtz6cjltfKHqLx2TKVqTj5/c41t77m1+h20zqtPA==", + "dependencies": { + "Microsoft.Extensions.DependencyInjection.Abstractions": "2.2.0" + } + }, "Microsoft.Extensions.Logging": { "type": "CentralTransitive", "requested": "[2.2.0, )", @@ -394,6 +426,12 @@ "resolved": "3.1.0-dev.167", "contentHash": "LOV43Wn6IYWfK+ifz/XfcYDaL5ZFF6wLVJQGgSkaNEpGOBitCg6bQc2AuNuy5QHk85dbB1QS9XXEXjeoMxugLg==" }, + "System.Threading.Tasks.Dataflow": { + "type": "CentralTransitive", + "requested": "[6.0.0, )", + "resolved": "6.0.0", + "contentHash": "+tyDCU3/B1lDdOOAJywHQoFwyXIUghIaP2BxG79uvhfTnO+D9qIgjVlL/JV2NTliYbMHpd6eKDmHp2VHpij7MA==" + }, "Tekla.Structures.Plugins": { "type": "CentralTransitive", "requested": "[2024.0.2, )", From 38d06962f6a5ccaff79a1816cd5d8f34b97f84ac Mon Sep 17 00:00:00 2001 From: Dogukan Karatas Date: Mon, 28 Oct 2024 13:55:32 +0100 Subject: [PATCH 24/29] objects package removed --- .../packages.lock.json | 2 - .../Speckle.Converter.Tekla2024.csproj | 2 - .../packages.lock.json | 56 +++---------------- 3 files changed, 9 insertions(+), 51 deletions(-) diff --git a/Connectors/Tekla/Speckle.Connector.Tekla2024/packages.lock.json b/Connectors/Tekla/Speckle.Connector.Tekla2024/packages.lock.json index 0b9e57e3..2324d793 100644 --- a/Connectors/Tekla/Speckle.Connector.Tekla2024/packages.lock.json +++ b/Connectors/Tekla/Speckle.Connector.Tekla2024/packages.lock.json @@ -441,9 +441,7 @@ "speckle.converter.tekla2024": { "type": "Project", "dependencies": { - "Speckle.Connectors.DUI": "[1.0.0, )", "Speckle.Converters.Common": "[1.0.0, )", - "Speckle.Objects": "[3.1.0-dev.167, )", "Tekla.Structures.Drawing": "[2024.0.2, )", "Tekla.Structures.Model": "[2024.0.2, )" } diff --git a/Converters/Tekla/Speckle.Converter.Tekla2024/Speckle.Converter.Tekla2024.csproj b/Converters/Tekla/Speckle.Converter.Tekla2024/Speckle.Converter.Tekla2024.csproj index ceb97ee7..54c7e376 100644 --- a/Converters/Tekla/Speckle.Converter.Tekla2024/Speckle.Converter.Tekla2024.csproj +++ b/Converters/Tekla/Speckle.Converter.Tekla2024/Speckle.Converter.Tekla2024.csproj @@ -9,14 +9,12 @@ - - diff --git a/Converters/Tekla/Speckle.Converter.Tekla2024/packages.lock.json b/Converters/Tekla/Speckle.Converter.Tekla2024/packages.lock.json index e30f07c4..cad6ec7d 100644 --- a/Converters/Tekla/Speckle.Converter.Tekla2024/packages.lock.json +++ b/Converters/Tekla/Speckle.Converter.Tekla2024/packages.lock.json @@ -33,15 +33,6 @@ "resolved": "0.9.6", "contentHash": "HKH7tYrYYlCK1ct483hgxERAdVdMtl7gUKW9ijWXxA1UsYR4Z+TrRHYmzZ9qmpu1NnTycSrp005NYM78GDKV1w==" }, - "Speckle.Objects": { - "type": "Direct", - "requested": "[3.1.0-dev.167, )", - "resolved": "3.1.0-dev.167", - "contentHash": "VpMlOcApkQPLn90Xb5K+2nH64wN3NJ906u/YaM1oGAMw7v1SoYPbb5i03bFLuOw/Ho1KSGI0ccU82Jpi9p+n8A==", - "dependencies": { - "Speckle.Sdk": "3.1.0-dev.167" - } - }, "Tekla.Structures.Drawing": { "type": "Direct", "requested": "[2024.0.2, )", @@ -346,29 +337,6 @@ "Tekla.Technology.Serialization": "4.1.1" } }, - "speckle.connectors.common": { - "type": "Project", - "dependencies": { - "Microsoft.Extensions.DependencyInjection": "[2.2.0, )", - "Speckle.Connectors.Logging": "[1.0.0, )", - "Speckle.Objects": "[3.1.0-dev.167, )", - "Speckle.Sdk": "[3.1.0-dev.167, )", - "Speckle.Sdk.Dependencies": "[3.1.0-dev.167, )" - } - }, - "speckle.connectors.dui": { - "type": "Project", - "dependencies": { - "Microsoft.Extensions.Logging.Abstractions": "[2.2.0, )", - "Speckle.Connectors.Common": "[1.0.0, )", - "Speckle.Sdk": "[3.1.0-dev.167, )", - "Speckle.Sdk.Dependencies": "[3.1.0-dev.167, )", - "System.Threading.Tasks.Dataflow": "[6.0.0, )" - } - }, - "speckle.connectors.logging": { - "type": "Project" - }, "speckle.converters.common": { "type": "Project", "dependencies": { @@ -376,15 +344,6 @@ "Speckle.Objects": "[3.1.0-dev.167, )" } }, - "Microsoft.Extensions.DependencyInjection": { - "type": "CentralTransitive", - "requested": "[2.2.0, )", - "resolved": "2.2.0", - "contentHash": "MZtBIwfDFork5vfjpJdG5g8wuJFt7d/y3LOSVVtDK/76wlbtz6cjltfKHqLx2TKVqTj5/c41t77m1+h20zqtPA==", - "dependencies": { - "Microsoft.Extensions.DependencyInjection.Abstractions": "2.2.0" - } - }, "Microsoft.Extensions.Logging": { "type": "CentralTransitive", "requested": "[2.2.0, )", @@ -403,6 +362,15 @@ "resolved": "2.2.0", "contentHash": "B2WqEox8o+4KUOpL7rZPyh6qYjik8tHi2tN8Z9jZkHzED8ElYgZa/h6K+xliB435SqUcWT290Fr2aa8BtZjn8A==" }, + "Speckle.Objects": { + "type": "CentralTransitive", + "requested": "[3.1.0-dev.167, )", + "resolved": "3.1.0-dev.167", + "contentHash": "VpMlOcApkQPLn90Xb5K+2nH64wN3NJ906u/YaM1oGAMw7v1SoYPbb5i03bFLuOw/Ho1KSGI0ccU82Jpi9p+n8A==", + "dependencies": { + "Speckle.Sdk": "3.1.0-dev.167" + } + }, "Speckle.Sdk": { "type": "CentralTransitive", "requested": "[3.1.0-dev.167, )", @@ -426,12 +394,6 @@ "resolved": "3.1.0-dev.167", "contentHash": "LOV43Wn6IYWfK+ifz/XfcYDaL5ZFF6wLVJQGgSkaNEpGOBitCg6bQc2AuNuy5QHk85dbB1QS9XXEXjeoMxugLg==" }, - "System.Threading.Tasks.Dataflow": { - "type": "CentralTransitive", - "requested": "[6.0.0, )", - "resolved": "6.0.0", - "contentHash": "+tyDCU3/B1lDdOOAJywHQoFwyXIUghIaP2BxG79uvhfTnO+D9qIgjVlL/JV2NTliYbMHpd6eKDmHp2VHpij7MA==" - }, "Tekla.Structures.Plugins": { "type": "CentralTransitive", "requested": "[2024.0.2, )", From 43d1daa5f5638f16736374e891fc79d81496659a Mon Sep 17 00:00:00 2001 From: Dogukan Karatas Date: Mon, 28 Oct 2024 15:07:31 +0100 Subject: [PATCH 25/29] Revert "adds converter project to Local.sln" This reverts commit 94fa0a2d7a066274cd63915832e9a808e5305f65. --- Local.sln | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/Local.sln b/Local.sln index 7cd9b498..e1ac6681 100644 --- a/Local.sln +++ b/Local.sln @@ -110,6 +110,10 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Speckle.Converters.Revit202 EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "2022", "2022", "{0AF38BA3-65A0-481B-8CBB-B82E406E1575}" EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Speckle.Objects", "..\speckle-sharp-sdk\src\Speckle.Objects\Speckle.Objects.csproj", "{259A84F0-2D1E-49DE-9137-93BE6858A52C}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Speckle.Sdk", "..\speckle-sharp-sdk\src\Speckle.Sdk\Speckle.Sdk.csproj", "{347CECE7-99DC-49A6-A508-7DE9907B887B}" +EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "7", "7", "{201AF4EA-F049-4332-A746-42D3413DAE08}" EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "8", "8", "{9714467A-AECB-45B5-82D8-3E7BFF6E37C8}" @@ -172,8 +176,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Speckle.Converters.Civil3d2 EndProject Project("{D954291E-2A0B-460D-934E-DC6B0785DB48}") = "Speckle.Connectors.Civil3dShared", "Connectors\Autocad\Speckle.Connectors.Civil3dShared\Speckle.Connectors.Civil3dShared.shproj", "{EFD01520-93E8-4CCA-8E03-9CDC635F55F4}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Speckle.Converter.Tekla2024", "Converters\Tekla\Speckle.Converter.Tekla2024\Speckle.Converter.Tekla2024.csproj", "{EDC39963-C893-4E3E-8857-F1999301BD1D}" -EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -331,6 +333,18 @@ Global {19424B55-058C-4E9C-B86F-700AEF9EAEC3}.Local|Any CPU.Build.0 = Local|Any CPU {19424B55-058C-4E9C-B86F-700AEF9EAEC3}.Release|Any CPU.ActiveCfg = Release|Any CPU {19424B55-058C-4E9C-B86F-700AEF9EAEC3}.Release|Any CPU.Build.0 = Release|Any CPU + {259A84F0-2D1E-49DE-9137-93BE6858A52C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {259A84F0-2D1E-49DE-9137-93BE6858A52C}.Debug|Any CPU.Build.0 = Debug|Any CPU + {259A84F0-2D1E-49DE-9137-93BE6858A52C}.Local|Any CPU.ActiveCfg = Local|Any CPU + {259A84F0-2D1E-49DE-9137-93BE6858A52C}.Local|Any CPU.Build.0 = Local|Any CPU + {259A84F0-2D1E-49DE-9137-93BE6858A52C}.Release|Any CPU.ActiveCfg = Release|Any CPU + {259A84F0-2D1E-49DE-9137-93BE6858A52C}.Release|Any CPU.Build.0 = Release|Any CPU + {347CECE7-99DC-49A6-A508-7DE9907B887B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {347CECE7-99DC-49A6-A508-7DE9907B887B}.Debug|Any CPU.Build.0 = Debug|Any CPU + {347CECE7-99DC-49A6-A508-7DE9907B887B}.Local|Any CPU.ActiveCfg = Local|Any CPU + {347CECE7-99DC-49A6-A508-7DE9907B887B}.Local|Any CPU.Build.0 = Local|Any CPU + {347CECE7-99DC-49A6-A508-7DE9907B887B}.Release|Any CPU.ActiveCfg = Release|Any CPU + {347CECE7-99DC-49A6-A508-7DE9907B887B}.Release|Any CPU.Build.0 = Release|Any CPU {6F3FD892-6315-4F75-BFBD-843A489F8B94}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {6F3FD892-6315-4F75-BFBD-843A489F8B94}.Debug|Any CPU.Build.0 = Debug|Any CPU {6F3FD892-6315-4F75-BFBD-843A489F8B94}.Local|Any CPU.ActiveCfg = Local|Any CPU @@ -451,12 +465,6 @@ Global {AE75B68F-3594-403B-9719-9C36DA0E3F8A}.Local|Any CPU.Build.0 = Local|Any CPU {AE75B68F-3594-403B-9719-9C36DA0E3F8A}.Release|Any CPU.ActiveCfg = Release|Any CPU {AE75B68F-3594-403B-9719-9C36DA0E3F8A}.Release|Any CPU.Build.0 = Release|Any CPU - {EDC39963-C893-4E3E-8857-F1999301BD1D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {EDC39963-C893-4E3E-8857-F1999301BD1D}.Debug|Any CPU.Build.0 = Debug|Any CPU - {EDC39963-C893-4E3E-8857-F1999301BD1D}.Local|Any CPU.ActiveCfg = Local|Any CPU - {EDC39963-C893-4E3E-8857-F1999301BD1D}.Local|Any CPU.Build.0 = Local|Any CPU - {EDC39963-C893-4E3E-8857-F1999301BD1D}.Release|Any CPU.ActiveCfg = Release|Any CPU - {EDC39963-C893-4E3E-8857-F1999301BD1D}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -535,7 +543,6 @@ Global {1F93164A-42EE-4D72-B7CD-9CA831F60E09} = {B32A4121-C9A1-4098-81CD-D799E1491F54} {AE75B68F-3594-403B-9719-9C36DA0E3F8A} = {48B7AC68-AA4D-4B36-A5DE-7F19607892A6} {EFD01520-93E8-4CCA-8E03-9CDC635F55F4} = {6186EF63-4978-4FA9-9893-7074F9FD0BA4} - {EDC39963-C893-4E3E-8857-F1999301BD1D} = {AB1AD13B-163E-45F8-8F96-52A921501FA0} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {EE253116-7070-4E9A-BCE8-2911C251B8C8} From ba104ffed4b5bb1e1dabe1d16f944339f18a4d1f Mon Sep 17 00:00:00 2001 From: Dogukan Karatas Date: Mon, 28 Oct 2024 15:39:30 +0100 Subject: [PATCH 26/29] updates local.sln --- .../Speckle.Connector.Tekla2024.csproj | 1 - .../Speckle.Connector.Tekla2024/SpeckleTeklaPanelHost.cs | 6 ++---- Local.sln | 9 +++++++++ 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/Connectors/Tekla/Speckle.Connector.Tekla2024/Speckle.Connector.Tekla2024.csproj b/Connectors/Tekla/Speckle.Connector.Tekla2024/Speckle.Connector.Tekla2024.csproj index 9a0583bd..c71eae94 100644 --- a/Connectors/Tekla/Speckle.Connector.Tekla2024/Speckle.Connector.Tekla2024.csproj +++ b/Connectors/Tekla/Speckle.Connector.Tekla2024/Speckle.Connector.Tekla2024.csproj @@ -24,7 +24,6 @@ - diff --git a/Connectors/Tekla/Speckle.Connector.Tekla2024/SpeckleTeklaPanelHost.cs b/Connectors/Tekla/Speckle.Connector.Tekla2024/SpeckleTeklaPanelHost.cs index 3767461c..3c35c2e1 100644 --- a/Connectors/Tekla/Speckle.Connector.Tekla2024/SpeckleTeklaPanelHost.cs +++ b/Connectors/Tekla/Speckle.Connector.Tekla2024/SpeckleTeklaPanelHost.cs @@ -23,8 +23,6 @@ public class SpeckleTeklaPanelHost : PluginFormBase public SpeckleTeklaPanelHost() { - Show(); - var services = new ServiceCollection(); services.Initialize(HostApplications.TeklaStructures, GetVersion()); services.AddTekla(); @@ -50,9 +48,9 @@ public SpeckleTeklaPanelHost() Controls.Add(Host); Operation.DisplayPrompt("Speckle connector initialized."); - // below methods are not really needed + Show(); Activate(); - //Focus(); + Focus(); } private HostAppVersion GetVersion() diff --git a/Local.sln b/Local.sln index e1ac6681..54a2216b 100644 --- a/Local.sln +++ b/Local.sln @@ -176,6 +176,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Speckle.Converters.Civil3d2 EndProject Project("{D954291E-2A0B-460D-934E-DC6B0785DB48}") = "Speckle.Connectors.Civil3dShared", "Connectors\Autocad\Speckle.Connectors.Civil3dShared\Speckle.Connectors.Civil3dShared.shproj", "{EFD01520-93E8-4CCA-8E03-9CDC635F55F4}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Speckle.Converter.Tekla2024", "Converters\Tekla\Speckle.Converter.Tekla2024\Speckle.Converter.Tekla2024.csproj", "{FBE49C59-F69E-4809-BB3A-F150BC408BB4}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -465,6 +467,12 @@ Global {AE75B68F-3594-403B-9719-9C36DA0E3F8A}.Local|Any CPU.Build.0 = Local|Any CPU {AE75B68F-3594-403B-9719-9C36DA0E3F8A}.Release|Any CPU.ActiveCfg = Release|Any CPU {AE75B68F-3594-403B-9719-9C36DA0E3F8A}.Release|Any CPU.Build.0 = Release|Any CPU + {FBE49C59-F69E-4809-BB3A-F150BC408BB4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {FBE49C59-F69E-4809-BB3A-F150BC408BB4}.Debug|Any CPU.Build.0 = Debug|Any CPU + {FBE49C59-F69E-4809-BB3A-F150BC408BB4}.Local|Any CPU.ActiveCfg = Local|Any CPU + {FBE49C59-F69E-4809-BB3A-F150BC408BB4}.Local|Any CPU.Build.0 = Local|Any CPU + {FBE49C59-F69E-4809-BB3A-F150BC408BB4}.Release|Any CPU.ActiveCfg = Release|Any CPU + {FBE49C59-F69E-4809-BB3A-F150BC408BB4}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -543,6 +551,7 @@ Global {1F93164A-42EE-4D72-B7CD-9CA831F60E09} = {B32A4121-C9A1-4098-81CD-D799E1491F54} {AE75B68F-3594-403B-9719-9C36DA0E3F8A} = {48B7AC68-AA4D-4B36-A5DE-7F19607892A6} {EFD01520-93E8-4CCA-8E03-9CDC635F55F4} = {6186EF63-4978-4FA9-9893-7074F9FD0BA4} + {FBE49C59-F69E-4809-BB3A-F150BC408BB4} = {AB1AD13B-163E-45F8-8F96-52A921501FA0} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {EE253116-7070-4E9A-BCE8-2911C251B8C8} From a2e59c1cd44fd0bf4e0c59d44f61971e860f619f Mon Sep 17 00:00:00 2001 From: Dogukan Karatas Date: Mon, 28 Oct 2024 20:40:30 +0100 Subject: [PATCH 27/29] removed unnecessary container initialization --- .../Tekla/Speckle.Connector.Tekla2024/SpeckleTeklaPanelHost.cs | 2 -- 1 file changed, 2 deletions(-) diff --git a/Connectors/Tekla/Speckle.Connector.Tekla2024/SpeckleTeklaPanelHost.cs b/Connectors/Tekla/Speckle.Connector.Tekla2024/SpeckleTeklaPanelHost.cs index 3c35c2e1..4fa962c5 100644 --- a/Connectors/Tekla/Speckle.Connector.Tekla2024/SpeckleTeklaPanelHost.cs +++ b/Connectors/Tekla/Speckle.Connector.Tekla2024/SpeckleTeklaPanelHost.cs @@ -2,7 +2,6 @@ using System.Windows.Forms.Integration; using Microsoft.Extensions.DependencyInjection; using Speckle.Connectors.Common; -using Speckle.Connectors.DUI; using Speckle.Connectors.DUI.WebView; using Speckle.Converter.Tekla2024; using Speckle.Sdk.Host; @@ -31,7 +30,6 @@ public SpeckleTeklaPanelHost() // TODO: Add Tekla converters Container = services.BuildServiceProvider(); - Container.UseDUI(); // TODO: this might not needed? ISyncToThread? Model = new Model(); // don't know what is this.. if (!Model.GetConnectionStatus()) From c4fcd9495c13ed895c7d04684bbd987d8f7aa19a Mon Sep 17 00:00:00 2001 From: Dogukan Karatas Date: Mon, 28 Oct 2024 20:47:40 +0100 Subject: [PATCH 28/29] deactivated the argb attach to mesh --- .../ToSpeckle/Raw/BeamRawConverter.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Converters/Tekla/Speckle.Converter.Tekla2024/ToSpeckle/Raw/BeamRawConverter.cs b/Converters/Tekla/Speckle.Converter.Tekla2024/ToSpeckle/Raw/BeamRawConverter.cs index 765e8b38..3456fd47 100644 --- a/Converters/Tekla/Speckle.Converter.Tekla2024/ToSpeckle/Raw/BeamRawConverter.cs +++ b/Converters/Tekla/Speckle.Converter.Tekla2024/ToSpeckle/Raw/BeamRawConverter.cs @@ -34,7 +34,10 @@ public Base Convert(TSM.Beam target) var solid = target.GetSolid(); var mesh = _meshConverter.Convert(solid); - + + // poc for argb value fetch from tekla + // should be replaced by proxy implementation + /* var color = new TSMUI.Color(); TSMUI.ModelObjectVisualization.GetRepresentation(target, ref color); @@ -50,6 +53,7 @@ public Base Convert(TSM.Beam target) { mesh.colors.Add(argb); } + */ beamObject["displayValue"] = new List { mesh }; From 4ac3e9859743d7b358527ee78087d76aae0680f8 Mon Sep 17 00:00:00 2001 From: Dogukan Karatas Date: Mon, 28 Oct 2024 20:54:17 +0100 Subject: [PATCH 29/29] formatted one last time (hopefully) --- Converters/Tekla/Speckle.Converter.Tekla2024/GlobalUsing.cs | 1 - .../ToSpeckle/Raw/BeamRawConverter.cs | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/Converters/Tekla/Speckle.Converter.Tekla2024/GlobalUsing.cs b/Converters/Tekla/Speckle.Converter.Tekla2024/GlobalUsing.cs index 1ee6d9a2..1881675f 100644 --- a/Converters/Tekla/Speckle.Converter.Tekla2024/GlobalUsing.cs +++ b/Converters/Tekla/Speckle.Converter.Tekla2024/GlobalUsing.cs @@ -1,3 +1,2 @@ global using TG = Tekla.Structures.Geometry3d; global using TSM = Tekla.Structures.Model; -global using TSMUI = Tekla.Structures.Model.UI; diff --git a/Converters/Tekla/Speckle.Converter.Tekla2024/ToSpeckle/Raw/BeamRawConverter.cs b/Converters/Tekla/Speckle.Converter.Tekla2024/ToSpeckle/Raw/BeamRawConverter.cs index 3456fd47..30d69a46 100644 --- a/Converters/Tekla/Speckle.Converter.Tekla2024/ToSpeckle/Raw/BeamRawConverter.cs +++ b/Converters/Tekla/Speckle.Converter.Tekla2024/ToSpeckle/Raw/BeamRawConverter.cs @@ -34,7 +34,7 @@ public Base Convert(TSM.Beam target) var solid = target.GetSolid(); var mesh = _meshConverter.Convert(solid); - + // poc for argb value fetch from tekla // should be replaced by proxy implementation /*