From d65b388364b7e2b1d083ccfce20d3fdb63951841 Mon Sep 17 00:00:00 2001 From: Matteo Cominetti Date: Tue, 6 Sep 2022 12:28:21 +0100 Subject: [PATCH] Revit/params novalue (#1589) feat(revit): include parameters with no value --- .../ConverterRevitShared/ConversionUtils.cs | 26 +++++++++---------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/Objects/Converters/ConverterRevit/ConverterRevitShared/ConversionUtils.cs b/Objects/Converters/ConverterRevit/ConverterRevitShared/ConversionUtils.cs index 92d806ec48..fc2272146a 100644 --- a/Objects/Converters/ConverterRevit/ConverterRevitShared/ConversionUtils.cs +++ b/Objects/Converters/ConverterRevit/ConverterRevitShared/ConversionUtils.cs @@ -212,7 +212,7 @@ private Dictionary GetElementParams(DB.Element element, bool //exclude parameters that don't have a value and those pointing to other elements as we don't support them var revitParameters = element.Parameters.Cast() - .Where(x => x.HasValue && x.StorageType != StorageType.ElementId && !exclusions.Contains(GetParamInternalName(x))).ToList(); + .Where(x => x.StorageType != StorageType.ElementId && !exclusions.Contains(GetParamInternalName(x))).ToList(); //exclude parameters that failed to convert var speckleParameters = revitParameters.Select(x => ParameterToSpeckle(x, isTypeParameter)) @@ -636,9 +636,9 @@ private ElementFilter GetCategoryFilter(Base element) } } -#endregion + #endregion -#region conversion "edit existing if possible" utilities + #region conversion "edit existing if possible" utilities /// /// Returns, if found, the corresponding doc element. @@ -687,9 +687,9 @@ public bool IsIgnore(Element docObj, ApplicationObject appObj, out ApplicationOb else return false; } -#endregion + #endregion -#region Reference Point + #region Reference Point // CAUTION: these strings need to have the same values as in the connector bindings const string InternalOrigin = "Internal Origin (default)"; @@ -779,9 +779,9 @@ public XYZ ToInternalCoordinates(XYZ p, bool isPoint) { return (isPoint) ? ReferencePointTransform.OfPoint(p) : ReferencePointTransform.OfVector(p); } -#endregion + #endregion -#region Floor/ceiling/roof openings + #region Floor/ceiling/roof openings //a floor/roof/ceiling outline can have "voids/holes" for 3 reasons: // - there is a shaft cutting through it > we don't need to create an opening (the shaft will be created on its own) @@ -853,9 +853,9 @@ private bool CurvesOverlap(ICurve icurveA, ICurve icurveB) return false; } -#endregion + #endregion -#region misc + #region misc public string GetTemplatePath(string templateName) { @@ -873,7 +873,7 @@ public string GetTemplatePath(string templateName) return templatePath; } -#endregion + #endregion private List GetProfiles(DB.SpatialElement room) { @@ -915,7 +915,7 @@ public WallLocationLine GetWallLocationLine(LocationLine location) } } -#region materials + #region materials public RenderMaterial GetElementRenderMaterial(DB.Element element) { var matId = element?.GetMaterialIds(false)?.FirstOrDefault(); @@ -1034,7 +1034,7 @@ private static bool IsSupportedMEPCategory(Element e) return supportedCategories.Any(cat => e.Category.Id == categories.get_Item(cat).Id); } -#endregion + #endregion /// @@ -1137,7 +1137,7 @@ public ApplicationObject CheckForExistingObject(Base @base) // skip if element already exists in doc & receive mode is set to ignore if (IsIgnore(docObj, appObj, out appObj)) return appObj; - + // otherwise just create new one if (docObj != null) Doc.Delete(docObj.Id);