Skip to content

Commit

Permalink
fixed camel case naming rule violations
Browse files Browse the repository at this point in the history
  • Loading branch information
jeremytammik committed Feb 25, 2022
1 parent 302fb71 commit cd64213
Show file tree
Hide file tree
Showing 2 changed files with 58 additions and 14 deletions.
70 changes: 56 additions & 14 deletions BuildingCoder/CmdCollectorPerformance.cs
Original file line number Diff line number Diff line change
Expand Up @@ -685,7 +685,7 @@ var collector

#region Electrical stuff for Martin Schmid

private void f()
private void F()
{
// how to get the TemperatureRatingTypeSet?

Expand Down Expand Up @@ -718,7 +718,7 @@ var firstWireMaterialType

#region Filter for various classes

private void f3()
private void F3()
{
var a
= new List<ElementFilter>(3);
Expand All @@ -738,7 +738,7 @@ var collector

// from RevitAPI.chm description of BoundingBoxIntersectsFilter Class
// case 1260682 [Find walls in a specific area]
private void f2()
private void F2()
{
// Use BoundingBoxIntersects filter to find
// elements with a bounding box that intersects
Expand Down Expand Up @@ -958,12 +958,12 @@ private static IEnumerable<FamilySymbol>
{
var doc = door_inst.Document;
var symbol = door_inst.Symbol;
var CW_doors
var cw_doors
= new FilteredElementCollector(
doc, symbol.GetSimilarTypes())
.OfCategory(BuiltInCategory.OST_Doors)
.Cast<FamilySymbol>();
return CW_doors;
return cw_doors;
}

#endregion // Retrieve door family symbols that can be used in a curtain wall
Expand All @@ -974,7 +974,7 @@ var CW_doors
/// Return all tags, optionally
/// material tags only
/// </summary>
private IEnumerable<IndependentTag> GetMaterialTags(
IEnumerable<IndependentTag> GetMaterialTags(
Document doc,
bool material_only)
{
Expand All @@ -988,7 +988,6 @@ var tags
: tags.Where(
tag => tag.IsMaterialTag);
}

#endregion // Retrieve All (Material) Tags

#region Pull Text from Annotation Tags
Expand All @@ -1012,6 +1011,49 @@ var tags

#endregion // Pull Text from Annotation Tags

#region Retrieve tags associated with rectangular fabrication parts
// Filter Fabrication rectangular ducts and the tag associated with it.
// https://forums.autodesk.com/t5/revit-api-forum/filter-fabrication-rectangular-ducts-and-the-tag-associated-with/m-p/10971268
private bool IsRectangularFabricationPart(Element e)
{
FabricationPart f = e as FabricationPart;
return (null != f)
&& ((int) BuiltInCategory.OST_FabricationDuctwork
== f.Category.Id.IntegerValue)
&& f.ConnectorManager.Connectors.Cast<Connector>().Any(
conn => conn.Shape == ConnectorProfileType.Rectangular);
}

private bool IsRectangularFabricationPartTag(IndependentTag t)
{
bool rc = false;
double tagValue;
Element f = t.GetTaggedLocalElements().First();
if(IsRectangularFabricationPart(f))
{
Parameter p = f.LookupParameter("Length");
if( null != p)
{
double length = p.AsDouble();
rc = double.TryParse(t.TagText, out tagValue)
&& (Math.Round(length, 4) == Math.Round(tagValue, 4));
}
}
return rc;
}

IEnumerable<IndependentTag> RetrieveRectangularFabricationPartTags(Document doc)
{
return new FilteredElementCollector(doc)
.WhereElementIsNotElementType()
.OfCategory(BuiltInCategory.OST_FabricationDuctworkTags)
.OfClass(typeof(IndependentTag))
.Cast<IndependentTag>()
.Where(tag => IsRectangularFabricationPartTag(tag));
}

#endregion // Retrieve tags associated with rectangular fabrication parts

#region Retrieve openings in wall

/// <summary>
Expand Down Expand Up @@ -2156,7 +2198,7 @@ public IEnumerable<Element> GetAreasInAreaScheme(
/// <summary>
/// Retrieve all ramps
/// </summary>
private void f_ramps(Document doc)
private void GetRamps(Document doc)
{
var collector
= new FilteredElementCollector(doc)
Expand All @@ -2169,7 +2211,7 @@ var collector
/// <summary>
/// Retrieve all concrete ramps
/// </summary>
private IEnumerable<Element> findConcreteRamps(Document doc)
private IEnumerable<Element> GetConcreteRamps(Document doc)
{
return new FilteredElementCollector(doc)
.WhereElementIsNotElementType()
Expand All @@ -2194,7 +2236,7 @@ private IEnumerable<Element> findConcreteRamps(Document doc)

#region Filter for detail curves

private void f_detail_curves()
private void GetDetailCurves()
{
var collector
= new FilteredElementCollector(_doc);
Expand Down Expand Up @@ -2755,7 +2797,7 @@ var intersecting

// 383_param_filter.htm

private void f1(Document doc)
private void F1(Document doc)
{
var collector
= new FilteredElementCollector(doc);
Expand All @@ -2781,7 +2823,7 @@ ICollection<Element> allOnLevel
}
}

private void f2(Document doc, Level level)
private void F2(Document doc, Level level)
{
var collector
= new FilteredElementCollector(doc);
Expand Down Expand Up @@ -2856,7 +2898,7 @@ var collector
}
}

private void f3(Document doc)
private void F3(Document doc)
{
var collector
= new FilteredElementCollector(doc);
Expand All @@ -2881,7 +2923,7 @@ var filter
= new ElementParameterFilter(rule);
}

private void f4(Document doc)
private void F4(Document doc)
{
// Use numeric evaluator and integer rule to test ElementId parameter
// Filter levels whose id is greater than specified id value
Expand Down
2 changes: 2 additions & 0 deletions Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -365,3 +365,5 @@
- 2021-09-21 2022.0.152.1 implemented FilterForSheetsByBrowserOrganisation for https://forums.autodesk.com/t5/revit-api-forum/change-the-sheet-issue-date-on-sheets-filtered-by-project/td-p/10633770
- 2021-09-21 2022.0.152.2 implemented HighlightLastElement for https://forums.autodesk.com/t5/revit-api-forum/getting-the-last-element-placed-in-a-model/m-p/10645949
- 2021-09-29 2022.1.152.2 refactoring by Roman @Nice3point in pull request [#18](https://github.com/jeremytammik/the_building_coder_samples/pull/18)
- 2022-02-25 2022.1.152.3 implemented RetrieveRectangularFabricationPartTags for https://forums.autodesk.com/t5/revit-api-forum/filter-fabrication-rectangular-ducts-and-the-tag-associated-with/m-p/10971268
- 2022-02-25 2022.1.152.3 fixed camel case naming rule violations

0 comments on commit cd64213

Please sign in to comment.