How do I tell if a feature class has editor tracking enabled?

588
3
Jump to solution
02-25-2018 05:14 PM
AllanMills
New Contributor III

I have an application that creates or updates a point feature class but only after the user has specified a line feature class that they are going to use associated with it. I want to detect if the user has editor tracking set on the line feature class and, if so, activate it on the point feature class.

 The problem is, I can't see how to detect if it is set or not. The IClassSchemaEdit4 interface lets me set the fields for tracking, but not read their contents to see if they are set.

 Any ideas?

1 Solution

Accepted Solutions
DuncanHornby
MVP Notable Contributor

This is one of those problems that at some point in the development of these tools and functionality the developers behind them changed their direction (presumably for good reasons) but consequently it is very difficult to work out how you achieve the task because the ArcObjects API help files are not sufficiently documented with links.

You are basically (through no fault of your own) looking at the entirely wrong branch of the ArcObjects tree! I regularly trip over this so do feel for you. This functionality is only accessible through the geoprocessor accessing dataelements.

Below is some VBA to show you what you need:

Public Sub Test()
 Dim pGeoProcessor As IGeoProcessor
 Set pGeoProcessor = New GeoProcessor
 Dim pDataElement As IDataElement
 Dim pGPDataType As IGPDataType
 Set pGPDataType = New DEFeatureClassType
 Set pDataElement = pGeoProcessor.GetDataElement("C:\Scratch\fGDB_Scratch.gdb\fcTempSorted", pGPDataType)
 Dim pDEEditorTracking As IDEEditorTracking
 Set pDEEditorTracking = pDataElement
 Debug.Print pDEEditorTracking.EditorTrackingEnabled
End Sub

View solution in original post

0 Kudos
3 Replies
DuncanHornby
MVP Notable Contributor

This is one of those problems that at some point in the development of these tools and functionality the developers behind them changed their direction (presumably for good reasons) but consequently it is very difficult to work out how you achieve the task because the ArcObjects API help files are not sufficiently documented with links.

You are basically (through no fault of your own) looking at the entirely wrong branch of the ArcObjects tree! I regularly trip over this so do feel for you. This functionality is only accessible through the geoprocessor accessing dataelements.

Below is some VBA to show you what you need:

Public Sub Test()
 Dim pGeoProcessor As IGeoProcessor
 Set pGeoProcessor = New GeoProcessor
 Dim pDataElement As IDataElement
 Dim pGPDataType As IGPDataType
 Set pGPDataType = New DEFeatureClassType
 Set pDataElement = pGeoProcessor.GetDataElement("C:\Scratch\fGDB_Scratch.gdb\fcTempSorted", pGPDataType)
 Dim pDEEditorTracking As IDEEditorTracking
 Set pDEEditorTracking = pDataElement
 Debug.Print pDEEditorTracking.EditorTrackingEnabled
End Sub
0 Kudos
AllanMills
New Contributor III

Thanks. I'll give that a try.

0 Kudos
AllanMills
New Contributor III

It is odd though. I'd assumed the geoprocessing tools were all written in .NET as well. If that is the case there would need to be some class or interface they are using which I should be able to access as well.

0 Kudos