We created a variety of Revit elements such as walls, windows, doors, openings, floors, roofs, and levels with different shapes such as rectangular and circular if possible programmatically using Revit .NET API and C# before.
We created an architectural rectangular column successfully, arranged some such columns along a circle/arc and in a rectangular array before. We also managed to load a column family dynamically into the current document and create a Metal Clad Column previously. In this post, let’s create many Metal Clad Columns along a circle programmatically.
CachedDoc.Application.Create.NewArc(new Plane(XYZ.BasisZ, new XYZ(10.0, 10.0, 0.0)), 10.0, 0.0, Math.PI * 2);
Family columnFam = ColumnCreation.LoadColumnFamily(CachedDoc, "Metal Clad Column");
FamilySymbol symbol = ColumnCreation.GetFirstSymbol(ColumnCreation.FindColumnFamilies(CachedDoc).FirstOrDefault(e => e.Name == "Metal Clad Column"));
IOrderedEnumerable<Level> levels = FindAndSortLevels(CachedDoc);
Level toplevel = levels.Last();
Level baseLevel = levels.ElementAt(levels.Count() - 2);
ColumnCreation.InsertColumnAroundCircle(CachedDoc,
symbol,
toplevel,
0.0,
baseLevel,
0.0,
new XYZ(10.0, 10.0, 0.0),
10.0,
18,
0.0);
Here is how they look like in Revit.
Revit Addin Wizard (RevitAddinWizard) provides various wizards, coders and widgets to help program Revit addins. It can be downloaded from the Download link at the bottom of the blog index page.