Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

What is the difference between IEditSketch and IEditSketch2? Also why there are same interfaces with the same name only with a difference "2" at the end of the interface's name ?

share|improve this question
up vote 6 down vote accepted

I think the doc for IEditsketch2 is wrong - it should say supreseded by IEditSketch3.

Provides access to members that access and manipulate the edit sketch. Note: the IEditSketch2 interface has been superseded by IEditSketch2 (sic). Please consider using the more recent version.

It's a violation of COM best practice to change an interface once it has been published. Instead, a new interface is published that inherits all the methods from the existing interface. When Esri does this, they add (or increment) a suffix number on the interface's name. enter image description here

share|improve this answer
+1 While it is generally good practice, from COM viewpoint it's not strictly necessary for a new version of the interface to inherit from the existing one. Actually in ArcObjects, sometimes new versions do not inherit from the older one - this is especially true for many outbound event interfaces, e.g. IEditEvents, IEditEvents2, IEditEvents3, IEditEvents4 etc. do not maintain any static inheritance relationship. – Petr Krebs May 23 '11 at 16:03

This seems to be a pretty common thing for ESRI to do. I counted a dozen or so interfaces with numbers at the end just looking through the ArcObjects SDK (ITopologyGraph4, IEditSketch2, etc.).

One thing to be aware of with the different version of the interfaces is that they're not always implemented by the same classes. I ran into this when working with the IPointCollection5 interface. The documentation states that the previous version of the IPointCollection interface have been superseded by IPointCollection5. However, IPointCollection5 is only implemented by Multipoint, which was the reason I was getting an error with the statement

Dim pOutCollection As ESRI.ArcGIS.Geometry.IPointCollection5 = New ESRI.ArcGIS.Geometry.Polygon

Instead, I had to use the IPointCollection4 interface for the Point and Polygon classes. When using the new versions of the interfaces, always look at the list of classes that implement the interface.

share|improve this answer
+1 Good catch, although this is very, very rare in ArcObjects. – Petr Krebs May 23 '11 at 15:58

Looks like they added more members (CurrentZ, EditSketchExtension, etc.) to the IEditSketch interface.

As for why, it's likely that they realized that new functionality was necessary for that interface. Since changing the original interface breaks the "contract" for all applications that use that interface, they had to rename it. To ensure that programmers understand that the new interface is related to the old one in some way, i.e. that more functionality has been added but that the fundamental idea of the interface is unchanged, they merely tacked a "2" onto the end of the original name.

This seems to be a pretty common thing for ESRI to do. I counted a dozen or so interfaces with numbers at the end just looking through the ArcObjects SDK (ITopologyGraph4, IEditSketch2, etc.).

share|improve this answer

You can read the descriptions of all the EditSketch interfaces below. It seems that both versions are being superseded by IEditSketch3. You may also want to read up on "Working with the edit sketch" link below.




Working with the edit sketch

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.