Select to view content in your preferred language

Validate feature for ALL errors

3741
3
05-19-2015 03:22 AM
FabianoFerrazza
Deactivated User

Hi all,

i need to make a tool that validate all selectioned features and, for each, show ALL validation errors.

The IValidation.Validate() show only one error at a time.

There is any interface that allow a complete error analysis?

Thank you so much!

Fabiano

Tags (2)
0 Kudos
3 Replies
ToddBlanchette
Frequent Contributor

Hi Fabiano,

Yes, there is.  Use the IValidation.ValidateSet() method instead.  It validates an entire Set object, built from an ISet interface where you can add individual objects to the set.  This example shows building a set using selected features in an Edit session:

Dim pMySet As esriSystem.ISet
Set pMySet = New esriSystem.Set
Dim pEnumFeature As IEnumFeature
Set pEnumFeature = pEditor.EditSelection
pEnumFeature.Reset
For Count = 0 To pEditor.SelectionCount - 1
  Set pFeature = pEnumFeature.Next
  pMySet.Add pFeature
Next Count

The IValidation.ValidateSet() method returns an ISet object containing all of the invalid features that it found in that set.

Hope this helps!

Todd

0 Kudos
FabianoFerrazza
Deactivated User

Thanks Todd, bui probably I have not explained.

I need a tool that, FOR EACH FEATURE, show ALL validation errors.

For example, if a signe feature has both a domain error and a network rule error, I'd like to view both the errors.

Is it possible?

Thanks

Fabiano

0 Kudos
ToddBlanchette
Frequent Contributor

Hi Fabiano,

From what I've researched, it's not possible.  You have to fix one error before you can list the next.  Here is the quote from ESRI's online help:

Validation is a short-circuiting process, meaning that the validate process stops if one of the checks fails. For example, if a feature is found to violate a connectivity rule, the validation of the feature stops, and any relationship rules will not be checked until the connectivity rule violation is corrected and the feature is validated again.

Cheers,

Todd

0 Kudos