Message 1 of 5
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
How can I add the content of a FilteredElementCollector into a ComboBox that I'm working with inside a WinForm?
public Result ListDim(ExternalCommandData commandData, ref string message, ElementSet elements)
{
//Get Dimension Types
var dim = new FilteredElementCollector(doc).OfClass(typeof(FamilySymbol)).OfClass(typeof(Dimension)).WhereElementIsElementType().ToElements();
//Add to ComboBox
foreach (Element elem in dim)
cmbBxDim.Items.Add(elem.Name.ToString());
return Result.Succeeded;
}
I then add the method to the Form event:
private void CreateAxis_Load(object sender, EventArgs e)
{
ListDim(commandData, ref message, elements);
}
The WinForm opens but my "cmbBxDim" ComboBox appears empty .
Any help would be appreciated.
Solved! Go to Solution.