diff --git a/ConnectorAutocadCivil/ConnectorAutocadCivil.slnf b/ConnectorAutocadCivil/ConnectorAutocadCivil.slnf index 38e498ad3c..72900fe54e 100644 --- a/ConnectorAutocadCivil/ConnectorAutocadCivil.slnf +++ b/ConnectorAutocadCivil/ConnectorAutocadCivil.slnf @@ -5,10 +5,12 @@ "ConnectorAutocadCivil\\ConnectorAutocad2021\\ConnectorAutocad2021.csproj", "ConnectorAutocadCivil\\ConnectorAutocad2022\\ConnectorAutocad2022.csproj", "ConnectorAutocadCivil\\ConnectorAutocad2023\\ConnectorAutocad2023.csproj", + "ConnectorAutocadCivil\\ConnectorAutocad2024\\ConnectorAutocad2024.csproj", "ConnectorAutocadCivil\\ConnectorAutocadCivil\\ConnectorAutocadCivilShared.shproj", "ConnectorAutocadCivil\\ConnectorCivil2021\\ConnectorCivil2021.csproj", "ConnectorAutocadCivil\\ConnectorCivil2022\\ConnectorCivil2022.csproj", "ConnectorAutocadCivil\\ConnectorCivil2023\\ConnectorCivil2023.csproj", + "ConnectorAutocadCivil\\ConnectorCivil2024\\ConnectorCivil2024.csproj", "Core\\Core\\Core.csproj", "Core\\Tests\\TestsUnit.csproj", "Core\\Transports\\DiskTransport\\DiskTransport.csproj", @@ -17,10 +19,12 @@ "Objects\\Converters\\ConverterAutocadCivil\\ConverterAutocad2021\\ConverterAutocad2021.csproj", "Objects\\Converters\\ConverterAutocadCivil\\ConverterAutocad2022\\ConverterAutocad2022.csproj", "Objects\\Converters\\ConverterAutocadCivil\\ConverterAutocad2023\\ConverterAutocad2023.csproj", + "Objects\\Converters\\ConverterAutocadCivil\\ConverterAutocad2024\\ConverterAutocad2024.csproj", "Objects\\Converters\\ConverterAutocadCivil\\ConverterAutocadCivilShared\\ConverterAutocadCivilShared.shproj", "Objects\\Converters\\ConverterAutocadCivil\\ConverterCivil2021\\ConverterCivil2021.csproj", "Objects\\Converters\\ConverterAutocadCivil\\ConverterCivil2022\\ConverterCivil2022.csproj", "Objects\\Converters\\ConverterAutocadCivil\\ConverterCivil2023\\ConverterCivil2023.csproj", + "Objects\\Converters\\ConverterAutocadCivil\\ConverterCivil2024\\ConverterCivil2024.csproj", "Objects\\Objects\\Objects.csproj", "Objects\\Tests\\Tests.csproj" ] diff --git a/ConnectorRhino/ConnectorRhino/ConnectorRhinoShared/UI/ConnectorBindingsRhino.Receive.cs b/ConnectorRhino/ConnectorRhino/ConnectorRhinoShared/UI/ConnectorBindingsRhino.Receive.cs index f5abbb3348..1ab4cd80f6 100644 --- a/ConnectorRhino/ConnectorRhino/ConnectorRhinoShared/UI/ConnectorBindingsRhino.Receive.cs +++ b/ConnectorRhino/ConnectorRhino/ConnectorRhinoShared/UI/ConnectorBindingsRhino.Receive.cs @@ -143,7 +143,7 @@ public override async Task ReceiveStream(StreamState state, Progres var containers = Preview .Select(o => o.Container) .Distinct() - .ToList() + .Where(o => !string.IsNullOrEmpty(o)) .OrderBy(path => path.Count(c => c == ':')) .ToList(); // if on create mode, make sure the parent commit layer is created first @@ -219,8 +219,8 @@ public override async Task ReceiveStream(StreamState state, Progres // Check converter (ViewToNative and LevelToNative) to make sure these names correspond! var name = state.ReceiveMode == ReceiveMode.Create - ? $"{commitLayerName} - {previewObj.applicationId}" - : previewObj.applicationId; + ? $"{commitLayerName} - {StoredObjects[previewObj.OriginalId]["name"] as string}" + : StoredObjects[previewObj.OriginalId]["name"] as string; var viewId = Doc.NamedViews.FindByName(name); var planeId = Doc.NamedConstructionPlanes.Find(name); if (viewId != -1) @@ -338,14 +338,11 @@ ApplicationObject NewAppObj() .Split(new[] { ':' }, StringSplitOptions.RemoveEmptyEntries) .LastOrDefault(); - // get the application id and container - // special cases for views and levels, since we are searching for them by name instead of application id - var applicationId = - speckleType.Contains("View") || speckleType.Contains("Level") - ? current["name"] as string - : current.applicationId; - var container = speckleType.Contains("View") || speckleType.Contains("Level") ? null : containerId; - return new ApplicationObject(current.id, speckleType) { applicationId = applicationId, Container = container }; + return new ApplicationObject(current.id, speckleType) + { + applicationId = current.applicationId, + Container = containerId + }; } // skip if it is the base commit collection diff --git a/Objects/Converters/ConverterRevit/ConverterRevitShared/Partial Classes/ConvertDisplayableObject.cs b/Objects/Converters/ConverterRevit/ConverterRevitShared/Partial Classes/ConvertDisplayableObject.cs index e708aa1faa..e5446779be 100644 --- a/Objects/Converters/ConverterRevit/ConverterRevitShared/Partial Classes/ConvertDisplayableObject.cs +++ b/Objects/Converters/ConverterRevit/ConverterRevitShared/Partial Classes/ConvertDisplayableObject.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Linq; using Autodesk.Revit.DB; @@ -54,38 +54,43 @@ public ApplicationObject DisplayableObjectToNative(Base obj) public RevitCategory GetSpeckleObjectCategory(Base @object) { - switch (@object) + if (Enum.TryParse(@object["category"] as string, out RevitCategory category)) + return category; + else { - case BE.Beam _: - case BE.Brace _: - case BE.TeklaStructures.TeklaContourPlate _: - return RevitCategory.StructuralFraming; - case BE.TeklaStructures.Bolts _: - return RevitCategory.StructConnectionBolts; - case BE.TeklaStructures.Welds _: - return RevitCategory.StructConnectionWelds; - case BE.Floor _: - return RevitCategory.Floors; - case BE.Ceiling _: - return RevitCategory.Ceilings; - case BE.Column _: - return RevitCategory.Columns; - case BE.Pipe _: - return RevitCategory.PipeSegments; - case BE.Rebar _: - return RevitCategory.Rebar; - case BE.Topography _: - return RevitCategory.Topography; - case BE.Wall _: - return RevitCategory.Walls; - case BE.Roof _: - return RevitCategory.Roofs; - case BE.Duct _: - return RevitCategory.DuctSystem; - case BE.CableTray _: - return RevitCategory.CableTray; - default: - return RevitCategory.GenericModel; + switch (@object) + { + case BE.Beam _: + case BE.Brace _: + case BE.TeklaStructures.TeklaContourPlate _: + return RevitCategory.StructuralFraming; + case BE.TeklaStructures.Bolts _: + return RevitCategory.StructConnectionBolts; + case BE.TeklaStructures.Welds _: + return RevitCategory.StructConnectionWelds; + case BE.Floor _: + return RevitCategory.Floors; + case BE.Ceiling _: + return RevitCategory.Ceilings; + case BE.Column _: + return RevitCategory.Columns; + case BE.Pipe _: + return RevitCategory.PipeSegments; + case BE.Rebar _: + return RevitCategory.Rebar; + case BE.Topography _: + return RevitCategory.Topography; + case BE.Wall _: + return RevitCategory.Walls; + case BE.Roof _: + return RevitCategory.Roofs; + case BE.Duct _: + return RevitCategory.DuctSystem; + case BE.CableTray _: + return RevitCategory.CableTray; + default: + return RevitCategory.GenericModel; + } } } } diff --git a/Objects/Converters/ConverterRhinoGh/ConverterRhinoGhShared/ConverterRhinoGh.cs b/Objects/Converters/ConverterRhinoGh/ConverterRhinoGhShared/ConverterRhinoGh.cs index f42dc4a9d6..491862f616 100644 --- a/Objects/Converters/ConverterRhinoGh/ConverterRhinoGhShared/ConverterRhinoGh.cs +++ b/Objects/Converters/ConverterRhinoGh/ConverterRhinoGhShared/ConverterRhinoGh.cs @@ -94,12 +94,11 @@ public void SetConverterSettings(object settings) { if (settings is Dictionary temp) Settings = temp; - // TODO: Both settings bellow are here for backwards compatibility and should be removed after consolidating settings + else if (settings is MeshSettings meshSettings) + SelectedMeshSettings = meshSettings; if (Settings.TryGetValue("preprocessGeometry", out string setting)) bool.TryParse(setting, out PreprocessGeometry); - var s = (MeshSettings)settings; - SelectedMeshSettings = s; } public void SetContextDocument(object doc)