We have programmatically created various Revit elements using the Revit .NET Creation APIs, specifically those New or Create methods. We also created a non-leaning Pisa Tower using all those Revit .NET Creation APIs that have been demonstrated in detail separately.
Here is how the resultant Pisa Tower looks beautifully in Revit after being rendered.
The LevelCreation class along with its useful methods have been fine tuned a
bit when used to create the non-leaning Pisa Tower. Here is the latest
code.
public class LevelCreation
{
public static List<Level> CreateLevels(RvtDocument doc, double[] elevations, string[] names = null)
{
List<Level> list = new List<Level>();
for (int i = 0; i < elevations.Length; i++)
{
double elevation = elevations[i];
Level level = doc.Create.NewLevel(elevation);
if (names != null && names.Length >= i + 1)
level.Name = names[i];
list.Add(level);
}
return list;
}
}
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.