Skip to content

Commit

Permalink
Merge pull request #359 from specklesystems/dev
Browse files Browse the repository at this point in the history
Update `release/3.0.0` with changes from `dev`
  • Loading branch information
AlanRynne authored Nov 6, 2024
2 parents 6671edd + a1ff695 commit 8060f46
Show file tree
Hide file tree
Showing 7 changed files with 73 additions and 19 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,5 @@ tools
.DS_Store
*.snupkg
coverage.xml
output/
output/
Images/Thumbs.db
3 changes: 2 additions & 1 deletion Build/Consts.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@ public static class Consts
new("Connectors/Autocad/Speckle.Connectors.Civil3d2024", "net48"),
new("Connectors/Autocad/Speckle.Connectors.Civil3d2025", "net8.0-windows")
]
)
),
new("tekla-structures", [new("Connectors/Tekla/Speckle.Connector.Tekla2024", "net48")])
};
}

Expand Down
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,37 @@

<PropertyGroup>
<TargetFramework>net48</TargetFramework>
<TeklaVersion>2024</TeklaVersion>
<UseWpf>true</UseWpf>
<DefineConstants>$(DefineConstants);TEKLA2024</DefineConstants>
<PostBuildEvent>RD /S /Q "$(TargetDir)arm64\"
if EXIST "C:\Program Files\Tekla Structures\2024.0\" (
xcopy "$(TargetDir)*.*" "C:\ProgramData\Trimble\Tekla Structures\2024.0\Environments\common\extensions\Speckle3TeklaStructures" /Y /I /E
)
if EXIST "C:\TeklaStructures\2024.0\" (
xcopy "$(TargetDir)*.*" "C:\TeklaStructures\2024.0\Environments\common\extensions\Speckle3TeklaStructures" /Y /I /E
)
</PostBuildEvent>
</PropertyGroup>

<Target AfterTargets="Build" Name="AfterBuildTekla" Condition="'$(TeklaVersion)' != '' And '$(ContinuousIntegrationBuild)' != 'true'">
<ItemGroup>
<TeklaDlls Include="$(TargetDir)\**\*.*" Exclude="$(TargetDir)*.bmp" />
<TeklaBmp Include="$(TargetDir)\Assets\et_element_Speckle.bmp"/>
</ItemGroup>

<Message Text="TeklaVersion $(TeklaVersion)" Importance="high"/>
<Copy Condition="Exists('$(ProgramData)\Trimble\Tekla Structures\$(TeklaVersion).0')"
DestinationFolder="$(ProgramData)\Trimble\Tekla Structures\$(TeklaVersion).0\Environments\common\extensions\Speckle3TeklaStructures\%(RecursiveDir)"
SourceFiles="@(TeklaDlls)" />
<Copy Condition="Exists('$(ProgramData)\Trimble\Tekla Structures\$(TeklaVersion).0')"
DestinationFolder="$(ProgramData)\Trimble\Tekla Structures\$(TeklaVersion).0\Bitmaps"
SourceFiles="@(TeklaBmp)" />

<Copy Condition="Exists('C:\TeklaStructures\2024.0')"
DestinationFolder="C:\TeklaStructures\2024.0\Environments\common\extensions\Speckle3TeklaStructures\%(RecursiveDir)"
SourceFiles="@(TeklaDlls)" />
<Copy Condition="Exists('C:\TeklaStructures\2024.0')"
DestinationFolder="$(ProgramFiles)\TeklaStructures\2024.0\bin\Env\Bitmaps"
SourceFiles="@(TeklaBmp)" />
</Target>

<ItemGroup>
<PackageReference Include="Speckle.Objects" />
<PackageReference Include="Tekla.Structures.Dialog" IncludeAssets="compile; build" PrivateAssets="all" />
<PackageReference Include="Tekla.Structures.Drawing" />
<PackageReference Include="Tekla.Structures.Drawing" IncludeAssets="compile; build" PrivateAssets="all"/>
<PackageReference Include="Tekla.Structures.Model" IncludeAssets="compile; build" PrivateAssets="all" />
<PackageReference Include="Tekla.Structures.Plugins" IncludeAssets="compile; build" PrivateAssets="all" />
</ItemGroup>
Expand All @@ -31,4 +46,10 @@
<Reference Include="WindowsFormsIntegration" />
</ItemGroup>

