- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Can somebody give me an example of how to pull an enum as a string variable? I've been researching and can't find anything specific for revit api enums. Specifically for Fabrication parts/parameters. We use a custom content pack (building data) but I'm assuming the methods/classes will be similar? For example if I wanted to get the service name.
I'm able to pull the name (which is named default//doesn't help) through a collection but I can't figure out how to dig into the "FabricationPart" field where all the information I want is. Still new to Revit api so may be something obvious I'm missing. This is how I'm pulling the name so maybe I could tweak this to pull the service?
InitializeComponent();
Doc = doc;
ICollection<Element> FabricationPipework =
new FilteredElementCollector(Doc, Doc.ActiveView.Id).OfCategory(BuiltInCategory.OST_FabricationPipework)
.ToElements();
ICollection<Element> FabricationDuctwork =
new FilteredElementCollector(Doc, Doc.ActiveView.Id).OfCategory(BuiltInCategory.OST_FabricationDuctwork)
.ToElements();
ICollection<Element> FabricationHangers =
new FilteredElementCollector(Doc, Doc.ActiveView.Id).OfCategory(BuiltInCategory.OST_FabricationHangers)
.ToElements();
{
foreach (Element element in FabricationPipework)
comboBox2.Items.Add(element.Category.Name);
}
{
foreach (Element element in FabricationDuctwork)
comboBox2.Items.Add(element.Category.Name);
}
{
foreach (Element element in FabricationHangers)
comboBox2.Items.Add(element.Category.Name);
}
Solved! Go to Solution.