Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

How do you get an annotation layer working inside a group layer? When I try I get the error message "error adding element".

I have a project that requires several annotation layer to be organised within a Group Layer.

Tested in ArcMap 9.3.1 and 10.

Steps to reproduce:

  1. Create a new document
  2. Add a Annotation Featureclass to ArcMap
  3. Start Editing
  4. On the Draw Toolbar, change the Active Annotation Target to the Annotation Featureclass
  5. Draw something (e.g. freehand) - This should work!
  6. Create a New Group Layer
  7. Move the Annotation Featureclass inside it.
  8. The Annotation Target has now been lost!
  9. On the Draw Toolbar, change the Active Annotation Target to the Annotation Featureclass
  10. Draw something (e.g. freehand) - This does not work!
  11. You will get the error message "error adding element"

You will now not be able to write to this Featureclass unless you save the document, close ArcMap and re-open it. This is not an acceptable work around for my project. Is there a workaround, preferably in ArcObjects?!

This might relate to the following bug submitted in 2001 on ArcMap 8.3: http://forums.esri.com/Thread.asp?c=93&f=993&t=38521

Has this reported bug not been fixed for 11 years?!

Cheers, Wayne.

share|improve this question
    
In the event there are no useful answers here, try filing the bug with tech support and on ideas.argis.com (and link to it from here so interested parties can follow up). –  matt wilkie Feb 10 '12 at 7:48
add comment

1 Answer

I was able to reproduce your problem.

This might be a workaround: after step 9, if I run the VBA Hack() shown below then set the active target again I'm able to add anno without the message. I'm on a machine with 9.3.1 and no visual studio, but this should also work in .NET.

Sub Hack()
    Dim pOCopy As IObjectCopy
    Set pOCopy = New ObjectCopy

    Dim pMxDoc As IMxDocument
    Set pMxDoc = ThisDocument

    Dim pNewMap As IMap
    Set pNewMap = pOCopy.Copy(pMxDoc.FocusMap)

    pOCopy.Overwrite pNewMap, pMxDoc.FocusMap
End Sub
share|improve this answer
add comment

Your Answer

 
discard

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.