Hi,
I am trying to write an add-in with C# to automate the process of sequentially labeling structural columns to match the sequence in the graphical column schedule.
I have written the following code to get all the concrete columns in the project and then create a list of their Column Location Marks (ie A(2000)-1(2150) ) (Built-in Category):
ElementCategoryFilter filter = new ElementCategoryFilter(BuiltInCategory.OST_StructuralColumns);
StructuralMaterialTypeFilter filter_mat = new StructuralMaterialTypeFilter(StructuralMaterialType.Concrete);
IList<Element> columns = collector.WherePasses(filter).WherePasses(filter_mat).WhereElementIsNotElementType().ToElements();
List<XYZ> locations = new List<XYZ>();
List<string> colmarks = new List<string>();
foreach (Element ele in columns)
{
string colmark = ele.get_Parameter(BuiltInParameter.COLUMN_LOCATION_MARK).AsString();
colmarks.Add(colmark);
}
colmarks.Sort();
My trouble comes at this point. The colmarks.Sort() method does not match the order of the columns in the graphical column schedule.
I have also tried sorting the columns by their XYZ location which doesn't match the order in the graphical column schedule either.
Can anyone provide any insight into how the graphical column schedule orders the columns and how I can replicate this.
Thanks
Solved! Go to Solution.