Message 1 of 4
User selection to new selection - ICollection(of ElementId) Exception

Not applicable
02-02-2016
06:10 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi,
I am trying to create a selectionfilter via userinput based on object names instead of categories (as standard Revit does now). After a user creates a selection a form is show where al objects are listed by name. The user can select the namedobjects from which to create a new active selection. So far so good, but when I pass an elementId to tmpICollectionIds a Null Reference Exception occurs. Am I doing something wrong?
Dim tmpICollectionIds As ICollection(Of ElementId) = Nothing
For Each elementId As ElementId In UiSel.GetElementIds
Dim element As Element = m_Doc.GetElement(elementId)
If tmpSelectionList.Contains(element.Name.ToString) Then
tmpICollectionIds.Add(element.Id)
End If
Next
regards,
Raymond