<ItemGroup>
<None Update="Assets\et_element_Speckle.bmp">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,8 @@ public IGisFeature Convert((Row, string) target)
return new SGIS.GisPointFeature()
{
geometry = new() { specklePoint },
attributes = attributes
attributes = attributes,
applicationId = appId
};

case ACG.Multipoint multipoint:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
using Speckle.Converters.Common;
using Speckle.Converters.Common.Objects;
using Speckle.Sdk.Models;

Expand All @@ -7,15 +6,18 @@ namespace Speckle.Converter.Tekla2024.ToSpeckle.Helpers;
public sealed class DisplayValueExtractor
{
private readonly ITypedConverter<TSM.Solid, SOG.Mesh> _meshConverter;
private readonly IConverterSettingsStore<TeklaConversionSettings> _settingsStore;
private readonly ITypedConverter<TG.LineSegment, SOG.Line> _lineConverter;
private readonly ITypedConverter<TG.Arc, SOG.Arc> _arcConverter;

public DisplayValueExtractor(
ITypedConverter<TSM.Solid, SOG.Mesh> meshConverter,
IConverterSettingsStore<TeklaConversionSettings> settingsStore
ITypedConverter<TG.LineSegment, SOG.Line> lineConverter,
ITypedConverter<TG.Arc, SOG.Arc> arcConverter
)
{
_meshConverter = meshConverter;
_settingsStore = settingsStore;
_lineConverter = lineConverter;
_arcConverter = arcConverter;
}

public IEnumerable<Base> GetDisplayValue(TSM.ModelObject modelObject)
Expand All @@ -38,13 +40,40 @@ public IEnumerable<Base> GetDisplayValue(TSM.ModelObject modelObject)
}
break;

// this is the logic to send rebars as lines and arcs
case TSM.Reinforcement reinforcement:
if (reinforcement.GetSolid() is TSM.Solid reinforcementSolid)
var rebarGeometries = reinforcement.GetRebarComplexGeometries(
withHooks: true,
withoutClashes: true,
lengthAdjustments: true,
TSM.Reinforcement.RebarGeometrySimplificationTypeEnum.RATIONALIZED
);

foreach (TSM.RebarComplexGeometry barGeometry in rebarGeometries)
{
yield return _meshConverter.Convert(reinforcementSolid);
foreach (var leg in barGeometry.Legs)
{
if (leg.Curve is TG.LineSegment legLine)
{
yield return _lineConverter.Convert(legLine);
}
else if (leg.Curve is TG.Arc legArc)
{
yield return _arcConverter.Convert(legArc);
}
}
}

break;

// we can switch to volumetric using the logic below
// case TSM.Reinforcement reinforcement:
// if (reinforcement.GetSolid() is TSM.Solid reinforcementSolid)
// {
// yield return _meshConverter.Convert(reinforcementSolid);
// }
// break;

default:
yield break;
}
Expand Down
3 changes: 2 additions & 1 deletion Sdk/Speckle.Connectors.Tests/ProgressDisplayManagerTests.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using FluentAssertions;
using FluentAssertions;
using NUnit.Framework;
using Speckle.Connectors.Common.Operations;
using Speckle.Sdk.Transports;
Expand All @@ -21,6 +21,7 @@ public void TestPercentage(long count, long? total, double? percentage)
}

[Test]
[SetCulture("en-GB")]
[TestCase(1, 1, 6, 10, "5.00 bytes / sec")]
[TestCase(1, 0, 6, 10, "0 bytes / sec")] //infinity
[TestCase(1 * 1024 * 1024, 1, 6 * 1024 * 1024, 10 * 1024 * 1024, "5.00 MB / sec")]
Expand Down

0 comments on commit 8060f46

Please sign in to comment.