Skip to content

Commit

Permalink
#82
Browse files Browse the repository at this point in the history
  • Loading branch information
moethu committed Feb 20, 2019
1 parent 53ac73c commit 48d2b9d
Showing 1 changed file with 19 additions and 10 deletions.
29 changes: 19 additions & 10 deletions src/DynamoRebar/Revit/RebarContainer.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//
//
// Copyright 2015 Autodesk, Inc.
// Author: Thornton Tomasetti Ltd, CORE Studio (Maximilian Thumfart)
//
Expand Down Expand Up @@ -382,15 +382,24 @@ System.Collections.Generic.List<Autodesk.DesignScript.Geometry.Vector> vectors

/// <summary>
/// Create Rebar Container by Bars
/// </summary>
/// <param name="rebars">Bars to create the container from</param>
/// <returns></returns>
public static RebarContainer ByBars(System.Collections.Generic.List<Revit.Elements.Rebar> rebars)
{
return new RebarContainer(rebars);
}

/// <summary>
/// </summary>
/// <param name="rebars">Bars to create the container from</param>
/// <returns></returns>
public static RebarContainer ByBars(System.Collections.Generic.IEnumerable<Revit.Elements.Element> rebars)
{
List<Revit.Elements.Rebar> mybars = new List<Revit.Elements.Rebar>();
foreach (Revit.Elements.Element e in rebars)
{
if (e.InternalElement is Autodesk.Revit.DB.Structure.Rebar)
{
Revit.Elements.Rebar bar = Revit.Elements.Rebar.FromExisting(e.InternalElement as Autodesk.Revit.DB.Structure.Rebar, true);
mybars.Add(bar);
}
}
return new RebarContainer(mybars);
}

/// <summary>
/// Set unobscured in specified View
/// </summary>
/// <param name="rebarContainer">Rebar Container</param>
Expand Down

0 comments on commit 48d2b9d

Please sign in to comment.