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

Revit .NET Creations API: Load Column Family

$
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.

In this post, let’s load an architectural column such as ‘Metal Clad Column’ from the Revit imperial library.

public static Family LoadColumnFamily(Document doc, string name)
{
    string libPath = doc.Application.GetLibraryPaths()["Imperial Library"];
    string path = Path.Combine(libPath, @"Columns\" + name + ".rfa");
    Family family;
    doc.LoadFamily(path, out family);

    return family;
}

Here is the sample caller code.

Family columnFam = ColumnCreation.LoadColumnFamily(CachedDoc, "Metal Clad Column");

Since this moment, we can create columns with the type of Metal Clad Column.

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