»' We pretend that something
is wrong with the first element in the selection
»' We pass the message back to Revit user and indicate the error
result
»If Not
sel.Elements.IsEmpty Then
» Dim iter As ElementSetIterator =
sel.Elements.ForwardIterator
» iter.MoveNext()
» Dim errElem As Revit.Element =
iter.Current
» elements.Clear()
» elements.Insert(errElem)
» message = "We
pretend something is wrong with this element and pass back this message to user"
» Return
IExternalCommand.Result.Failed
»Else
» Return
IExternalCommand.Result.Succeeded
»End If