From 94104c23651aef986e73d1eb1a6a42338a8c7569 Mon Sep 17 00:00:00 2001 From: Adam Hathcock Date: Fri, 10 Jan 2025 13:59:59 +0000 Subject: [PATCH 01/11] NameAndRankValue now uses a type to get FullName to avoid conflicts (#475) * NameAndRankValue now uses a type to get FullName to avoid conflicts * Full namespace for tests --- .../ToHost/TopLevel/ArcToHostConverter.cs | 2 +- .../ToHost/TopLevel/CircleToHostConverter.cs | 2 +- .../ToHost/TopLevel/EllipseToHostConverter.cs | 2 +- .../ToHost/TopLevel/FallbackToHostConverter.cs | 2 +- .../ToHost/TopLevel/LineToHostConverter.cs | 2 +- .../ToHost/TopLevel/MeshToHostConverter.cs | 2 +- .../ToHost/TopLevel/PointToHostConverter.cs | 2 +- .../TopLevel/PolycurveToHostConverter.cs | 2 +- .../ToHost/TopLevel/PolylineToHostConverter.cs | 2 +- ...oreObjectsBaseToSpeckleTopLevelConverter.cs | 2 +- .../ToHost/Geometry/ArcToHostConverter.cs | 2 +- .../AutocadPolycurveToHostConverter.cs | 2 +- .../ToHost/Geometry/CircleToHostConverter.cs | 2 +- .../ToHost/Geometry/CurveToHostConverter.cs | 2 +- .../ToHost/Geometry/DataObjectConverter.cs | 2 +- .../ToHost/Geometry/EllipseToHostConverter.cs | 2 +- .../ToHost/Geometry/LineToHostConverter.cs | 2 +- .../ToHost/Geometry/MeshToHostConverter.cs | 2 +- .../ToHost/Geometry/PointToHostConverter.cs | 2 +- .../Geometry/PolycurveToHostConverter.cs | 2 +- .../ToHost/Geometry/PolylineToHostConverter.cs | 2 +- .../ToHost/Raw/ArcToHostRawConverter.cs | 2 +- .../Geometry/ArcToSpeckleConverter.cs | 2 +- .../Geometry/CircleToSpeckleConverter.cs | 2 +- .../Geometry/EllipseToSpeckleConverter.cs | 2 +- .../Geometry/LineToSpeckleConverter.cs | 2 +- .../Geometry/PointToSpeckleConverter.cs | 2 +- .../Geometry/PolyfaceMeshToSpeckleConverter.cs | 2 +- .../Geometry/Polyline2dToSpeckleConverter.cs | 2 +- .../Geometry/Polyline3dToSpeckleConverter.cs | 2 +- .../Geometry/PolylineToSpeckleConverter.cs | 2 +- .../Geometry/RegionToSpeckleConverter.cs | 2 +- .../Geometry/Solid3dToSpeckleConverter.cs | 2 +- .../Geometry/SplineToSpeckleConverter.cs | 2 +- .../Geometry/SubDMeshToSpeckleConverter.cs | 2 +- .../Geometry/SurfaceToSpeckleConverter.cs | 2 +- .../TopLevel/EtabsObjectToSpeckleConverter.cs | 2 +- .../CivilEntityToSpeckleTopLevelConverter.cs | 2 +- .../ModelItemTopLevelConverterToSpeckle.cs | 2 +- .../ModelCurveToSpeckleTopLevelConverter.cs | 2 +- .../PointcloudTopLevelConverterToSpeckle.cs | 2 +- .../RevitElementTopLevelConverterToSpeckle.cs | 2 +- .../TopLevel/ArcToHostTopLevelConverter.cs | 2 +- .../TopLevel/BrepToHostTopLevelConverter.cs | 2 +- .../TopLevel/BrepXToHostTopLevelConverter.cs | 6 +++--- .../TopLevel/CircleToHostTopLevelConverter.cs | 2 +- .../ToHost/TopLevel/DataObjectConverter.cs | 2 +- ...DisplayableObjectToHostTopLevelConverter.cs | 2 +- .../TopLevel/EllipseToHostTopLevelConverter.cs | 2 +- .../TopLevel/LineToHostTopLevelConverter.cs | 2 +- .../TopLevel/MeshToHostTopLevelConverter.cs | 2 +- .../NurbsCurveToHostTopLevelConverter.cs | 2 +- .../PointCloudToHostTopLevelConverter.cs | 2 +- .../TopLevel/PointToHostTopLevelConverter.cs | 2 +- .../PolycurveToHostTopLevelConverter.cs | 2 +- .../PolylineToHostTopLevelConverter.cs | 2 +- .../ToSpeckle/Raw/MeshToSpeckleConverter.cs | 2 +- .../BrepObjectToSpeckleTopLevelConverter.cs | 2 +- .../CurveObjectToSpeckleTopLevelConverter.cs | 2 +- ...xtrusionObjectToSpeckleTopLevelConverter.cs | 2 +- .../MeshObjectToSpeckleTopLevelConverter.cs | 2 +- ...intCloudObjectToSpeckleTopLevelConverter.cs | 2 +- .../PointObjectToSpeckleTopLevelConverter.cs | 2 +- .../SubDObjectToSpeckleTopLevelConverter.cs | 2 +- .../TopLevel/ModelObjectToSpeckleConverter.cs | 2 +- .../ConverterManagerTests.cs | 4 ++-- .../NameAndRankValueAttribute.cs | 12 +++--------- .../Registration/ConverterManager.cs | 7 ++++--- .../Registration/ServiceRegistration.cs | 18 +++++++++--------- 69 files changed, 85 insertions(+), 90 deletions(-) diff --git a/Converters/ArcGIS/Speckle.Converters.ArcGIS3/ToHost/TopLevel/ArcToHostConverter.cs b/Converters/ArcGIS/Speckle.Converters.ArcGIS3/ToHost/TopLevel/ArcToHostConverter.cs index 83db8e40d..70656c175 100644 --- a/Converters/ArcGIS/Speckle.Converters.ArcGIS3/ToHost/TopLevel/ArcToHostConverter.cs +++ b/Converters/ArcGIS/Speckle.Converters.ArcGIS3/ToHost/TopLevel/ArcToHostConverter.cs @@ -4,7 +4,7 @@ namespace Speckle.Converters.ArcGIS3.ToHost.TopLevel; -[NameAndRankValue(nameof(SOG.Arc), NameAndRankValueAttribute.SPECKLE_DEFAULT_RANK)] +[NameAndRankValue(typeof(SOG.Arc), NameAndRankValueAttribute.SPECKLE_DEFAULT_RANK)] public class ArcToHostConverter : IToHostTopLevelConverter, ITypedConverter { private readonly ITypedConverter _pointConverter; diff --git a/Converters/ArcGIS/Speckle.Converters.ArcGIS3/ToHost/TopLevel/CircleToHostConverter.cs b/Converters/ArcGIS/Speckle.Converters.ArcGIS3/ToHost/TopLevel/CircleToHostConverter.cs index 993f84d9a..758d6a42f 100644 --- a/Converters/ArcGIS/Speckle.Converters.ArcGIS3/ToHost/TopLevel/CircleToHostConverter.cs +++ b/Converters/ArcGIS/Speckle.Converters.ArcGIS3/ToHost/TopLevel/CircleToHostConverter.cs @@ -5,7 +5,7 @@ namespace Speckle.Converters.ArcGIS3.ToHost.TopLevel; -[NameAndRankValue(nameof(SOG.Circle), NameAndRankValueAttribute.SPECKLE_DEFAULT_RANK)] +[NameAndRankValue(typeof(SOG.Circle), NameAndRankValueAttribute.SPECKLE_DEFAULT_RANK)] public class CircleToHostConverter : IToHostTopLevelConverter, ITypedConverter { private readonly ITypedConverter _pointConverter; diff --git a/Converters/ArcGIS/Speckle.Converters.ArcGIS3/ToHost/TopLevel/EllipseToHostConverter.cs b/Converters/ArcGIS/Speckle.Converters.ArcGIS3/ToHost/TopLevel/EllipseToHostConverter.cs index 27b87b537..7ca52d1eb 100644 --- a/Converters/ArcGIS/Speckle.Converters.ArcGIS3/ToHost/TopLevel/EllipseToHostConverter.cs +++ b/Converters/ArcGIS/Speckle.Converters.ArcGIS3/ToHost/TopLevel/EllipseToHostConverter.cs @@ -5,7 +5,7 @@ namespace Speckle.Converters.ArcGIS3.ToHost.TopLevel; -[NameAndRankValue(nameof(SOG.Ellipse), NameAndRankValueAttribute.SPECKLE_DEFAULT_RANK)] +[NameAndRankValue(typeof(SOG.Ellipse), NameAndRankValueAttribute.SPECKLE_DEFAULT_RANK)] public class EllipseToHostConverter : IToHostTopLevelConverter, ITypedConverter { private readonly ITypedConverter _pointConverter; diff --git a/Converters/ArcGIS/Speckle.Converters.ArcGIS3/ToHost/TopLevel/FallbackToHostConverter.cs b/Converters/ArcGIS/Speckle.Converters.ArcGIS3/ToHost/TopLevel/FallbackToHostConverter.cs index 730dd09ab..b75d9b01b 100644 --- a/Converters/ArcGIS/Speckle.Converters.ArcGIS3/ToHost/TopLevel/FallbackToHostConverter.cs +++ b/Converters/ArcGIS/Speckle.Converters.ArcGIS3/ToHost/TopLevel/FallbackToHostConverter.cs @@ -6,7 +6,7 @@ namespace Speckle.Converters.ArcGIS3.ToHost.TopLevel; -[NameAndRankValue(nameof(DisplayableObject), NameAndRankValueAttribute.SPECKLE_DEFAULT_RANK)] +[NameAndRankValue(typeof(DisplayableObject), NameAndRankValueAttribute.SPECKLE_DEFAULT_RANK)] public class FallbackToHostConverter : IToHostTopLevelConverter, ITypedConverter { private readonly ITypedConverter, ACG.Multipatch> _meshListConverter; diff --git a/Converters/ArcGIS/Speckle.Converters.ArcGIS3/ToHost/TopLevel/LineToHostConverter.cs b/Converters/ArcGIS/Speckle.Converters.ArcGIS3/ToHost/TopLevel/LineToHostConverter.cs index 47e6b5c9d..ec19f153c 100644 --- a/Converters/ArcGIS/Speckle.Converters.ArcGIS3/ToHost/TopLevel/LineToHostConverter.cs +++ b/Converters/ArcGIS/Speckle.Converters.ArcGIS3/ToHost/TopLevel/LineToHostConverter.cs @@ -4,7 +4,7 @@ namespace Speckle.Converters.ArcGIS3.ToHost.TopLevel; -[NameAndRankValue(nameof(SOG.Line), NameAndRankValueAttribute.SPECKLE_DEFAULT_RANK)] +[NameAndRankValue(typeof(SOG.Line), NameAndRankValueAttribute.SPECKLE_DEFAULT_RANK)] public class LineSingleToHostConverter : IToHostTopLevelConverter, ITypedConverter { private readonly ITypedConverter _pointConverter; diff --git a/Converters/ArcGIS/Speckle.Converters.ArcGIS3/ToHost/TopLevel/MeshToHostConverter.cs b/Converters/ArcGIS/Speckle.Converters.ArcGIS3/ToHost/TopLevel/MeshToHostConverter.cs index cbb55f3ce..123c79c84 100644 --- a/Converters/ArcGIS/Speckle.Converters.ArcGIS3/ToHost/TopLevel/MeshToHostConverter.cs +++ b/Converters/ArcGIS/Speckle.Converters.ArcGIS3/ToHost/TopLevel/MeshToHostConverter.cs @@ -4,7 +4,7 @@ namespace Speckle.Converters.ArcGIS3.ToHost.TopLevel; -[NameAndRankValue(nameof(SOG.Mesh), NameAndRankValueAttribute.SPECKLE_DEFAULT_RANK)] +[NameAndRankValue(typeof(SOG.Mesh), NameAndRankValueAttribute.SPECKLE_DEFAULT_RANK)] public class MeshToHostConverter : IToHostTopLevelConverter, ITypedConverter { private readonly ITypedConverter, ACG.Multipatch> _meshConverter; diff --git a/Converters/ArcGIS/Speckle.Converters.ArcGIS3/ToHost/TopLevel/PointToHostConverter.cs b/Converters/ArcGIS/Speckle.Converters.ArcGIS3/ToHost/TopLevel/PointToHostConverter.cs index 6f7bd23f0..ef00a9307 100644 --- a/Converters/ArcGIS/Speckle.Converters.ArcGIS3/ToHost/TopLevel/PointToHostConverter.cs +++ b/Converters/ArcGIS/Speckle.Converters.ArcGIS3/ToHost/TopLevel/PointToHostConverter.cs @@ -4,7 +4,7 @@ namespace Speckle.Converters.ArcGIS3.ToHost.TopLevel; -[NameAndRankValue(nameof(SOG.Point), NameAndRankValueAttribute.SPECKLE_DEFAULT_RANK)] +[NameAndRankValue(typeof(SOG.Point), NameAndRankValueAttribute.SPECKLE_DEFAULT_RANK)] public class PointToHostConverter : IToHostTopLevelConverter { private readonly ITypedConverter, ACG.Multipoint> _pointConverter; diff --git a/Converters/ArcGIS/Speckle.Converters.ArcGIS3/ToHost/TopLevel/PolycurveToHostConverter.cs b/Converters/ArcGIS/Speckle.Converters.ArcGIS3/ToHost/TopLevel/PolycurveToHostConverter.cs index fbda9459b..003bc2fa1 100644 --- a/Converters/ArcGIS/Speckle.Converters.ArcGIS3/ToHost/TopLevel/PolycurveToHostConverter.cs +++ b/Converters/ArcGIS/Speckle.Converters.ArcGIS3/ToHost/TopLevel/PolycurveToHostConverter.cs @@ -5,7 +5,7 @@ namespace Speckle.Converters.ArcGIS3.ToHost.TopLevel; -[NameAndRankValue(nameof(SOG.Polycurve), NameAndRankValueAttribute.SPECKLE_DEFAULT_RANK)] +[NameAndRankValue(typeof(SOG.Polycurve), NameAndRankValueAttribute.SPECKLE_DEFAULT_RANK)] public class PolycurveToHostConverter : IToHostTopLevelConverter, ITypedConverter { private readonly IRootToHostConverter _converter; diff --git a/Converters/ArcGIS/Speckle.Converters.ArcGIS3/ToHost/TopLevel/PolylineToHostConverter.cs b/Converters/ArcGIS/Speckle.Converters.ArcGIS3/ToHost/TopLevel/PolylineToHostConverter.cs index b6842cdc9..38e5dcbd4 100644 --- a/Converters/ArcGIS/Speckle.Converters.ArcGIS3/ToHost/TopLevel/PolylineToHostConverter.cs +++ b/Converters/ArcGIS/Speckle.Converters.ArcGIS3/ToHost/TopLevel/PolylineToHostConverter.cs @@ -4,7 +4,7 @@ namespace Speckle.Converters.ArcGIS3.ToHost.TopLevel; -[NameAndRankValue(nameof(SOG.Polyline), NameAndRankValueAttribute.SPECKLE_DEFAULT_RANK)] +[NameAndRankValue(typeof(SOG.Polyline), NameAndRankValueAttribute.SPECKLE_DEFAULT_RANK)] public class PolylineToHostConverter : IToHostTopLevelConverter, ITypedConverter { private readonly ITypedConverter _pointConverter; diff --git a/Converters/ArcGIS/Speckle.Converters.ArcGIS3/ToSpeckle/TopLevel/CoreObjectsBaseToSpeckleTopLevelConverter.cs b/Converters/ArcGIS/Speckle.Converters.ArcGIS3/ToSpeckle/TopLevel/CoreObjectsBaseToSpeckleTopLevelConverter.cs index 2bb4a2032..75c4a5bf2 100644 --- a/Converters/ArcGIS/Speckle.Converters.ArcGIS3/ToSpeckle/TopLevel/CoreObjectsBaseToSpeckleTopLevelConverter.cs +++ b/Converters/ArcGIS/Speckle.Converters.ArcGIS3/ToSpeckle/TopLevel/CoreObjectsBaseToSpeckleTopLevelConverter.cs @@ -6,7 +6,7 @@ namespace Speckle.Converters.ArcGIS3.ToSpeckle.TopLevel; -[NameAndRankValue(nameof(AC.CoreObjectsBase), 0)] +[NameAndRankValue(typeof(AC.CoreObjectsBase), 0)] public class CoreObjectsBaseToSpeckleTopLevelConverter : IToSpeckleTopLevelConverter { private readonly DisplayValueExtractor _displayValueExtractor; diff --git a/Converters/Autocad/Speckle.Converters.AutocadShared/ToHost/Geometry/ArcToHostConverter.cs b/Converters/Autocad/Speckle.Converters.AutocadShared/ToHost/Geometry/ArcToHostConverter.cs index bc1b7fb1c..65f2ef5cb 100644 --- a/Converters/Autocad/Speckle.Converters.AutocadShared/ToHost/Geometry/ArcToHostConverter.cs +++ b/Converters/Autocad/Speckle.Converters.AutocadShared/ToHost/Geometry/ArcToHostConverter.cs @@ -4,7 +4,7 @@ namespace Speckle.Converters.Autocad.ToHost.Geometry; -[NameAndRankValue(nameof(SOG.Arc), NameAndRankValueAttribute.SPECKLE_DEFAULT_RANK)] +[NameAndRankValue(typeof(SOG.Arc), NameAndRankValueAttribute.SPECKLE_DEFAULT_RANK)] public class ArcToHostConverter : IToHostTopLevelConverter, ITypedConverter { private readonly ITypedConverter _arcConverter; diff --git a/Converters/Autocad/Speckle.Converters.AutocadShared/ToHost/Geometry/AutocadPolycurveToHostConverter.cs b/Converters/Autocad/Speckle.Converters.AutocadShared/ToHost/Geometry/AutocadPolycurveToHostConverter.cs index 3f98ed847..65a3028b5 100644 --- a/Converters/Autocad/Speckle.Converters.AutocadShared/ToHost/Geometry/AutocadPolycurveToHostConverter.cs +++ b/Converters/Autocad/Speckle.Converters.AutocadShared/ToHost/Geometry/AutocadPolycurveToHostConverter.cs @@ -5,7 +5,7 @@ namespace Speckle.Converters.Autocad2023.ToHost.Geometry; -[NameAndRankValue(nameof(SOG.Autocad.AutocadPolycurve), NameAndRankValueAttribute.SPECKLE_DEFAULT_RANK)] +[NameAndRankValue(typeof(SOG.Autocad.AutocadPolycurve), NameAndRankValueAttribute.SPECKLE_DEFAULT_RANK)] public class AutocadPolycurveToHostConverter : IToHostTopLevelConverter { private readonly ITypedConverter _polylineConverter; diff --git a/Converters/Autocad/Speckle.Converters.AutocadShared/ToHost/Geometry/CircleToHostConverter.cs b/Converters/Autocad/Speckle.Converters.AutocadShared/ToHost/Geometry/CircleToHostConverter.cs index 67faf5769..aba0c711e 100644 --- a/Converters/Autocad/Speckle.Converters.AutocadShared/ToHost/Geometry/CircleToHostConverter.cs +++ b/Converters/Autocad/Speckle.Converters.AutocadShared/ToHost/Geometry/CircleToHostConverter.cs @@ -5,7 +5,7 @@ namespace Speckle.Converters.Autocad.ToHost.Geometry; -[NameAndRankValue(nameof(SOG.Circle), NameAndRankValueAttribute.SPECKLE_DEFAULT_RANK)] +[NameAndRankValue(typeof(SOG.Circle), NameAndRankValueAttribute.SPECKLE_DEFAULT_RANK)] public class CircleToHostConverter : IToHostTopLevelConverter, ITypedConverter { private readonly ITypedConverter _pointConverter; diff --git a/Converters/Autocad/Speckle.Converters.AutocadShared/ToHost/Geometry/CurveToHostConverter.cs b/Converters/Autocad/Speckle.Converters.AutocadShared/ToHost/Geometry/CurveToHostConverter.cs index 5da630ce9..299862754 100644 --- a/Converters/Autocad/Speckle.Converters.AutocadShared/ToHost/Geometry/CurveToHostConverter.cs +++ b/Converters/Autocad/Speckle.Converters.AutocadShared/ToHost/Geometry/CurveToHostConverter.cs @@ -4,7 +4,7 @@ namespace Speckle.Converters.AutocadShared.ToHost.Geometry; -[NameAndRankValue(nameof(SOG.Curve), NameAndRankValueAttribute.SPECKLE_DEFAULT_RANK)] +[NameAndRankValue(typeof(SOG.Curve), NameAndRankValueAttribute.SPECKLE_DEFAULT_RANK)] public class CurveToHostConverter : IToHostTopLevelConverter, ITypedConverter { private readonly ITypedConverter _curveConverter; diff --git a/Converters/Autocad/Speckle.Converters.AutocadShared/ToHost/Geometry/DataObjectConverter.cs b/Converters/Autocad/Speckle.Converters.AutocadShared/ToHost/Geometry/DataObjectConverter.cs index e0fb67637..c758a2045 100644 --- a/Converters/Autocad/Speckle.Converters.AutocadShared/ToHost/Geometry/DataObjectConverter.cs +++ b/Converters/Autocad/Speckle.Converters.AutocadShared/ToHost/Geometry/DataObjectConverter.cs @@ -6,7 +6,7 @@ namespace Speckle.Converters.Rhino7.ToHost.TopLevel; -[NameAndRankValue(nameof(DataObject), NameAndRankValueAttribute.SPECKLE_DEFAULT_RANK)] +[NameAndRankValue(typeof(DataObject), NameAndRankValueAttribute.SPECKLE_DEFAULT_RANK)] public class DataObjectConverter : IToHostTopLevelConverter, ITypedConverter> { private readonly ITypedConverter _lineConverter; diff --git a/Converters/Autocad/Speckle.Converters.AutocadShared/ToHost/Geometry/EllipseToHostConverter.cs b/Converters/Autocad/Speckle.Converters.AutocadShared/ToHost/Geometry/EllipseToHostConverter.cs index e179d15da..04572a8ef 100644 --- a/Converters/Autocad/Speckle.Converters.AutocadShared/ToHost/Geometry/EllipseToHostConverter.cs +++ b/Converters/Autocad/Speckle.Converters.AutocadShared/ToHost/Geometry/EllipseToHostConverter.cs @@ -5,7 +5,7 @@ namespace Speckle.Converters.Autocad.ToHost.Geometry; -[NameAndRankValue(nameof(SOG.Ellipse), NameAndRankValueAttribute.SPECKLE_DEFAULT_RANK)] +[NameAndRankValue(typeof(SOG.Ellipse), NameAndRankValueAttribute.SPECKLE_DEFAULT_RANK)] public class EllipseToHostConverter : IToHostTopLevelConverter, ITypedConverter { private readonly ITypedConverter _pointConverter; diff --git a/Converters/Autocad/Speckle.Converters.AutocadShared/ToHost/Geometry/LineToHostConverter.cs b/Converters/Autocad/Speckle.Converters.AutocadShared/ToHost/Geometry/LineToHostConverter.cs index ab390a46a..a087a5c6b 100644 --- a/Converters/Autocad/Speckle.Converters.AutocadShared/ToHost/Geometry/LineToHostConverter.cs +++ b/Converters/Autocad/Speckle.Converters.AutocadShared/ToHost/Geometry/LineToHostConverter.cs @@ -4,7 +4,7 @@ namespace Speckle.Converters.Autocad.ToHost.Geometry; -[NameAndRankValue(nameof(SOG.Line), NameAndRankValueAttribute.SPECKLE_DEFAULT_RANK)] +[NameAndRankValue(typeof(SOG.Line), NameAndRankValueAttribute.SPECKLE_DEFAULT_RANK)] public class LineToHostConverter : IToHostTopLevelConverter, ITypedConverter { private readonly ITypedConverter _pointConverter; diff --git a/Converters/Autocad/Speckle.Converters.AutocadShared/ToHost/Geometry/MeshToHostConverter.cs b/Converters/Autocad/Speckle.Converters.AutocadShared/ToHost/Geometry/MeshToHostConverter.cs index 340a601c4..a3856168c 100644 --- a/Converters/Autocad/Speckle.Converters.AutocadShared/ToHost/Geometry/MeshToHostConverter.cs +++ b/Converters/Autocad/Speckle.Converters.AutocadShared/ToHost/Geometry/MeshToHostConverter.cs @@ -6,7 +6,7 @@ namespace Speckle.Converters.Autocad.Geometry; -[NameAndRankValue(nameof(SOG.Mesh), NameAndRankValueAttribute.SPECKLE_DEFAULT_RANK)] +[NameAndRankValue(typeof(SOG.Mesh), NameAndRankValueAttribute.SPECKLE_DEFAULT_RANK)] public class MeshToHostConverter : IToHostTopLevelConverter, ITypedConverter { private readonly ITypedConverter _pointConverter; diff --git a/Converters/Autocad/Speckle.Converters.AutocadShared/ToHost/Geometry/PointToHostConverter.cs b/Converters/Autocad/Speckle.Converters.AutocadShared/ToHost/Geometry/PointToHostConverter.cs index 4feb6cdcd..6f0efd5f0 100644 --- a/Converters/Autocad/Speckle.Converters.AutocadShared/ToHost/Geometry/PointToHostConverter.cs +++ b/Converters/Autocad/Speckle.Converters.AutocadShared/ToHost/Geometry/PointToHostConverter.cs @@ -4,7 +4,7 @@ namespace Speckle.Converters.Autocad.ToHost.Geometry; -[NameAndRankValue(nameof(SOG.Point), NameAndRankValueAttribute.SPECKLE_DEFAULT_RANK)] +[NameAndRankValue(typeof(SOG.Point), NameAndRankValueAttribute.SPECKLE_DEFAULT_RANK)] public class PointToHostConverter : IToHostTopLevelConverter, ITypedConverter { private readonly ITypedConverter _pointConverter; diff --git a/Converters/Autocad/Speckle.Converters.AutocadShared/ToHost/Geometry/PolycurveToHostConverter.cs b/Converters/Autocad/Speckle.Converters.AutocadShared/ToHost/Geometry/PolycurveToHostConverter.cs index 3f1b9731d..e1c6aad43 100644 --- a/Converters/Autocad/Speckle.Converters.AutocadShared/ToHost/Geometry/PolycurveToHostConverter.cs +++ b/Converters/Autocad/Speckle.Converters.AutocadShared/ToHost/Geometry/PolycurveToHostConverter.cs @@ -9,7 +9,7 @@ namespace Speckle.Converters.AutocadShared.ToHost.Geometry; /// If polycurve segments are planar and only of type and , it can be represented as Polyline in Autocad. /// Otherwise we convert it as spline (list of ADB.Entity) that switch cases according to each segment type. /// -[NameAndRankValue(nameof(SOG.Polycurve), NameAndRankValueAttribute.SPECKLE_DEFAULT_RANK)] +[NameAndRankValue(typeof(SOG.Polycurve), NameAndRankValueAttribute.SPECKLE_DEFAULT_RANK)] public class PolycurveToHostConverter : IToHostTopLevelConverter { private readonly ITypedConverter _polylineConverter; diff --git a/Converters/Autocad/Speckle.Converters.AutocadShared/ToHost/Geometry/PolylineToHostConverter.cs b/Converters/Autocad/Speckle.Converters.AutocadShared/ToHost/Geometry/PolylineToHostConverter.cs index 9809303d0..a6c26bec5 100644 --- a/Converters/Autocad/Speckle.Converters.AutocadShared/ToHost/Geometry/PolylineToHostConverter.cs +++ b/Converters/Autocad/Speckle.Converters.AutocadShared/ToHost/Geometry/PolylineToHostConverter.cs @@ -4,7 +4,7 @@ namespace Speckle.Converters.Autocad.ToHost.Geometry; -[NameAndRankValue(nameof(SOG.Polyline), NameAndRankValueAttribute.SPECKLE_DEFAULT_RANK)] +[NameAndRankValue(typeof(SOG.Polyline), NameAndRankValueAttribute.SPECKLE_DEFAULT_RANK)] public class PolylineToHostConverter : IToHostTopLevelConverter, ITypedConverter { private readonly ITypedConverter _pointConverter; diff --git a/Converters/Autocad/Speckle.Converters.AutocadShared/ToHost/Raw/ArcToHostRawConverter.cs b/Converters/Autocad/Speckle.Converters.AutocadShared/ToHost/Raw/ArcToHostRawConverter.cs index 6a68b43ac..a5d09151d 100644 --- a/Converters/Autocad/Speckle.Converters.AutocadShared/ToHost/Raw/ArcToHostRawConverter.cs +++ b/Converters/Autocad/Speckle.Converters.AutocadShared/ToHost/Raw/ArcToHostRawConverter.cs @@ -4,7 +4,7 @@ namespace Speckle.Converters.Autocad.ToHost.Raw; -[NameAndRankValue(nameof(SOG.Arc), NameAndRankValueAttribute.SPECKLE_DEFAULT_RANK)] +[NameAndRankValue(typeof(SOG.Arc), NameAndRankValueAttribute.SPECKLE_DEFAULT_RANK)] public class ArcToHostRowConverter : ITypedConverter { private readonly ITypedConverter _pointConverter; diff --git a/Converters/Autocad/Speckle.Converters.AutocadShared/ToSpeckle/Geometry/ArcToSpeckleConverter.cs b/Converters/Autocad/Speckle.Converters.AutocadShared/ToSpeckle/Geometry/ArcToSpeckleConverter.cs index e179f15fa..edbf962e4 100644 --- a/Converters/Autocad/Speckle.Converters.AutocadShared/ToSpeckle/Geometry/ArcToSpeckleConverter.cs +++ b/Converters/Autocad/Speckle.Converters.AutocadShared/ToSpeckle/Geometry/ArcToSpeckleConverter.cs @@ -4,7 +4,7 @@ namespace Speckle.Converters.Autocad.ToSpeckle.Geometry; -[NameAndRankValue(nameof(ADB.Arc), NameAndRankValueAttribute.SPECKLE_DEFAULT_RANK)] +[NameAndRankValue(typeof(ADB.Arc), NameAndRankValueAttribute.SPECKLE_DEFAULT_RANK)] public class DBArcToSpeckleConverter : IToSpeckleTopLevelConverter { private readonly ITypedConverter _arcConverter; diff --git a/Converters/Autocad/Speckle.Converters.AutocadShared/ToSpeckle/Geometry/CircleToSpeckleConverter.cs b/Converters/Autocad/Speckle.Converters.AutocadShared/ToSpeckle/Geometry/CircleToSpeckleConverter.cs index 89415efd7..21f8c7e95 100644 --- a/Converters/Autocad/Speckle.Converters.AutocadShared/ToSpeckle/Geometry/CircleToSpeckleConverter.cs +++ b/Converters/Autocad/Speckle.Converters.AutocadShared/ToSpeckle/Geometry/CircleToSpeckleConverter.cs @@ -4,7 +4,7 @@ namespace Speckle.Converters.Autocad.ToSpeckle.Geometry; -[NameAndRankValue(nameof(ADB.Circle), NameAndRankValueAttribute.SPECKLE_DEFAULT_RANK)] +[NameAndRankValue(typeof(ADB.Circle), NameAndRankValueAttribute.SPECKLE_DEFAULT_RANK)] public class DBCircleToSpeckleConverter : IToSpeckleTopLevelConverter { private readonly ITypedConverter _circleConverter; diff --git a/Converters/Autocad/Speckle.Converters.AutocadShared/ToSpeckle/Geometry/EllipseToSpeckleConverter.cs b/Converters/Autocad/Speckle.Converters.AutocadShared/ToSpeckle/Geometry/EllipseToSpeckleConverter.cs index 89d5b9af3..ec170697b 100644 --- a/Converters/Autocad/Speckle.Converters.AutocadShared/ToSpeckle/Geometry/EllipseToSpeckleConverter.cs +++ b/Converters/Autocad/Speckle.Converters.AutocadShared/ToSpeckle/Geometry/EllipseToSpeckleConverter.cs @@ -4,7 +4,7 @@ namespace Speckle.Converters.Autocad.ToSpeckle.Geometry; -[NameAndRankValue(nameof(ADB.Ellipse), NameAndRankValueAttribute.SPECKLE_DEFAULT_RANK)] +[NameAndRankValue(typeof(ADB.Ellipse), NameAndRankValueAttribute.SPECKLE_DEFAULT_RANK)] public class DBEllipseToSpeckleConverter : IToSpeckleTopLevelConverter { private readonly ITypedConverter _ellipseConverter; diff --git a/Converters/Autocad/Speckle.Converters.AutocadShared/ToSpeckle/Geometry/LineToSpeckleConverter.cs b/Converters/Autocad/Speckle.Converters.AutocadShared/ToSpeckle/Geometry/LineToSpeckleConverter.cs index ea4be5229..e9c0eb5b1 100644 --- a/Converters/Autocad/Speckle.Converters.AutocadShared/ToSpeckle/Geometry/LineToSpeckleConverter.cs +++ b/Converters/Autocad/Speckle.Converters.AutocadShared/ToSpeckle/Geometry/LineToSpeckleConverter.cs @@ -4,7 +4,7 @@ namespace Speckle.Converters.Autocad.ToSpeckle.Geometry; -[NameAndRankValue(nameof(ADB.Line), NameAndRankValueAttribute.SPECKLE_DEFAULT_RANK)] +[NameAndRankValue(typeof(ADB.Line), NameAndRankValueAttribute.SPECKLE_DEFAULT_RANK)] public class LineToSpeckleConverter : IToSpeckleTopLevelConverter { private readonly ITypedConverter _lineConverter; diff --git a/Converters/Autocad/Speckle.Converters.AutocadShared/ToSpeckle/Geometry/PointToSpeckleConverter.cs b/Converters/Autocad/Speckle.Converters.AutocadShared/ToSpeckle/Geometry/PointToSpeckleConverter.cs index 0dc4bc102..ffe163dcc 100644 --- a/Converters/Autocad/Speckle.Converters.AutocadShared/ToSpeckle/Geometry/PointToSpeckleConverter.cs +++ b/Converters/Autocad/Speckle.Converters.AutocadShared/ToSpeckle/Geometry/PointToSpeckleConverter.cs @@ -4,7 +4,7 @@ namespace Speckle.Converters.Autocad.ToSpeckle.Geometry; -[NameAndRankValue(nameof(ADB.DBPoint), NameAndRankValueAttribute.SPECKLE_DEFAULT_RANK)] +[NameAndRankValue(typeof(ADB.DBPoint), NameAndRankValueAttribute.SPECKLE_DEFAULT_RANK)] public class PointToSpeckleConverter : IToSpeckleTopLevelConverter { private readonly ITypedConverter _pointConverter; diff --git a/Converters/Autocad/Speckle.Converters.AutocadShared/ToSpeckle/Geometry/PolyfaceMeshToSpeckleConverter.cs b/Converters/Autocad/Speckle.Converters.AutocadShared/ToSpeckle/Geometry/PolyfaceMeshToSpeckleConverter.cs index 5e5cffd92..a8d23bbef 100644 --- a/Converters/Autocad/Speckle.Converters.AutocadShared/ToSpeckle/Geometry/PolyfaceMeshToSpeckleConverter.cs +++ b/Converters/Autocad/Speckle.Converters.AutocadShared/ToSpeckle/Geometry/PolyfaceMeshToSpeckleConverter.cs @@ -11,7 +11,7 @@ namespace Speckle.Converters.Autocad.Geometry; /// /// The IToSpeckleTopLevelConverter inheritance should only expect database-resident objects. IRawConversion inheritance can expect non database-resident objects, when generated from other converters. /// -[NameAndRankValue(nameof(ADB.PolyFaceMesh), NameAndRankValueAttribute.SPECKLE_DEFAULT_RANK)] +[NameAndRankValue(typeof(ADB.PolyFaceMesh), NameAndRankValueAttribute.SPECKLE_DEFAULT_RANK)] public class DBPolyfaceMeshToSpeckleConverter : IToSpeckleTopLevelConverter { private readonly ITypedConverter _pointConverter; diff --git a/Converters/Autocad/Speckle.Converters.AutocadShared/ToSpeckle/Geometry/Polyline2dToSpeckleConverter.cs b/Converters/Autocad/Speckle.Converters.AutocadShared/ToSpeckle/Geometry/Polyline2dToSpeckleConverter.cs index 519e7615f..e6cdfe890 100644 --- a/Converters/Autocad/Speckle.Converters.AutocadShared/ToSpeckle/Geometry/Polyline2dToSpeckleConverter.cs +++ b/Converters/Autocad/Speckle.Converters.AutocadShared/ToSpeckle/Geometry/Polyline2dToSpeckleConverter.cs @@ -14,7 +14,7 @@ namespace Speckle.Converters.Autocad.Geometry; /// of type and will have only one in . /// The IToSpeckleTopLevelConverter inheritance should only expect database-resident objects. IRawConversion inheritance can expect non database-resident objects, when generated from other converters. /// -[NameAndRankValue(nameof(ADB.Polyline2d), NameAndRankValueAttribute.SPECKLE_DEFAULT_RANK)] +[NameAndRankValue(typeof(ADB.Polyline2d), NameAndRankValueAttribute.SPECKLE_DEFAULT_RANK)] public class Polyline2dToSpeckleConverter : IToSpeckleTopLevelConverter, ITypedConverter diff --git a/Converters/Autocad/Speckle.Converters.AutocadShared/ToSpeckle/Geometry/Polyline3dToSpeckleConverter.cs b/Converters/Autocad/Speckle.Converters.AutocadShared/ToSpeckle/Geometry/Polyline3dToSpeckleConverter.cs index f01ff31f9..76218142d 100644 --- a/Converters/Autocad/Speckle.Converters.AutocadShared/ToSpeckle/Geometry/Polyline3dToSpeckleConverter.cs +++ b/Converters/Autocad/Speckle.Converters.AutocadShared/ToSpeckle/Geometry/Polyline3dToSpeckleConverter.cs @@ -13,7 +13,7 @@ namespace Speckle.Converters.Autocad.Geometry; /// of type and will have only one in . /// The IToSpeckleTopLevelConverter inheritance should only expect database-resident Polyline2d objects. IRawConversion inheritance can expect non database-resident objects, when generated from other converters. /// -[NameAndRankValue(nameof(ADB.Polyline3d), NameAndRankValueAttribute.SPECKLE_DEFAULT_RANK)] +[NameAndRankValue(typeof(ADB.Polyline3d), NameAndRankValueAttribute.SPECKLE_DEFAULT_RANK)] public class Polyline3dToSpeckleConverter : IToSpeckleTopLevelConverter, ITypedConverter diff --git a/Converters/Autocad/Speckle.Converters.AutocadShared/ToSpeckle/Geometry/PolylineToSpeckleConverter.cs b/Converters/Autocad/Speckle.Converters.AutocadShared/ToSpeckle/Geometry/PolylineToSpeckleConverter.cs index d0a63cb02..da89a945b 100644 --- a/Converters/Autocad/Speckle.Converters.AutocadShared/ToSpeckle/Geometry/PolylineToSpeckleConverter.cs +++ b/Converters/Autocad/Speckle.Converters.AutocadShared/ToSpeckle/Geometry/PolylineToSpeckleConverter.cs @@ -10,7 +10,7 @@ namespace Speckle.Converters.Autocad.Geometry; /// /// is of type and will have only s and s in . /// -[NameAndRankValue(nameof(ADB.Polyline), NameAndRankValueAttribute.SPECKLE_DEFAULT_RANK)] +[NameAndRankValue(typeof(ADB.Polyline), NameAndRankValueAttribute.SPECKLE_DEFAULT_RANK)] public class PolylineToSpeckleConverter : IToSpeckleTopLevelConverter, ITypedConverter diff --git a/Converters/Autocad/Speckle.Converters.AutocadShared/ToSpeckle/Geometry/RegionToSpeckleConverter.cs b/Converters/Autocad/Speckle.Converters.AutocadShared/ToSpeckle/Geometry/RegionToSpeckleConverter.cs index 4723e50ac..72ba00eef 100644 --- a/Converters/Autocad/Speckle.Converters.AutocadShared/ToSpeckle/Geometry/RegionToSpeckleConverter.cs +++ b/Converters/Autocad/Speckle.Converters.AutocadShared/ToSpeckle/Geometry/RegionToSpeckleConverter.cs @@ -5,7 +5,7 @@ namespace Speckle.Converters.Autocad.Geometry; -[NameAndRankValue(nameof(ADB.Region), NameAndRankValueAttribute.SPECKLE_DEFAULT_RANK)] +[NameAndRankValue(typeof(ADB.Region), NameAndRankValueAttribute.SPECKLE_DEFAULT_RANK)] public class RegionToSpeckleConverter : IToSpeckleTopLevelConverter, ITypedConverter { private readonly ITypedConverter _brepConverter; diff --git a/Converters/Autocad/Speckle.Converters.AutocadShared/ToSpeckle/Geometry/Solid3dToSpeckleConverter.cs b/Converters/Autocad/Speckle.Converters.AutocadShared/ToSpeckle/Geometry/Solid3dToSpeckleConverter.cs index f0989e1f2..02a8a840c 100644 --- a/Converters/Autocad/Speckle.Converters.AutocadShared/ToSpeckle/Geometry/Solid3dToSpeckleConverter.cs +++ b/Converters/Autocad/Speckle.Converters.AutocadShared/ToSpeckle/Geometry/Solid3dToSpeckleConverter.cs @@ -4,7 +4,7 @@ namespace Speckle.Converters.Autocad.Geometry; -[NameAndRankValue(nameof(ADB.Solid3d), NameAndRankValueAttribute.SPECKLE_DEFAULT_RANK)] +[NameAndRankValue(typeof(ADB.Solid3d), NameAndRankValueAttribute.SPECKLE_DEFAULT_RANK)] public class Solid3dToSpeckleConverter : IToSpeckleTopLevelConverter { private readonly ITypedConverter _solidConverter; diff --git a/Converters/Autocad/Speckle.Converters.AutocadShared/ToSpeckle/Geometry/SplineToSpeckleConverter.cs b/Converters/Autocad/Speckle.Converters.AutocadShared/ToSpeckle/Geometry/SplineToSpeckleConverter.cs index 955096c7c..4512da61a 100644 --- a/Converters/Autocad/Speckle.Converters.AutocadShared/ToSpeckle/Geometry/SplineToSpeckleConverter.cs +++ b/Converters/Autocad/Speckle.Converters.AutocadShared/ToSpeckle/Geometry/SplineToSpeckleConverter.cs @@ -4,7 +4,7 @@ namespace Speckle.Converters.Autocad.ToSpeckle.Geometry; -[NameAndRankValue(nameof(ADB.Spline), NameAndRankValueAttribute.SPECKLE_DEFAULT_RANK)] +[NameAndRankValue(typeof(ADB.Spline), NameAndRankValueAttribute.SPECKLE_DEFAULT_RANK)] public class SplineToSpeckleConverter : IToSpeckleTopLevelConverter { private readonly ITypedConverter _splineConverter; diff --git a/Converters/Autocad/Speckle.Converters.AutocadShared/ToSpeckle/Geometry/SubDMeshToSpeckleConverter.cs b/Converters/Autocad/Speckle.Converters.AutocadShared/ToSpeckle/Geometry/SubDMeshToSpeckleConverter.cs index 996b0e1db..608c31243 100644 --- a/Converters/Autocad/Speckle.Converters.AutocadShared/ToSpeckle/Geometry/SubDMeshToSpeckleConverter.cs +++ b/Converters/Autocad/Speckle.Converters.AutocadShared/ToSpeckle/Geometry/SubDMeshToSpeckleConverter.cs @@ -5,7 +5,7 @@ namespace Speckle.Converters.Autocad.Geometry; -[NameAndRankValue(nameof(ADB.SubDMesh), NameAndRankValueAttribute.SPECKLE_DEFAULT_RANK)] +[NameAndRankValue(typeof(ADB.SubDMesh), NameAndRankValueAttribute.SPECKLE_DEFAULT_RANK)] public class DBSubDMeshToSpeckleConverter : IToSpeckleTopLevelConverter { private readonly IConverterSettingsStore _settingsStore; diff --git a/Converters/Autocad/Speckle.Converters.AutocadShared/ToSpeckle/Geometry/SurfaceToSpeckleConverter.cs b/Converters/Autocad/Speckle.Converters.AutocadShared/ToSpeckle/Geometry/SurfaceToSpeckleConverter.cs index e15d5f3e1..786a91ced 100644 --- a/Converters/Autocad/Speckle.Converters.AutocadShared/ToSpeckle/Geometry/SurfaceToSpeckleConverter.cs +++ b/Converters/Autocad/Speckle.Converters.AutocadShared/ToSpeckle/Geometry/SurfaceToSpeckleConverter.cs @@ -5,7 +5,7 @@ namespace Speckle.Converters.Autocad.Geometry; -[NameAndRankValue(nameof(ADB.Surface), NameAndRankValueAttribute.SPECKLE_DEFAULT_RANK)] +[NameAndRankValue(typeof(ADB.Surface), NameAndRankValueAttribute.SPECKLE_DEFAULT_RANK)] public class SurfaceToSpeckleConverter : IToSpeckleTopLevelConverter, ITypedConverter { private readonly ITypedConverter _brepConverter; diff --git a/Converters/CSi/Speckle.Converters.ETABSShared/ToSpeckle/TopLevel/EtabsObjectToSpeckleConverter.cs b/Converters/CSi/Speckle.Converters.ETABSShared/ToSpeckle/TopLevel/EtabsObjectToSpeckleConverter.cs index 2bdda3d11..349a65ede 100644 --- a/Converters/CSi/Speckle.Converters.ETABSShared/ToSpeckle/TopLevel/EtabsObjectToSpeckleConverter.cs +++ b/Converters/CSi/Speckle.Converters.ETABSShared/ToSpeckle/TopLevel/EtabsObjectToSpeckleConverter.cs @@ -22,7 +22,7 @@ namespace Speckle.Converters.ETABSShared.ToSpeckle.TopLevel; /// * IApplicationPropertiesExtractor for ETABS-specific data /// 3. CreateTargetObject method ensures type-safe conversion to EtabsObject /// -[NameAndRankValue(nameof(CsiWrapperBase), NameAndRankValueAttribute.SPECKLE_DEFAULT_RANK)] +[NameAndRankValue(typeof(CsiWrapperBase), NameAndRankValueAttribute.SPECKLE_DEFAULT_RANK)] public class EtabsObjectToSpeckleConverter : CsiObjectToSpeckleConverterBase { public EtabsObjectToSpeckleConverter( diff --git a/Converters/Civil3d/Speckle.Converters.Civil3dShared/ToSpeckle/TopLevel/CivilEntityToSpeckleTopLevelConverter.cs b/Converters/Civil3d/Speckle.Converters.Civil3dShared/ToSpeckle/TopLevel/CivilEntityToSpeckleTopLevelConverter.cs index 6b16b85c3..c3a2acfde 100644 --- a/Converters/Civil3d/Speckle.Converters.Civil3dShared/ToSpeckle/TopLevel/CivilEntityToSpeckleTopLevelConverter.cs +++ b/Converters/Civil3d/Speckle.Converters.Civil3dShared/ToSpeckle/TopLevel/CivilEntityToSpeckleTopLevelConverter.cs @@ -9,7 +9,7 @@ namespace Speckle.Converters.Civil3dShared.ToSpeckle.BuiltElements; -[NameAndRankValue(nameof(CDB.Entity), NameAndRankValueAttribute.SPECKLE_DEFAULT_RANK)] +[NameAndRankValue(typeof(CDB.Entity), NameAndRankValueAttribute.SPECKLE_DEFAULT_RANK)] public class CivilEntityToSpeckleTopLevelConverter : IToSpeckleTopLevelConverter { private readonly IConverterSettingsStore _settingsStore; diff --git a/Converters/Navisworks/Speckle.Converters.NavisworksShared/ToSpeckle/TopLevel/ModelItemTopLevelConverterToSpeckle.cs b/Converters/Navisworks/Speckle.Converters.NavisworksShared/ToSpeckle/TopLevel/ModelItemTopLevelConverterToSpeckle.cs index 17e3a89f2..1fb85b5d5 100644 --- a/Converters/Navisworks/Speckle.Converters.NavisworksShared/ToSpeckle/TopLevel/ModelItemTopLevelConverterToSpeckle.cs +++ b/Converters/Navisworks/Speckle.Converters.NavisworksShared/ToSpeckle/TopLevel/ModelItemTopLevelConverterToSpeckle.cs @@ -10,7 +10,7 @@ namespace Speckle.Converter.Navisworks.ToSpeckle; /// /// Converts Navisworks ModelItem objects to Speckle Base objects. /// -[NameAndRankValue(nameof(NAV.ModelItem), NameAndRankValueAttribute.SPECKLE_DEFAULT_RANK)] +[NameAndRankValue(typeof(NAV.ModelItem), NameAndRankValueAttribute.SPECKLE_DEFAULT_RANK)] public class ModelItemToToSpeckleConverter : IToSpeckleTopLevelConverter { private readonly StandardPropertyHandler _standardHandler; diff --git a/Converters/Revit/Speckle.Converters.RevitShared/ToSpeckle/TopLevel/ModelCurveToSpeckleTopLevelConverter.cs b/Converters/Revit/Speckle.Converters.RevitShared/ToSpeckle/TopLevel/ModelCurveToSpeckleTopLevelConverter.cs index 3f1f25448..2be4bb2bd 100644 --- a/Converters/Revit/Speckle.Converters.RevitShared/ToSpeckle/TopLevel/ModelCurveToSpeckleTopLevelConverter.cs +++ b/Converters/Revit/Speckle.Converters.RevitShared/ToSpeckle/TopLevel/ModelCurveToSpeckleTopLevelConverter.cs @@ -6,7 +6,7 @@ namespace Speckle.Converters.RevitShared.ToSpeckle; // Converts model curves to regular speckle curves, since we aren't receiving them and the only property used in V2 was the linestyle (not element ids or parameters). Don't see a need to handle these differently from regular geometry. -[NameAndRankValue(nameof(DB.ModelCurve), 0)] +[NameAndRankValue(typeof(DB.ModelCurve), 0)] public class ModelCurveToSpeckleTopLevelConverter : IToSpeckleTopLevelConverter { private readonly ITypedConverter _curveConverter; diff --git a/Converters/Revit/Speckle.Converters.RevitShared/ToSpeckle/TopLevel/PointcloudTopLevelConverterToSpeckle.cs b/Converters/Revit/Speckle.Converters.RevitShared/ToSpeckle/TopLevel/PointcloudTopLevelConverterToSpeckle.cs index 70d5403cc..3cd9047c6 100644 --- a/Converters/Revit/Speckle.Converters.RevitShared/ToSpeckle/TopLevel/PointcloudTopLevelConverterToSpeckle.cs +++ b/Converters/Revit/Speckle.Converters.RevitShared/ToSpeckle/TopLevel/PointcloudTopLevelConverterToSpeckle.cs @@ -5,7 +5,7 @@ namespace Speckle.Converters.RevitShared.ToSpeckle; -[NameAndRankValue(nameof(DB.PointCloudInstance), NameAndRankValueAttribute.SPECKLE_DEFAULT_RANK)] +[NameAndRankValue(typeof(DB.PointCloudInstance), NameAndRankValueAttribute.SPECKLE_DEFAULT_RANK)] public sealed class PointcloudTopLevelConverterToSpeckle : IToSpeckleTopLevelConverter { private readonly IConverterSettingsStore _converterSettings; diff --git a/Converters/Revit/Speckle.Converters.RevitShared/ToSpeckle/TopLevel/RevitElementTopLevelConverterToSpeckle.cs b/Converters/Revit/Speckle.Converters.RevitShared/ToSpeckle/TopLevel/RevitElementTopLevelConverterToSpeckle.cs index 223cb5c0e..8e58a17f5 100644 --- a/Converters/Revit/Speckle.Converters.RevitShared/ToSpeckle/TopLevel/RevitElementTopLevelConverterToSpeckle.cs +++ b/Converters/Revit/Speckle.Converters.RevitShared/ToSpeckle/TopLevel/RevitElementTopLevelConverterToSpeckle.cs @@ -10,7 +10,7 @@ namespace Speckle.Converters.RevitShared.ToSpeckle; -[NameAndRankValue(nameof(DB.Element), 0)] +[NameAndRankValue(typeof(DB.Element), 0)] public class ElementTopLevelConverterToSpeckle : IToSpeckleTopLevelConverter { private readonly DisplayValueExtractor _displayValueExtractor; diff --git a/Converters/Rhino/Speckle.Converters.RhinoShared/ToHost/TopLevel/ArcToHostTopLevelConverter.cs b/Converters/Rhino/Speckle.Converters.RhinoShared/ToHost/TopLevel/ArcToHostTopLevelConverter.cs index 3ebd21b35..3edf4dccd 100644 --- a/Converters/Rhino/Speckle.Converters.RhinoShared/ToHost/TopLevel/ArcToHostTopLevelConverter.cs +++ b/Converters/Rhino/Speckle.Converters.RhinoShared/ToHost/TopLevel/ArcToHostTopLevelConverter.cs @@ -3,7 +3,7 @@ namespace Speckle.Converters.Rhino.ToHost.TopLevel; -[NameAndRankValue(nameof(SOG.Arc), NameAndRankValueAttribute.SPECKLE_DEFAULT_RANK)] +[NameAndRankValue(typeof(SOG.Arc), NameAndRankValueAttribute.SPECKLE_DEFAULT_RANK)] public class ArcToHostTopLevelConverter : SpeckleToHostGeometryBaseTopLevelConverter { public ArcToHostTopLevelConverter( diff --git a/Converters/Rhino/Speckle.Converters.RhinoShared/ToHost/TopLevel/BrepToHostTopLevelConverter.cs b/Converters/Rhino/Speckle.Converters.RhinoShared/ToHost/TopLevel/BrepToHostTopLevelConverter.cs index a20d9f1c3..d7908ec6d 100644 --- a/Converters/Rhino/Speckle.Converters.RhinoShared/ToHost/TopLevel/BrepToHostTopLevelConverter.cs +++ b/Converters/Rhino/Speckle.Converters.RhinoShared/ToHost/TopLevel/BrepToHostTopLevelConverter.cs @@ -3,7 +3,7 @@ namespace Speckle.Converters.Rhino.ToHost.TopLevel; -[NameAndRankValue(nameof(SOG.Brep), NameAndRankValueAttribute.SPECKLE_DEFAULT_RANK)] +[NameAndRankValue(typeof(SOG.Brep), NameAndRankValueAttribute.SPECKLE_DEFAULT_RANK)] public class BrepToHostTopLevelConverter : SpeckleToHostGeometryBaseTopLevelConverter { public BrepToHostTopLevelConverter( diff --git a/Converters/Rhino/Speckle.Converters.RhinoShared/ToHost/TopLevel/BrepXToHostTopLevelConverter.cs b/Converters/Rhino/Speckle.Converters.RhinoShared/ToHost/TopLevel/BrepXToHostTopLevelConverter.cs index 08f1c6902..d7ba18740 100644 --- a/Converters/Rhino/Speckle.Converters.RhinoShared/ToHost/TopLevel/BrepXToHostTopLevelConverter.cs +++ b/Converters/Rhino/Speckle.Converters.RhinoShared/ToHost/TopLevel/BrepXToHostTopLevelConverter.cs @@ -3,7 +3,7 @@ namespace Speckle.Converters.Rhino.ToHost.TopLevel; -[NameAndRankValue(nameof(SOG.BrepX), NameAndRankValueAttribute.SPECKLE_DEFAULT_RANK)] +[NameAndRankValue(typeof(SOG.BrepX), NameAndRankValueAttribute.SPECKLE_DEFAULT_RANK)] public class BrepXToHostTopLevelConverter : SpeckleToHostGeometryBaseTopLevelConverter> { public BrepXToHostTopLevelConverter( @@ -13,7 +13,7 @@ public BrepXToHostTopLevelConverter( : base(settingsStore, geometryBaseConverter) { } } -[NameAndRankValue(nameof(SOG.SubDX), NameAndRankValueAttribute.SPECKLE_DEFAULT_RANK)] +[NameAndRankValue(typeof(SOG.SubDX), NameAndRankValueAttribute.SPECKLE_DEFAULT_RANK)] public class SubDXToHostTopLevelConverter : SpeckleToHostGeometryBaseTopLevelConverter> { public SubDXToHostTopLevelConverter( @@ -23,7 +23,7 @@ public SubDXToHostTopLevelConverter( : base(settingsStore, geometryBaseConverter) { } } -[NameAndRankValue(nameof(SOG.ExtrusionX), NameAndRankValueAttribute.SPECKLE_DEFAULT_RANK)] +[NameAndRankValue(typeof(SOG.ExtrusionX), NameAndRankValueAttribute.SPECKLE_DEFAULT_RANK)] public class ExtrusionXToHostTopLevelConverter : SpeckleToHostGeometryBaseTopLevelConverter> { diff --git a/Converters/Rhino/Speckle.Converters.RhinoShared/ToHost/TopLevel/CircleToHostTopLevelConverter.cs b/Converters/Rhino/Speckle.Converters.RhinoShared/ToHost/TopLevel/CircleToHostTopLevelConverter.cs index 17e60e248..73de699da 100644 --- a/Converters/Rhino/Speckle.Converters.RhinoShared/ToHost/TopLevel/CircleToHostTopLevelConverter.cs +++ b/Converters/Rhino/Speckle.Converters.RhinoShared/ToHost/TopLevel/CircleToHostTopLevelConverter.cs @@ -3,7 +3,7 @@ namespace Speckle.Converters.Rhino.ToHost.TopLevel; -[NameAndRankValue(nameof(SOG.Circle), NameAndRankValueAttribute.SPECKLE_DEFAULT_RANK)] +[NameAndRankValue(typeof(SOG.Circle), NameAndRankValueAttribute.SPECKLE_DEFAULT_RANK)] public class CircleToHostTopLevelConverter : SpeckleToHostGeometryBaseTopLevelConverter { public CircleToHostTopLevelConverter( diff --git a/Converters/Rhino/Speckle.Converters.RhinoShared/ToHost/TopLevel/DataObjectConverter.cs b/Converters/Rhino/Speckle.Converters.RhinoShared/ToHost/TopLevel/DataObjectConverter.cs index cf4b4f935..0db806137 100644 --- a/Converters/Rhino/Speckle.Converters.RhinoShared/ToHost/TopLevel/DataObjectConverter.cs +++ b/Converters/Rhino/Speckle.Converters.RhinoShared/ToHost/TopLevel/DataObjectConverter.cs @@ -7,7 +7,7 @@ namespace Speckle.Converters.Rhino.ToHost.TopLevel; -[NameAndRankValue(nameof(DataObject), NameAndRankValueAttribute.SPECKLE_DEFAULT_RANK)] +[NameAndRankValue(typeof(DataObject), NameAndRankValueAttribute.SPECKLE_DEFAULT_RANK)] public class DataObjectConverter : IToHostTopLevelConverter, ITypedConverter> diff --git a/Converters/Rhino/Speckle.Converters.RhinoShared/ToHost/TopLevel/DisplayableObjectToHostTopLevelConverter.cs b/Converters/Rhino/Speckle.Converters.RhinoShared/ToHost/TopLevel/DisplayableObjectToHostTopLevelConverter.cs index 92187942c..24bde1354 100644 --- a/Converters/Rhino/Speckle.Converters.RhinoShared/ToHost/TopLevel/DisplayableObjectToHostTopLevelConverter.cs +++ b/Converters/Rhino/Speckle.Converters.RhinoShared/ToHost/TopLevel/DisplayableObjectToHostTopLevelConverter.cs @@ -6,7 +6,7 @@ namespace Speckle.Converters.Rhino.ToHost.TopLevel; -[NameAndRankValue(nameof(DisplayableObject), NameAndRankValueAttribute.SPECKLE_DEFAULT_RANK)] +[NameAndRankValue(typeof(DisplayableObject), NameAndRankValueAttribute.SPECKLE_DEFAULT_RANK)] public class DisplayableObjectConverter : IToHostTopLevelConverter, ITypedConverter> diff --git a/Converters/Rhino/Speckle.Converters.RhinoShared/ToHost/TopLevel/EllipseToHostTopLevelConverter.cs b/Converters/Rhino/Speckle.Converters.RhinoShared/ToHost/TopLevel/EllipseToHostTopLevelConverter.cs index 24851e534..68cf3eab7 100644 --- a/Converters/Rhino/Speckle.Converters.RhinoShared/ToHost/TopLevel/EllipseToHostTopLevelConverter.cs +++ b/Converters/Rhino/Speckle.Converters.RhinoShared/ToHost/TopLevel/EllipseToHostTopLevelConverter.cs @@ -3,7 +3,7 @@ namespace Speckle.Converters.Rhino.ToHost.TopLevel; -[NameAndRankValue(nameof(SOG.Ellipse), NameAndRankValueAttribute.SPECKLE_DEFAULT_RANK)] +[NameAndRankValue(typeof(SOG.Ellipse), NameAndRankValueAttribute.SPECKLE_DEFAULT_RANK)] public class EllipseToHostTopLevelConverter : SpeckleToHostGeometryBaseTopLevelConverter { public EllipseToHostTopLevelConverter( diff --git a/Converters/Rhino/Speckle.Converters.RhinoShared/ToHost/TopLevel/LineToHostTopLevelConverter.cs b/Converters/Rhino/Speckle.Converters.RhinoShared/ToHost/TopLevel/LineToHostTopLevelConverter.cs index 315fcd611..411c9fc87 100644 --- a/Converters/Rhino/Speckle.Converters.RhinoShared/ToHost/TopLevel/LineToHostTopLevelConverter.cs +++ b/Converters/Rhino/Speckle.Converters.RhinoShared/ToHost/TopLevel/LineToHostTopLevelConverter.cs @@ -3,7 +3,7 @@ namespace Speckle.Converters.Rhino.ToHost.TopLevel; -[NameAndRankValue(nameof(SOG.Line), NameAndRankValueAttribute.SPECKLE_DEFAULT_RANK)] +[NameAndRankValue(typeof(SOG.Line), NameAndRankValueAttribute.SPECKLE_DEFAULT_RANK)] public class LineToHostTopLevelConverter : SpeckleToHostGeometryBaseTopLevelConverter { public LineToHostTopLevelConverter( diff --git a/Converters/Rhino/Speckle.Converters.RhinoShared/ToHost/TopLevel/MeshToHostTopLevelConverter.cs b/Converters/Rhino/Speckle.Converters.RhinoShared/ToHost/TopLevel/MeshToHostTopLevelConverter.cs index db768ad0d..9b56b86e9 100644 --- a/Converters/Rhino/Speckle.Converters.RhinoShared/ToHost/TopLevel/MeshToHostTopLevelConverter.cs +++ b/Converters/Rhino/Speckle.Converters.RhinoShared/ToHost/TopLevel/MeshToHostTopLevelConverter.cs @@ -3,7 +3,7 @@ namespace Speckle.Converters.Rhino.ToHost.TopLevel; -[NameAndRankValue(nameof(SOG.Mesh), NameAndRankValueAttribute.SPECKLE_DEFAULT_RANK)] +[NameAndRankValue(typeof(SOG.Mesh), NameAndRankValueAttribute.SPECKLE_DEFAULT_RANK)] public class MeshToHostTopLevelConverter : SpeckleToHostGeometryBaseTopLevelConverter { public MeshToHostTopLevelConverter( diff --git a/Converters/Rhino/Speckle.Converters.RhinoShared/ToHost/TopLevel/NurbsCurveToHostTopLevelConverter.cs b/Converters/Rhino/Speckle.Converters.RhinoShared/ToHost/TopLevel/NurbsCurveToHostTopLevelConverter.cs index 2c507f6ac..9000b281a 100644 --- a/Converters/Rhino/Speckle.Converters.RhinoShared/ToHost/TopLevel/NurbsCurveToHostTopLevelConverter.cs +++ b/Converters/Rhino/Speckle.Converters.RhinoShared/ToHost/TopLevel/NurbsCurveToHostTopLevelConverter.cs @@ -3,7 +3,7 @@ namespace Speckle.Converters.Rhino.ToHost.TopLevel; -[NameAndRankValue(nameof(SOG.Curve), NameAndRankValueAttribute.SPECKLE_DEFAULT_RANK)] +[NameAndRankValue(typeof(SOG.Curve), NameAndRankValueAttribute.SPECKLE_DEFAULT_RANK)] public class NurbsCurveToHostTopLevelConverter : SpeckleToHostGeometryBaseTopLevelConverter { public NurbsCurveToHostTopLevelConverter( diff --git a/Converters/Rhino/Speckle.Converters.RhinoShared/ToHost/TopLevel/PointCloudToHostTopLevelConverter.cs b/Converters/Rhino/Speckle.Converters.RhinoShared/ToHost/TopLevel/PointCloudToHostTopLevelConverter.cs index 99439d9c2..2f7589290 100644 --- a/Converters/Rhino/Speckle.Converters.RhinoShared/ToHost/TopLevel/PointCloudToHostTopLevelConverter.cs +++ b/Converters/Rhino/Speckle.Converters.RhinoShared/ToHost/TopLevel/PointCloudToHostTopLevelConverter.cs @@ -3,7 +3,7 @@ namespace Speckle.Converters.Rhino.ToHost.TopLevel; -[NameAndRankValue(nameof(SOG.Pointcloud), NameAndRankValueAttribute.SPECKLE_DEFAULT_RANK)] +[NameAndRankValue(typeof(SOG.Pointcloud), NameAndRankValueAttribute.SPECKLE_DEFAULT_RANK)] public class PointCloudToHostTopLevelConverter : SpeckleToHostGeometryBaseTopLevelConverter { diff --git a/Converters/Rhino/Speckle.Converters.RhinoShared/ToHost/TopLevel/PointToHostTopLevelConverter.cs b/Converters/Rhino/Speckle.Converters.RhinoShared/ToHost/TopLevel/PointToHostTopLevelConverter.cs index 2211f8227..3b8b0f841 100644 --- a/Converters/Rhino/Speckle.Converters.RhinoShared/ToHost/TopLevel/PointToHostTopLevelConverter.cs +++ b/Converters/Rhino/Speckle.Converters.RhinoShared/ToHost/TopLevel/PointToHostTopLevelConverter.cs @@ -3,7 +3,7 @@ namespace Speckle.Converters.Rhino.ToHost.TopLevel; -[NameAndRankValue(nameof(SOG.Point), NameAndRankValueAttribute.SPECKLE_DEFAULT_RANK)] +[NameAndRankValue(typeof(SOG.Point), NameAndRankValueAttribute.SPECKLE_DEFAULT_RANK)] public class PointToHostTopLevelConverter : SpeckleToHostGeometryBaseTopLevelConverter { public PointToHostTopLevelConverter( diff --git a/Converters/Rhino/Speckle.Converters.RhinoShared/ToHost/TopLevel/PolycurveToHostTopLevelConverter.cs b/Converters/Rhino/Speckle.Converters.RhinoShared/ToHost/TopLevel/PolycurveToHostTopLevelConverter.cs index 7a523999d..84f178e54 100644 --- a/Converters/Rhino/Speckle.Converters.RhinoShared/ToHost/TopLevel/PolycurveToHostTopLevelConverter.cs +++ b/Converters/Rhino/Speckle.Converters.RhinoShared/ToHost/TopLevel/PolycurveToHostTopLevelConverter.cs @@ -3,7 +3,7 @@ namespace Speckle.Converters.Rhino.ToHost.TopLevel; -[NameAndRankValue(nameof(SOG.Polycurve), NameAndRankValueAttribute.SPECKLE_DEFAULT_RANK)] +[NameAndRankValue(typeof(SOG.Polycurve), NameAndRankValueAttribute.SPECKLE_DEFAULT_RANK)] public class PolycurveToHostTopLevelConverter : SpeckleToHostGeometryBaseTopLevelConverter { public PolycurveToHostTopLevelConverter( diff --git a/Converters/Rhino/Speckle.Converters.RhinoShared/ToHost/TopLevel/PolylineToHostTopLevelConverter.cs b/Converters/Rhino/Speckle.Converters.RhinoShared/ToHost/TopLevel/PolylineToHostTopLevelConverter.cs index 6323f955a..d8608ad78 100644 --- a/Converters/Rhino/Speckle.Converters.RhinoShared/ToHost/TopLevel/PolylineToHostTopLevelConverter.cs +++ b/Converters/Rhino/Speckle.Converters.RhinoShared/ToHost/TopLevel/PolylineToHostTopLevelConverter.cs @@ -3,7 +3,7 @@ namespace Speckle.Converters.Rhino.ToHost.TopLevel; -[NameAndRankValue(nameof(SOG.Polyline), NameAndRankValueAttribute.SPECKLE_DEFAULT_RANK)] +[NameAndRankValue(typeof(SOG.Polyline), NameAndRankValueAttribute.SPECKLE_DEFAULT_RANK)] public class PolylineToHostTopLevelConverter : SpeckleToHostGeometryBaseTopLevelConverter { diff --git a/Converters/Rhino/Speckle.Converters.RhinoShared/ToSpeckle/Raw/MeshToSpeckleConverter.cs b/Converters/Rhino/Speckle.Converters.RhinoShared/ToSpeckle/Raw/MeshToSpeckleConverter.cs index 54c68c543..b8e36647f 100644 --- a/Converters/Rhino/Speckle.Converters.RhinoShared/ToSpeckle/Raw/MeshToSpeckleConverter.cs +++ b/Converters/Rhino/Speckle.Converters.RhinoShared/ToSpeckle/Raw/MeshToSpeckleConverter.cs @@ -4,7 +4,7 @@ namespace Speckle.Converters.Rhino.ToSpeckle.Raw; -[NameAndRankValue(nameof(RG.Mesh), NameAndRankValueAttribute.SPECKLE_DEFAULT_RANK)] +[NameAndRankValue(typeof(RG.Mesh), NameAndRankValueAttribute.SPECKLE_DEFAULT_RANK)] public class MeshToSpeckleConverter : ITypedConverter { private readonly ITypedConverter _pointConverter; diff --git a/Converters/Rhino/Speckle.Converters.RhinoShared/ToSpeckle/TopLevel/BrepObjectToSpeckleTopLevelConverter.cs b/Converters/Rhino/Speckle.Converters.RhinoShared/ToSpeckle/TopLevel/BrepObjectToSpeckleTopLevelConverter.cs index c79440bfe..1f5b97268 100644 --- a/Converters/Rhino/Speckle.Converters.RhinoShared/ToSpeckle/TopLevel/BrepObjectToSpeckleTopLevelConverter.cs +++ b/Converters/Rhino/Speckle.Converters.RhinoShared/ToSpeckle/TopLevel/BrepObjectToSpeckleTopLevelConverter.cs @@ -7,7 +7,7 @@ namespace Speckle.Converters.Rhino.ToSpeckle.TopLevel; -[NameAndRankValue(nameof(BrepObject), NameAndRankValueAttribute.SPECKLE_DEFAULT_RANK)] +[NameAndRankValue(typeof(BrepObject), NameAndRankValueAttribute.SPECKLE_DEFAULT_RANK)] public class BrepObjectToSpeckleTopLevelConverter : IToSpeckleTopLevelConverter { private readonly ITypedConverter _meshConverter; diff --git a/Converters/Rhino/Speckle.Converters.RhinoShared/ToSpeckle/TopLevel/CurveObjectToSpeckleTopLevelConverter.cs b/Converters/Rhino/Speckle.Converters.RhinoShared/ToSpeckle/TopLevel/CurveObjectToSpeckleTopLevelConverter.cs index 6db96b2bd..cb5266954 100644 --- a/Converters/Rhino/Speckle.Converters.RhinoShared/ToSpeckle/TopLevel/CurveObjectToSpeckleTopLevelConverter.cs +++ b/Converters/Rhino/Speckle.Converters.RhinoShared/ToSpeckle/TopLevel/CurveObjectToSpeckleTopLevelConverter.cs @@ -5,7 +5,7 @@ namespace Speckle.Converters.Rhino.ToSpeckle.TopLevel; -[NameAndRankValue(nameof(CurveObject), NameAndRankValueAttribute.SPECKLE_DEFAULT_RANK)] +[NameAndRankValue(typeof(CurveObject), NameAndRankValueAttribute.SPECKLE_DEFAULT_RANK)] public class CurveObjectToSpeckleTopLevelConverter : RhinoObjectToSpeckleTopLevelConverter { public CurveObjectToSpeckleTopLevelConverter(ITypedConverter conversion) diff --git a/Converters/Rhino/Speckle.Converters.RhinoShared/ToSpeckle/TopLevel/ExtrusionObjectToSpeckleTopLevelConverter.cs b/Converters/Rhino/Speckle.Converters.RhinoShared/ToSpeckle/TopLevel/ExtrusionObjectToSpeckleTopLevelConverter.cs index 255ed0162..4c5c9abd8 100644 --- a/Converters/Rhino/Speckle.Converters.RhinoShared/ToSpeckle/TopLevel/ExtrusionObjectToSpeckleTopLevelConverter.cs +++ b/Converters/Rhino/Speckle.Converters.RhinoShared/ToSpeckle/TopLevel/ExtrusionObjectToSpeckleTopLevelConverter.cs @@ -7,7 +7,7 @@ namespace Speckle.Converters.Rhino.ToSpeckle.TopLevel; -[NameAndRankValue(nameof(ExtrusionObject), NameAndRankValueAttribute.SPECKLE_DEFAULT_RANK)] +[NameAndRankValue(typeof(ExtrusionObject), NameAndRankValueAttribute.SPECKLE_DEFAULT_RANK)] public class ExtrusionObjectToSpeckleTopLevelConverter : IToSpeckleTopLevelConverter { private readonly ITypedConverter _meshConverter; diff --git a/Converters/Rhino/Speckle.Converters.RhinoShared/ToSpeckle/TopLevel/MeshObjectToSpeckleTopLevelConverter.cs b/Converters/Rhino/Speckle.Converters.RhinoShared/ToSpeckle/TopLevel/MeshObjectToSpeckleTopLevelConverter.cs index dc528dab3..92a4675b1 100644 --- a/Converters/Rhino/Speckle.Converters.RhinoShared/ToSpeckle/TopLevel/MeshObjectToSpeckleTopLevelConverter.cs +++ b/Converters/Rhino/Speckle.Converters.RhinoShared/ToSpeckle/TopLevel/MeshObjectToSpeckleTopLevelConverter.cs @@ -4,7 +4,7 @@ namespace Speckle.Converters.Rhino.ToSpeckle.TopLevel; -[NameAndRankValue(nameof(MeshObject), NameAndRankValueAttribute.SPECKLE_DEFAULT_RANK)] +[NameAndRankValue(typeof(MeshObject), NameAndRankValueAttribute.SPECKLE_DEFAULT_RANK)] public class MeshObjectToSpeckleTopLevelConverter : RhinoObjectToSpeckleTopLevelConverter { public MeshObjectToSpeckleTopLevelConverter(ITypedConverter conversion) diff --git a/Converters/Rhino/Speckle.Converters.RhinoShared/ToSpeckle/TopLevel/PointCloudObjectToSpeckleTopLevelConverter.cs b/Converters/Rhino/Speckle.Converters.RhinoShared/ToSpeckle/TopLevel/PointCloudObjectToSpeckleTopLevelConverter.cs index a5af1cfaa..e26ac0fd1 100644 --- a/Converters/Rhino/Speckle.Converters.RhinoShared/ToSpeckle/TopLevel/PointCloudObjectToSpeckleTopLevelConverter.cs +++ b/Converters/Rhino/Speckle.Converters.RhinoShared/ToSpeckle/TopLevel/PointCloudObjectToSpeckleTopLevelConverter.cs @@ -4,7 +4,7 @@ namespace Speckle.Converters.Rhino.ToSpeckle.TopLevel; -[NameAndRankValue(nameof(PointCloudObject), NameAndRankValueAttribute.SPECKLE_DEFAULT_RANK)] +[NameAndRankValue(typeof(PointCloudObject), NameAndRankValueAttribute.SPECKLE_DEFAULT_RANK)] public class PointCloudObjectToSpeckleTopLevelConverter : RhinoObjectToSpeckleTopLevelConverter { diff --git a/Converters/Rhino/Speckle.Converters.RhinoShared/ToSpeckle/TopLevel/PointObjectToSpeckleTopLevelConverter.cs b/Converters/Rhino/Speckle.Converters.RhinoShared/ToSpeckle/TopLevel/PointObjectToSpeckleTopLevelConverter.cs index 4f480ef2e..3c5493acb 100644 --- a/Converters/Rhino/Speckle.Converters.RhinoShared/ToSpeckle/TopLevel/PointObjectToSpeckleTopLevelConverter.cs +++ b/Converters/Rhino/Speckle.Converters.RhinoShared/ToSpeckle/TopLevel/PointObjectToSpeckleTopLevelConverter.cs @@ -4,7 +4,7 @@ namespace Speckle.Converters.Rhino.ToSpeckle.TopLevel; -[NameAndRankValue(nameof(PointObject), NameAndRankValueAttribute.SPECKLE_DEFAULT_RANK)] +[NameAndRankValue(typeof(PointObject), NameAndRankValueAttribute.SPECKLE_DEFAULT_RANK)] public class PointObjectToSpeckleTopLevelConverter : RhinoObjectToSpeckleTopLevelConverter { diff --git a/Converters/Rhino/Speckle.Converters.RhinoShared/ToSpeckle/TopLevel/SubDObjectToSpeckleTopLevelConverter.cs b/Converters/Rhino/Speckle.Converters.RhinoShared/ToSpeckle/TopLevel/SubDObjectToSpeckleTopLevelConverter.cs index f86839467..20669432f 100644 --- a/Converters/Rhino/Speckle.Converters.RhinoShared/ToSpeckle/TopLevel/SubDObjectToSpeckleTopLevelConverter.cs +++ b/Converters/Rhino/Speckle.Converters.RhinoShared/ToSpeckle/TopLevel/SubDObjectToSpeckleTopLevelConverter.cs @@ -7,7 +7,7 @@ namespace Speckle.Converters.Rhino.ToSpeckle.TopLevel; -[NameAndRankValue(nameof(SubDObject), NameAndRankValueAttribute.SPECKLE_DEFAULT_RANK)] +[NameAndRankValue(typeof(SubDObject), NameAndRankValueAttribute.SPECKLE_DEFAULT_RANK)] public class SubDObjectToSpeckleTopLevelConverter : IToSpeckleTopLevelConverter { private readonly ITypedConverter _meshConverter; diff --git a/Converters/Tekla/Speckle.Converters.TeklaShared/ToSpeckle/TopLevel/ModelObjectToSpeckleConverter.cs b/Converters/Tekla/Speckle.Converters.TeklaShared/ToSpeckle/TopLevel/ModelObjectToSpeckleConverter.cs index 64ba7bf73..759b70e1a 100644 --- a/Converters/Tekla/Speckle.Converters.TeklaShared/ToSpeckle/TopLevel/ModelObjectToSpeckleConverter.cs +++ b/Converters/Tekla/Speckle.Converters.TeklaShared/ToSpeckle/TopLevel/ModelObjectToSpeckleConverter.cs @@ -7,7 +7,7 @@ namespace Speckle.Converters.TeklaShared.ToSpeckle.TopLevel; -[NameAndRankValue(nameof(TSM.ModelObject), NameAndRankValueAttribute.SPECKLE_DEFAULT_RANK)] +[NameAndRankValue(typeof(TSM.ModelObject), NameAndRankValueAttribute.SPECKLE_DEFAULT_RANK)] public class ModelObjectToSpeckleConverter : IToSpeckleTopLevelConverter { private readonly IConverterSettingsStore _settingsStore; diff --git a/Sdk/Speckle.Converters.Common.Tests/ConverterManagerTests.cs b/Sdk/Speckle.Converters.Common.Tests/ConverterManagerTests.cs index fedef0ee7..6cda24beb 100644 --- a/Sdk/Speckle.Converters.Common.Tests/ConverterManagerTests.cs +++ b/Sdk/Speckle.Converters.Common.Tests/ConverterManagerTests.cs @@ -36,7 +36,7 @@ public void Test_Null() [Test] public void Test_NoFallback() { - var sut = SetupManager("String", typeof(TestConverter)); + var sut = SetupManager("System.String", typeof(TestConverter)); var converter = sut.ResolveConverter(typeof(string), false); converter.Should().NotBeNull(); } @@ -44,7 +44,7 @@ public void Test_NoFallback() [Test] public void Test_Fallback() { - var sut = SetupManager("Object", typeof(TestConverter)); + var sut = SetupManager("System.Object", typeof(TestConverter)); var converter = sut.ResolveConverter(typeof(string), true); converter.Should().NotBeNull(); } diff --git a/Sdk/Speckle.Converters.Common/NameAndRankValueAttribute.cs b/Sdk/Speckle.Converters.Common/NameAndRankValueAttribute.cs index 54f380eeb..cea30ccac 100644 --- a/Sdk/Speckle.Converters.Common/NameAndRankValueAttribute.cs +++ b/Sdk/Speckle.Converters.Common/NameAndRankValueAttribute.cs @@ -2,17 +2,11 @@ // POC: maybe better to put in utils/reflection [AttributeUsage(AttributeTargets.Class)] -public sealed class NameAndRankValueAttribute : Attribute +public sealed class NameAndRankValueAttribute(Type type, int rank) : Attribute { // DO NOT CHANGE! This is the base, lowest rank for a conversion public const int SPECKLE_DEFAULT_RANK = 0; - public string Name { get; private set; } - public int Rank { get; private set; } - - public NameAndRankValueAttribute(string name, int rank) - { - Name = name; - Rank = rank; - } + public Type Type { get; private set; } = type; + public int Rank { get; private set; } = rank; } diff --git a/Sdk/Speckle.Converters.Common/Registration/ConverterManager.cs b/Sdk/Speckle.Converters.Common/Registration/ConverterManager.cs index 49a1558fd..ad90785ec 100644 --- a/Sdk/Speckle.Converters.Common/Registration/ConverterManager.cs +++ b/Sdk/Speckle.Converters.Common/Registration/ConverterManager.cs @@ -1,5 +1,6 @@ using System.Collections.Concurrent; using Microsoft.Extensions.DependencyInjection; +using Speckle.Sdk.Common; using Speckle.Sdk.Common.Exceptions; namespace Speckle.Converters.Common.Registration; @@ -14,7 +15,7 @@ public T ResolveConverter(Type type, bool recursive = true) var currentType = type; while (true) { - var typeName = currentType.Name; + var typeName = currentType.FullName.NotNull(); var converter = GetConverterByType(typeName); if (converter is null && recursive) { @@ -37,9 +38,9 @@ public T ResolveConverter(Type type, bool recursive = true) } } - private T? GetConverterByType(string typeName) + private T? GetConverterByType(string fullName) { - if (converterTypes.TryGetValue(typeName, out var converter)) + if (converterTypes.TryGetValue(fullName, out var converter)) { return (T)ActivatorUtilities.CreateInstance(serviceProvider, converter); } diff --git a/Sdk/Speckle.Converters.Common/Registration/ServiceRegistration.cs b/Sdk/Speckle.Converters.Common/Registration/ServiceRegistration.cs index d294b909a..254bb2004 100644 --- a/Sdk/Speckle.Converters.Common/Registration/ServiceRegistration.cs +++ b/Sdk/Speckle.Converters.Common/Registration/ServiceRegistration.cs @@ -44,41 +44,41 @@ Assembly converterAssembly public static void AddConverters(this IServiceCollection serviceCollection, Assembly converterAssembly) { ConcurrentDictionary converterTypes = new(); - var types = converterAssembly.ExportedTypes.Where(x => x.GetInterfaces().Contains(typeof(T))); + var exportedTypes = converterAssembly.ExportedTypes.Where(x => x.GetInterfaces().Contains(typeof(T))); // we only care about named types - var byName = types + var byName = exportedTypes .Where(x => x.GetCustomAttribute() != null) .Select(x => { var nameAndRank = x.GetCustomAttribute().NotNull(); - return (name: nameAndRank.Name, rank: nameAndRank.Rank, type: x); + return (Type: nameAndRank.Type, Rank: nameAndRank.Rank, Converter: x); }) .ToList(); // we'll register the types accordingly - var names = byName.Select(x => x.name).Distinct(); - foreach (string name in names) + var types = byName.Select(x => x.Type).Distinct(); + foreach (Type type in types) { - var namedTypes = byName.Where(x => x.name == name).OrderByDescending(y => y.rank).ToList(); + var namedTypes = byName.Where(x => x.Type == type).OrderByDescending(y => y.Rank).ToList(); // first type found var first = namedTypes[0]; // POC: may need to be instance per lifecycle scope - converterTypes.TryAdd(first.name, first.type); + converterTypes.TryAdd(first.Type.FullName.NotNull(), first.Converter); // POC: not sure yet if... // * This should be an array of types // * Whether the scope should be modified or modifiable // * Whether this is in the write project... hmmm // POC: IsAssignableFrom() - var secondaryType = first.type.GetInterface(typeof(ITypedConverter<,>).Name); + var secondaryType = first.Type.GetInterface(typeof(ITypedConverter<,>).Name); // POC: should we explode if no found? if (secondaryType != null) { - converterTypes.TryAdd(first.name, secondaryType); + converterTypes.TryAdd(first.Type.FullName, secondaryType); } // register subsequent types with rank From 1d910bfc45a1d63d2aacbf7b6e1be823ee839662 Mon Sep 17 00:00:00 2001 From: Claire Kuang Date: Fri, 10 Jan 2025 14:22:42 +0000 Subject: [PATCH 02/11] fix(civil): adds top level cogopoint converter (#476) * adds top level cogopoint converter * change to typeof --------- Co-authored-by: Adam Hathcock --- .../Civil3dRootToSpeckleConverter.cs | 2 + ...Speckle.Converters.Civil3dShared.projitems | 1 + .../Point3dCollectionToSpeckleRawConverter.cs | 7 +- .../CivilEntityToSpeckleTopLevelConverter.cs | 2 +- .../CogoPointToSpeckleTopLevelConverter.cs | 65 +++++++++++++++++++ 5 files changed, 70 insertions(+), 7 deletions(-) create mode 100644 Converters/Civil3d/Speckle.Converters.Civil3dShared/ToSpeckle/TopLevel/CogoPointToSpeckleTopLevelConverter.cs diff --git a/Converters/Civil3d/Speckle.Converters.Civil3dShared/Civil3dRootToSpeckleConverter.cs b/Converters/Civil3d/Speckle.Converters.Civil3dShared/Civil3dRootToSpeckleConverter.cs index aefb201ac..fd056b5f2 100644 --- a/Converters/Civil3d/Speckle.Converters.Civil3dShared/Civil3dRootToSpeckleConverter.cs +++ b/Converters/Civil3d/Speckle.Converters.Civil3dShared/Civil3dRootToSpeckleConverter.cs @@ -34,6 +34,8 @@ public Base Convert(object target) object objectToConvert = dbObject; // check first for civil type objects + // POC: some classes (eg Civil.DatabaseServices.CogoPoint) actually inherit from Autocad.DatabaseServices.Entity instead of Civil!! + // These need top level converters in Civil for now, but in the future we should implement a EntityToSpeckleTopLevelConverter for Autocad as well. if (target is CDB.Entity civilEntity) { type = civilEntity.GetType(); diff --git a/Converters/Civil3d/Speckle.Converters.Civil3dShared/Speckle.Converters.Civil3dShared.projitems b/Converters/Civil3d/Speckle.Converters.Civil3dShared/Speckle.Converters.Civil3dShared.projitems index 0e98b9c50..0ab60d801 100644 --- a/Converters/Civil3d/Speckle.Converters.Civil3dShared/Speckle.Converters.Civil3dShared.projitems +++ b/Converters/Civil3d/Speckle.Converters.Civil3dShared/Speckle.Converters.Civil3dShared.projitems @@ -23,6 +23,7 @@ + diff --git a/Converters/Civil3d/Speckle.Converters.Civil3dShared/ToSpeckle/Raw/Point3dCollectionToSpeckleRawConverter.cs b/Converters/Civil3d/Speckle.Converters.Civil3dShared/ToSpeckle/Raw/Point3dCollectionToSpeckleRawConverter.cs index b2c29160b..53ab432db 100644 --- a/Converters/Civil3d/Speckle.Converters.Civil3dShared/ToSpeckle/Raw/Point3dCollectionToSpeckleRawConverter.cs +++ b/Converters/Civil3d/Speckle.Converters.Civil3dShared/ToSpeckle/Raw/Point3dCollectionToSpeckleRawConverter.cs @@ -5,15 +5,10 @@ namespace Speckle.Converters.Civil3dShared.ToSpeckle.Raw; public class Point3dCollectionToSpeckleRawConverter : ITypedConverter { - private readonly ITypedConverter _pointConverter; private readonly IConverterSettingsStore _settingsStore; - public Point3dCollectionToSpeckleRawConverter( - ITypedConverter pointConverter, - IConverterSettingsStore settingsStore - ) + public Point3dCollectionToSpeckleRawConverter(IConverterSettingsStore settingsStore) { - _pointConverter = pointConverter; _settingsStore = settingsStore; } diff --git a/Converters/Civil3d/Speckle.Converters.Civil3dShared/ToSpeckle/TopLevel/CivilEntityToSpeckleTopLevelConverter.cs b/Converters/Civil3d/Speckle.Converters.Civil3dShared/ToSpeckle/TopLevel/CivilEntityToSpeckleTopLevelConverter.cs index c3a2acfde..a98c9a0cd 100644 --- a/Converters/Civil3d/Speckle.Converters.Civil3dShared/ToSpeckle/TopLevel/CivilEntityToSpeckleTopLevelConverter.cs +++ b/Converters/Civil3d/Speckle.Converters.Civil3dShared/ToSpeckle/TopLevel/CivilEntityToSpeckleTopLevelConverter.cs @@ -7,7 +7,7 @@ using Speckle.Sdk; using Speckle.Sdk.Models; -namespace Speckle.Converters.Civil3dShared.ToSpeckle.BuiltElements; +namespace Speckle.Converters.Civil3dShared.ToSpeckle.TopLevel; [NameAndRankValue(typeof(CDB.Entity), NameAndRankValueAttribute.SPECKLE_DEFAULT_RANK)] public class CivilEntityToSpeckleTopLevelConverter : IToSpeckleTopLevelConverter diff --git a/Converters/Civil3d/Speckle.Converters.Civil3dShared/ToSpeckle/TopLevel/CogoPointToSpeckleTopLevelConverter.cs b/Converters/Civil3d/Speckle.Converters.Civil3dShared/ToSpeckle/TopLevel/CogoPointToSpeckleTopLevelConverter.cs new file mode 100644 index 000000000..461f97f56 --- /dev/null +++ b/Converters/Civil3d/Speckle.Converters.Civil3dShared/ToSpeckle/TopLevel/CogoPointToSpeckleTopLevelConverter.cs @@ -0,0 +1,65 @@ +using Speckle.Converters.Civil3dShared.Extensions; +using Speckle.Converters.Common; +using Speckle.Converters.Common.Objects; +using Speckle.Objects.Data; +using Speckle.Sdk; +using Speckle.Sdk.Models; + +namespace Speckle.Converters.Civil3dShared.ToSpeckle.TopLevel; + +/// +/// This top level converter is needed because the namespace of CogoPoint is Autodesk.Civil.DatabaseServices, but the inheritance of CogoPoint is Autodesk.Autocad.Entity +/// This means cogo points will *not* be picked up by the top level civil entity converter. +/// POC: implementing a top level autocad entity converter can probably replace this converter. +/// +[NameAndRankValue(typeof(CDB.CogoPoint), NameAndRankValueAttribute.SPECKLE_DEFAULT_RANK)] +public class CogoPointToSpeckleTopLevelConverter : IToSpeckleTopLevelConverter +{ + private readonly IConverterSettingsStore _settingsStore; + private readonly ITypedConverter _pointConverter; + + public CogoPointToSpeckleTopLevelConverter( + IConverterSettingsStore settingsStore, + ITypedConverter pointConverter + ) + { + _settingsStore = settingsStore; + _pointConverter = pointConverter; + } + + public Base Convert(object target) => Convert((CDB.CogoPoint)target); + + public Civil3dObject Convert(CDB.CogoPoint target) + { + string name = ""; + try + { + name = target.PointName; + } + catch (Autodesk.Civil.CivilException e) when (!e.IsFatal()) { } // throws if name doesn't exist + + // extract display value as point + SOG.Point displayPoint = _pointConverter.Convert(target.Location); + + Civil3dObject civilObject = + new() + { + name = name, + type = target.GetType().ToString().Split('.').Last(), + baseCurves = null, + elements = new(), + displayValue = new() { displayPoint }, + properties = new(), + units = _settingsStore.Current.SpeckleUnits, + applicationId = target.Id.GetSpeckleApplicationId() + }; + + // add additional class properties + civilObject["pointNumber"] = target.PointNumber; + civilObject["northing"] = target.Northing; + //civilObject["latitude"] = target.Latitude; // might not be necessary, and also sometimes throws if transforms are not enabled + //civilObject["longitude"] = target.Longitude; // might not be necessary, and also sometimes throws if transforms are not enabled + + return civilObject; + } +} From 98cfebf5bca3815b980887d917f929d60390c397 Mon Sep 17 00:00:00 2001 From: Dimitrie Stefanescu Date: Fri, 10 Jan 2025 18:51:05 +0000 Subject: [PATCH 03/11] feat: cleans up categories and prevents (most) unsupported/unnecessary element sending --- .../HostApp/SupportedCategoriesUtils.cs | 21 +++++++++++++++++++ .../Send/Filters/RevitCategoriesFilter.cs | 6 +++++- .../Operations/Send/RevitRootObjectBuilder.cs | 18 +++++++++++++--- .../Speckle.Connectors.RevitShared.projitems | 1 + 4 files changed, 42 insertions(+), 4 deletions(-) create mode 100644 Connectors/Revit/Speckle.Connectors.RevitShared/HostApp/SupportedCategoriesUtils.cs diff --git a/Connectors/Revit/Speckle.Connectors.RevitShared/HostApp/SupportedCategoriesUtils.cs b/Connectors/Revit/Speckle.Connectors.RevitShared/HostApp/SupportedCategoriesUtils.cs new file mode 100644 index 000000000..3a15ddff9 --- /dev/null +++ b/Connectors/Revit/Speckle.Connectors.RevitShared/HostApp/SupportedCategoriesUtils.cs @@ -0,0 +1,21 @@ +using Autodesk.Revit.DB; + +namespace Speckle.Connectors.Revit.HostApp; + +public static class SupportedCategoriesUtils +{ + /// + /// Filters out all categories besides Model categories. This utility should be used + /// to clean any elements we might want to send pre-conversion as well as in what categories + /// to display in our category filter. + /// + /// + /// + public static bool IsSupportedCategory(Category category) + { + return ( + category.CategoryType == CategoryType.Model + // || category.CategoryType == CategoryType.AnalyticalModel + ) && category.IsVisibleInUI; + } +} diff --git a/Connectors/Revit/Speckle.Connectors.RevitShared/Operations/Send/Filters/RevitCategoriesFilter.cs b/Connectors/Revit/Speckle.Connectors.RevitShared/Operations/Send/Filters/RevitCategoriesFilter.cs index 25e3d017c..5a3f9b3ee 100644 --- a/Connectors/Revit/Speckle.Connectors.RevitShared/Operations/Send/Filters/RevitCategoriesFilter.cs +++ b/Connectors/Revit/Speckle.Connectors.RevitShared/Operations/Send/Filters/RevitCategoriesFilter.cs @@ -2,6 +2,7 @@ using Speckle.Connectors.DUI.Exceptions; using Speckle.Connectors.DUI.Models.Card.SendFilter; using Speckle.Connectors.DUI.Utils; +using Speckle.Connectors.Revit.HostApp; using Speckle.Converters.RevitShared.Helpers; namespace Speckle.Connectors.RevitShared.Operations.Send.Filters; @@ -69,7 +70,10 @@ private void GetCategories() foreach (Category category in _doc.Settings.Categories) { - categories.Add(new CategoryData(category.Name, category.Id.ToString())); + if (SupportedCategoriesUtils.IsSupportedCategory(category)) + { + categories.Add(new CategoryData(category.Name, category.Id.ToString())); + } } AvailableCategories = categories; diff --git a/Connectors/Revit/Speckle.Connectors.RevitShared/Operations/Send/RevitRootObjectBuilder.cs b/Connectors/Revit/Speckle.Connectors.RevitShared/Operations/Send/RevitRootObjectBuilder.cs index aa9b467cb..c3bb99516 100644 --- a/Connectors/Revit/Speckle.Connectors.RevitShared/Operations/Send/RevitRootObjectBuilder.cs +++ b/Connectors/Revit/Speckle.Connectors.RevitShared/Operations/Send/RevitRootObjectBuilder.cs @@ -53,15 +53,27 @@ CancellationToken cancellationToken foreach (var id in objects) { var el = converterSettings.Current.Document.GetElement(id); - if (el != null) + if (el == null) { - revitElements.Add(el); + continue; } + + if (el.Category == null) + { + continue; + } + + if (!SupportedCategoriesUtils.IsSupportedCategory(el.Category)) + { + continue; + } + + revitElements.Add(el); } if (revitElements.Count == 0) { - throw new SpeckleSendFilterException("No objects were found. Please update your send filter!"); + throw new SpeckleSendFilterException("No objects were found. Please update your publish filter!"); } List results = new(revitElements.Count); diff --git a/Connectors/Revit/Speckle.Connectors.RevitShared/Speckle.Connectors.RevitShared.projitems b/Connectors/Revit/Speckle.Connectors.RevitShared/Speckle.Connectors.RevitShared.projitems index 5293ad708..890736c53 100644 --- a/Connectors/Revit/Speckle.Connectors.RevitShared/Speckle.Connectors.RevitShared.projitems +++ b/Connectors/Revit/Speckle.Connectors.RevitShared/Speckle.Connectors.RevitShared.projitems @@ -22,6 +22,7 @@ + From 165c0c9f0dfceb56d3eb7ef13fc4767b2bad10a6 Mon Sep 17 00:00:00 2001 From: Dimitrie Stefanescu Date: Fri, 10 Jan 2025 18:51:47 +0000 Subject: [PATCH 04/11] feat: cleans up views --- .../Operations/Send/Filters/RevitViewsFilter.cs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/Connectors/Revit/Speckle.Connectors.RevitShared/Operations/Send/Filters/RevitViewsFilter.cs b/Connectors/Revit/Speckle.Connectors.RevitShared/Operations/Send/Filters/RevitViewsFilter.cs index d5ae8f0e9..23ef2c874 100644 --- a/Connectors/Revit/Speckle.Connectors.RevitShared/Operations/Send/Filters/RevitViewsFilter.cs +++ b/Connectors/Revit/Speckle.Connectors.RevitShared/Operations/Send/Filters/RevitViewsFilter.cs @@ -88,6 +88,18 @@ private void GetViews() .OfClass(typeof(View)) .Cast() .Where(v => !v.IsTemplate) + .Where(v => !v.IsModifiable || !v.IsAssemblyView) + .Where(v => + v.ViewType + is ViewType.FloorPlan + or ViewType.Elevation + or ViewType.Rendering + or ViewType.Section + or ViewType.ThreeD + or ViewType.Detail + or ViewType.CeilingPlan + or ViewType.AreaPlan + ) .Select(v => v.ViewType.ToString() + " - " + v.Name.ToString()) .ToList(); AvailableViews = views; From 25e37e257e6112dc89a60c929834db4fde1681f6 Mon Sep 17 00:00:00 2001 From: Dimitrie Stefanescu Date: Fri, 10 Jan 2025 18:52:13 +0000 Subject: [PATCH 05/11] fix/performance: prevents endless throws for elements with invalid locations --- .../TopLevel/RevitElementTopLevelConverterToSpeckle.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Converters/Revit/Speckle.Converters.RevitShared/ToSpeckle/TopLevel/RevitElementTopLevelConverterToSpeckle.cs b/Converters/Revit/Speckle.Converters.RevitShared/ToSpeckle/TopLevel/RevitElementTopLevelConverterToSpeckle.cs index 8e58a17f5..7ff3fbd33 100644 --- a/Converters/Revit/Speckle.Converters.RevitShared/ToSpeckle/TopLevel/RevitElementTopLevelConverterToSpeckle.cs +++ b/Converters/Revit/Speckle.Converters.RevitShared/ToSpeckle/TopLevel/RevitElementTopLevelConverterToSpeckle.cs @@ -73,7 +73,7 @@ public RevitObject Convert(DB.Element target) // get location if any Base? convertedLocation = null; - if (target.Location is DB.Location location) // location can be null + if (target.Location is DB.Location location and (DB.LocationCurve or DB.LocationPoint)) // location can be null { try { From 9466d8b88308f9ecbaf17e0b62a1f60e8567dcd0 Mon Sep 17 00:00:00 2001 From: Dimitrie Stefanescu Date: Fri, 10 Jan 2025 19:26:02 +0000 Subject: [PATCH 06/11] fix: review comment --- .../Operations/Send/RevitRootObjectBuilder.cs | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/Connectors/Revit/Speckle.Connectors.RevitShared/Operations/Send/RevitRootObjectBuilder.cs b/Connectors/Revit/Speckle.Connectors.RevitShared/Operations/Send/RevitRootObjectBuilder.cs index c3bb99516..1983ba735 100644 --- a/Connectors/Revit/Speckle.Connectors.RevitShared/Operations/Send/RevitRootObjectBuilder.cs +++ b/Connectors/Revit/Speckle.Connectors.RevitShared/Operations/Send/RevitRootObjectBuilder.cs @@ -48,7 +48,7 @@ CancellationToken cancellationToken rootObject["units"] = converterSettings.Current.SpeckleUnits; var revitElements = new List(); - + List results = new(revitElements.Count); // Convert ids to actual revit elements foreach (var id in objects) { @@ -65,6 +65,15 @@ CancellationToken cancellationToken if (!SupportedCategoriesUtils.IsSupportedCategory(el.Category)) { + results.Add( + new( + Status.WARNING, + el.UniqueId, + el.Category.Name, + null, + new SpeckleException($"Category {el.Category.Name} is not supported.") + ) + ); continue; } @@ -76,8 +85,6 @@ CancellationToken cancellationToken throw new SpeckleSendFilterException("No objects were found. Please update your publish filter!"); } - List results = new(revitElements.Count); - // Unpack groups (& other complex data structures) var atomicObjects = elementUnpacker.UnpackSelectionForConversion(revitElements).ToList(); From 87ffe5b5f82e8949060ee25db4fc310300d54a61 Mon Sep 17 00:00:00 2001 From: Dimitrie Stefanescu Date: Fri, 10 Jan 2025 19:27:53 +0000 Subject: [PATCH 07/11] fix: revit 2022 error --- .../Operations/Send/Filters/RevitViewsFilter.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Connectors/Revit/Speckle.Connectors.RevitShared/Operations/Send/Filters/RevitViewsFilter.cs b/Connectors/Revit/Speckle.Connectors.RevitShared/Operations/Send/Filters/RevitViewsFilter.cs index 23ef2c874..ac54ab0c6 100644 --- a/Connectors/Revit/Speckle.Connectors.RevitShared/Operations/Send/Filters/RevitViewsFilter.cs +++ b/Connectors/Revit/Speckle.Connectors.RevitShared/Operations/Send/Filters/RevitViewsFilter.cs @@ -88,7 +88,7 @@ private void GetViews() .OfClass(typeof(View)) .Cast() .Where(v => !v.IsTemplate) - .Where(v => !v.IsModifiable || !v.IsAssemblyView) + .Where(v => !v.IsAssemblyView) .Where(v => v.ViewType is ViewType.FloorPlan From 825945a54772d5f3cea8a3949452b4641122e972 Mon Sep 17 00:00:00 2001 From: Dimitrie Stefanescu Date: Fri, 10 Jan 2025 19:55:13 +0000 Subject: [PATCH 08/11] fix: ignoring extra categories we cannot support correctly --- .../HostApp/SupportedCategoriesUtils.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Connectors/Revit/Speckle.Connectors.RevitShared/HostApp/SupportedCategoriesUtils.cs b/Connectors/Revit/Speckle.Connectors.RevitShared/HostApp/SupportedCategoriesUtils.cs index 3a15ddff9..911f9d67d 100644 --- a/Connectors/Revit/Speckle.Connectors.RevitShared/HostApp/SupportedCategoriesUtils.cs +++ b/Connectors/Revit/Speckle.Connectors.RevitShared/HostApp/SupportedCategoriesUtils.cs @@ -16,6 +16,9 @@ public static bool IsSupportedCategory(Category category) return ( category.CategoryType == CategoryType.Model // || category.CategoryType == CategoryType.AnalyticalModel - ) && category.IsVisibleInUI; + ) + && category.BuiltInCategory != BuiltInCategory.OST_AreaSchemes + && category.BuiltInCategory != BuiltInCategory.OST_AreaSchemeLines + && category.IsVisibleInUI; } } From 745886e9dd5c77153b9d98877dbef0e393dd28d5 Mon Sep 17 00:00:00 2001 From: Dimitrie Stefanescu Date: Fri, 10 Jan 2025 20:05:32 +0000 Subject: [PATCH 09/11] chore: adds comment i missed out on earlier --- .../TopLevel/RevitElementTopLevelConverterToSpeckle.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Converters/Revit/Speckle.Converters.RevitShared/ToSpeckle/TopLevel/RevitElementTopLevelConverterToSpeckle.cs b/Converters/Revit/Speckle.Converters.RevitShared/ToSpeckle/TopLevel/RevitElementTopLevelConverterToSpeckle.cs index 7ff3fbd33..cac374104 100644 --- a/Converters/Revit/Speckle.Converters.RevitShared/ToSpeckle/TopLevel/RevitElementTopLevelConverterToSpeckle.cs +++ b/Converters/Revit/Speckle.Converters.RevitShared/ToSpeckle/TopLevel/RevitElementTopLevelConverterToSpeckle.cs @@ -81,6 +81,9 @@ public RevitObject Convert(DB.Element target) } catch (ValidationException) { + // NOTE: i've improved the if check above to make sure we never reach here + // we were throwing a lot here for various elements (e.g. floors) and we would + // be slowing things down // location was not a supported, do not attach to base element } } From 49ef7d1353b25846911147a15d80a9b4df6cb033 Mon Sep 17 00:00:00 2001 From: Dimitrie Stefanescu Date: Fri, 10 Jan 2025 20:37:51 +0000 Subject: [PATCH 10/11] fix: revit 2022 --- .../HostApp/SupportedCategoriesUtils.cs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Connectors/Revit/Speckle.Connectors.RevitShared/HostApp/SupportedCategoriesUtils.cs b/Connectors/Revit/Speckle.Connectors.RevitShared/HostApp/SupportedCategoriesUtils.cs index 911f9d67d..192952c8a 100644 --- a/Connectors/Revit/Speckle.Connectors.RevitShared/HostApp/SupportedCategoriesUtils.cs +++ b/Connectors/Revit/Speckle.Connectors.RevitShared/HostApp/SupportedCategoriesUtils.cs @@ -17,8 +17,13 @@ public static bool IsSupportedCategory(Category category) category.CategoryType == CategoryType.Model // || category.CategoryType == CategoryType.AnalyticalModel ) +#if REVIT_2023_OR_GREATER && category.BuiltInCategory != BuiltInCategory.OST_AreaSchemes && category.BuiltInCategory != BuiltInCategory.OST_AreaSchemeLines +#else + && category.Name != "OST_AreaSchemeLines" + && category.Name != "OST_AreaSchemes" +#endif && category.IsVisibleInUI; } } From 029e10b661f5d19bc1e133eacb2989a0b79aa3c9 Mon Sep 17 00:00:00 2001 From: KatKatKateryna <89912278+KatKatKateryna@users.noreply.github.com> Date: Mon, 13 Jan 2025 11:22:37 +0000 Subject: [PATCH 11/11] fix path encoding (#481) * fix path encoding * add comments * more compact --- .../ArcGISConversionSettingsFactory.cs | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/Converters/ArcGIS/Speckle.Converters.ArcGIS3/ArcGISConversionSettingsFactory.cs b/Converters/ArcGIS/Speckle.Converters.ArcGIS3/ArcGISConversionSettingsFactory.cs index e0464be1b..d1aa36b1e 100644 --- a/Converters/ArcGIS/Speckle.Converters.ArcGIS3/ArcGISConversionSettingsFactory.cs +++ b/Converters/ArcGIS/Speckle.Converters.ArcGIS3/ArcGISConversionSettingsFactory.cs @@ -60,15 +60,15 @@ or System.Security.SecurityException public Uri ValidateDatabasePath(Uri originalGatabasePath) { var fGdbName = originalGatabasePath.Segments[^1]; - var parentFolder = Path.GetDirectoryName(originalGatabasePath.AbsolutePath); - if (parentFolder == null) - { - // POC: customize the exception type - throw new ArgumentException($"Invalid path: {originalGatabasePath}"); - } + // Uri.AbsolutePath will return escaped string (replacing spaces), we need them back via .UnescapeDataString + var parentFolder = Uri.UnescapeDataString( + Path.GetDirectoryName(originalGatabasePath.AbsolutePath) + ?? throw new ArgumentException($"Invalid path: {originalGatabasePath}") + ); Uri databasePath = originalGatabasePath; Item folderToAdd = ItemFactory.Instance.Create(parentFolder); + if (folderToAdd is null) { // ArcGIS API doesn't show it as nullable, but it is @@ -133,7 +133,10 @@ public Uri ValidateDatabasePath(Uri originalGatabasePath) public Uri AddDatabaseToProject(Uri databasePath) { // Add a folder connection to a project - var parentFolder = Path.GetDirectoryName(databasePath.AbsolutePath); + // Uri.AbsolutePath will return escaped string (replacing spaces), we need them back via .UnescapeDataString + var parentFolder = Uri.UnescapeDataString( + Path.GetDirectoryName(databasePath.AbsolutePath) ?? throw new ArgumentException($"Invalid path: {databasePath}") + ); var fGdbName = databasePath.Segments[^1]; Item folderToAdd = ItemFactory.Instance.Create(parentFolder); Project.Current.AddItem(folderToAdd as IProjectItem);