»' wall must be
constrained to a Level at the top (more on Parameters later...)
»Dim topLev As Level = Nothing
»Try
» topLev = doc.Element(wall.Parameter(BuiltInParameter.WALL_HEIGHT_TYPE).AsElementId)
»Catch
» topLev = Nothing
»End Try
»If topLev Is Nothing Then
» MsgBox( "Selected
Wall is NOT constrained to a Level at the Top!" )
» Return
IExternalCommand.Result.Cancelled
»End If
»
»' get the bottom Level as well (this should never fail)
»Dim botLev As Level = Nothing
»Try
» botLev = doc.Element(wall.Parameter(BuiltInParameter.WALL_BASE_CONSTRAINT).AsElementId)
»Catch
» botLev = Nothing
»End Try
»If botLev Is Nothing Then
» MsgBox( "Selected
Wall is NOT constrained to a Level at the Bottom?!" )
» Return
IExternalCommand.Result.Cancelled
»End If