Hi all,

displaying all elements that have a specific property, regardless whether it has been assigned a value or not, can be done by the following code; this seems to work well:

Code:
Dim app As UIApplication = commandData.Application
Dim doc As UIDocument = app.ActiveUIDocument
Dim objRule As SharedParameterApplicableRule = New SharedParameterApplicableRule("ATB_Groep")
Dim objFilter As ElementParameterFilter = New ElementParameterFilter(objRule)
Dim objCollector As FilteredElementCollector = New FilteredElementCollector(doc.Document)
objCollector.WherePasses(objFilter)
MsgBox("Elements with parameter 'ATB_Groep' : " & objCollector.Count.ToString)
And now I want to achieve the opposite: I need to create an active selection (ActiveUIDocument.Selection) based on all the elements in my project that do have a specific parameter and for which the value has *not* been set or the value is *empty* (as a side note: the parameter is of type STRING). Using a FilteredElementCollector I can easily use its property ToElementIds to "feed" Selection.SetElementIds. So far, this hasn't worked for me, as I can't seem to translate the parameter name to an Id, using the following code:

Code:
Dim app As UIApplication = commandData.Application
Dim doc As UIDocument = app.ActiveUIDocument
Dim objParameter2 As Parameter
objParameter2.GetByName("ATB_Groep") ' XXX How to create an instance of the Shared Parameter named "ATB_Groep" ? XXX
Dim objProvider2 As ParameterValueProvider = New ParameterValueProvider(objParameter2.Id)
Dim objRule2 As FilterStringRule = New FilterStringRule(objProvider2, New FilterStringEquals, "", False)
Dim objFilter2 As ElementParameterFilter = New ElementParameterFilter(objRule2)
Dim objCollector2 As FilteredElementCollector = New FilteredElementCollector(doc.Document)
objCollector2.WherePasses(objFilter2)
MsgBox("Elements with empty parameter 'ATB_Groep' : " & objCollector2.Count.ToString)
Could someone point me in the right direction?

The reason for this request: we add a custom and mandatory parameter to the project. On exiting the drawing, the user should be presented a list (or highlighted selection, or dialog with a counter) to make him aware there are still some elements he needs to check before archiving the file.

Thanks,
Justus