feat: direct shape name (#846)

This commit is contained in:
Björn Steinhagen
2025-05-20 10:24:48 +02:00
committed by GitHub
parent 84f6f3fbe6
commit 0b136663e4
@@ -5,6 +5,7 @@ using Speckle.DoubleNumerics;
using Speckle.Objects.Data;
using Speckle.Sdk.Common;
using Speckle.Sdk.Models;
using Speckle.Sdk.Models.Extensions;
namespace Speckle.Converters.RevitShared.ToSpeckle;
@@ -59,6 +60,15 @@ public class LocalToGlobalToDirectShapeConverter
// 2 - init DirectShape
var result = DB.DirectShape.CreateElement(_converterSettings.Current.Document, new DB.ElementId(dsCategory));
// NOTE: this should technically be in a property extraction class / helper method
// This change is localised to [CNX-1825](https://linear.app/speckle/issue/CNX-1825/set-directshape-name)
// TODO: Property extraction is a greater conversation which needs to be had: [CNX-1830](https://linear.app/speckle/issue/CNX-1830/data-exchange-investigations)
var name = target.atomicObject.TryGetName();
if (name is not null)
{
result.SetName(name);
}
// If there is no transforms to be applied, use the simple way of creating direct shapes
if (target.matrix.Count == 0)
{