Skip to content

Commit

Permalink
Revit/params novalue (#1589)
Browse files Browse the repository at this point in the history
feat(revit): include parameters with no value
  • Loading branch information
teocomi authored Sep 6, 2022
1 parent 9ca3e92 commit d65b388
Showing 1 changed file with 13 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ private Dictionary<string, Parameter> 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<DB.Parameter>()
.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))
Expand Down Expand Up @@ -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

/// <summary>
/// Returns, if found, the corresponding doc element.
Expand Down Expand Up @@ -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)";
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -853,9 +853,9 @@ private bool CurvesOverlap(ICurve icurveA, ICurve icurveB)
return false;
}

#endregion
#endregion

#region misc
#region misc

public string GetTemplatePath(string templateName)
{
Expand All @@ -873,7 +873,7 @@ public string GetTemplatePath(string templateName)

return templatePath;
}
#endregion
#endregion

private List<ICurve> GetProfiles(DB.SpatialElement room)
{
Expand Down Expand Up @@ -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();
Expand Down Expand Up @@ -1034,7 +1034,7 @@ private static bool IsSupportedMEPCategory(Element e)
return supportedCategories.Any(cat => e.Category.Id == categories.get_Item(cat).Id);
}

#endregion
#endregion


/// <summary>
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit d65b388

Please sign in to comment.