Quantcast
Channel: RevitNetAddinWizard & NavisworksNetAddinWizard
Viewing all articles
Browse latest Browse all 872

Revit .NET Creations API: Create Metal Clad Columns in Rectangular Array

$
0
0

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 in a rectangular array 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.InsertColumnsInRectangularArray(CachedDoc,
                                        symbol,
                                        toplevel,
                                        0.0,
                                        baseLevel,
                                        0.0,
                                        new XYZ(10.0, 10.0, 0.0),
                                        50.0, 40.0, 10, 8);

Here is how it looks like in Revit.
 MetalCladColumnsInRectArray

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.


Viewing all articles
Browse latest Browse all 872

Trending Articles