From ff39c5d101f7139448be861bca21e66181fd6482 Mon Sep 17 00:00:00 2001 From: Connor Ivy Date: Thu, 27 Jun 2024 16:35:21 -0500 Subject: [PATCH] remove commented code --- .../Receive/RevitHostObjectBuilder.cs | 71 ------------------- 1 file changed, 71 deletions(-) diff --git a/DUI3-DX/Connectors/Revit/Speckle.Connectors.RevitShared/Operations/Receive/RevitHostObjectBuilder.cs b/DUI3-DX/Connectors/Revit/Speckle.Connectors.RevitShared/Operations/Receive/RevitHostObjectBuilder.cs index b16ff77d04..5c2d19826d 100644 --- a/DUI3-DX/Connectors/Revit/Speckle.Connectors.RevitShared/Operations/Receive/RevitHostObjectBuilder.cs +++ b/DUI3-DX/Connectors/Revit/Speckle.Connectors.RevitShared/Operations/Receive/RevitHostObjectBuilder.cs @@ -90,75 +90,4 @@ private void YieldToUiThread() _timerStarted = currentTime; } - - //private IReadOnlyList HandleConversionResult(object conversionResult, Base originalObject, int layerIndex) - //{ - // var doc = _contextStack.Current.Document; - // List newObjectIds = new(); - // switch (conversionResult) - // { - // case IEnumerable list: - // { - // var group = BakeObjectsAsGroup(originalObject.id, list, layerIndex); - // newObjectIds.Add(group.Id.ToString()); - // break; - // } - // case IRhinoGeometryBase newObject: - // { - // var newObjectGuid = doc.Objects.Add(newObject, _rhinoDocFactory.CreateAttributes(layerIndex)); - // newObjectIds.Add(newObjectGuid.ToString()); - // break; - // } - // default: - // throw new SpeckleConversionException( - // $"Unexpected result from conversion: Expected {nameof(IRhinoGeometryBase)} but instead got {conversionResult.GetType().Name}" - // ); - // } - - // return newObjectIds; - //} - - //private IRhinoGroup BakeObjectsAsGroup(string groupName, IEnumerable list, int layerIndex) - //{ - // var doc = _contextStack.Current.Document; - // var objectIds = list.Select(obj => doc.Objects.Add(obj, _rhinoDocFactory.CreateAttributes(layerIndex))); - // var groupIndex = _contextStack.Current.Document.Groups.Add(groupName, objectIds); - // var group = _contextStack.Current.Document.Groups.FindIndex(groupIndex); - // return group; - //} - - //// POC: This is the original DUI3 function, this will grow over time as we add more conversions that are missing, so it should be refactored out into an ILayerManager or some sort of service. - //private int GetAndCreateLayerFromPath(string[] path, string baseLayerName, Dictionary cache) - //{ - // var currentLayerName = baseLayerName; - // var currentDocument = _contextStack.Current.Document; - - // var previousLayer = currentDocument.Layers.FindName(currentLayerName); - // foreach (var layerName in path) - // { - // currentLayerName = baseLayerName + _rhinoDocFactory.LayerPathSeparator + layerName; - // currentLayerName = currentLayerName.Replace("{", "").Replace("}", ""); // Rhino specific cleanup for gh (see RemoveInvalidRhinoChars) - // if (cache.TryGetValue(currentLayerName, out int value)) - // { - // previousLayer = currentDocument.Layers.FindIndex(value); - // continue; - // } - - // var cleanNewLayerName = layerName.Replace("{", "").Replace("}", ""); - // var newLayer = _rhinoDocFactory.CreateLayer(cleanNewLayerName, previousLayer.Id); - // var index = currentDocument.Layers.Add(newLayer); - // cache.Add(currentLayerName, index); - // previousLayer = currentDocument.Layers.FindIndex(index); // note we need to get the correct id out, hence why we're double calling this - // } - // return previousLayer.Index; - //} - - //[Pure] - //private static string[] GetLayerPath(TraversalContext context) - //{ - // string[] collectionBasedPath = context.GetAscendantOfType().Select(c => c.name).ToArray(); - // string[] reverseOrderPath = - // collectionBasedPath.Length != 0 ? collectionBasedPath : context.GetPropertyPath().ToArray(); - // return reverseOrderPath.Reverse().ToArray(); - //} }