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.

This is a new question but a continuation of this post: How can I programmatically display the "Create Features" dockable window in ArcMap 10?

I like the new template system in ArcGIS 10 but for quick editing it is a somewhat cumbersome several-click process. I have a tool that starts editing a layer that is currently selected in the TOC. It also pops the "Create Feature" dockable window.

I would like to add the currently selected layer as a template to the dockable window using it's default symbology. (VB.Net)

share|improve this question

1 Answer 1

up vote 2 down vote accepted

This involves a two-step approach.

  1. You create the edit template for your layer via IEditTemplateFactory.Create method.
  2. Add the template to the Editor by calling IEditor3.AddTemplates.

EDIT: If you do not want to duplicate the templates on every edit session start, I suggest you read the conceptual documentation for layer templates. It provides a good overview and also shows how to persist the layer templates by accessing the layer's template extension IEditTemplateManager, which may be useful in your case. The document also implies that any advanced template creation (e.g. based on the more advanced renderers) has to be done on your own, this functionality used ArcMap is not exposed as an API to be reused by developers.

share|improve this answer
    
Great. thanks again –  Jakub Nov 29 '10 at 18:27
    
For some reason this duplicates templates. start and stop editing just keeps adding more templates.. –  Jakub Nov 29 '10 at 18:34
    
Actually, this does not work. –  Jakub Nov 29 '10 at 18:39
    
Ok, "does not work" doesn't really help here :-) What exactly does not work, could you be more specific please? Also, see my edits, it could provide some additional information. –  Petr Krebs Nov 29 '10 at 18:48
    
sorry. I did not have time to elaborate. I will look at the documentation. Thanks. I was locking at the code and duplication seems to be the only issue i need to resolve. –  Jakub Nov 29 '10 at 21:36

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.