3

I'm developing a toolbar with some geoprocessing routines and digitizing functionality. On this toolbar I have implemented a "start edit" button.

I want to start an edit session by clicking that button on my toolbar, but the original ArcMap Editor toolbar shows up too, even so I deselected it form the customize menu.

Is it possible to prevent the Editor toolbar from opening, so users are forced to use my custom toolbar?

You can simulate my workflow by adding the "Start Editing" button to any toolbar in ArcMap's Customize mode. Note that the Editor toolbar always switches on when starting an edit session.

PolyGeo
65.5k29 gold badges115 silver badges350 bronze badges
asked Jul 30, 2014 at 12:09
8
  • 1
    Would you be able to edit your question to include some more precise details about how you have created your toolbar and included a button to start editing, please? From that it should be easier to see what's working and where you are stuck. Commented Jul 30, 2014 at 12:36
  • 1
    Can you clarify "esriEditor.StartEditing" - do you mean the ArcObjects command iEditor.StartEditing? You also mention ArcPy, so are you mixing ArcPy with ArcObjects? This is fine, but it would help if you could explain how you're doing it Commented Jul 31, 2014 at 6:56
  • @StephenLead by "esriEditor.StartEditingCommand" I refer to the ArcMap commands. Everything I created works as a Python add in, that is why I mentioned arcpy/python. Commented Jul 31, 2014 at 7:20
  • 1
    @Geography I understand what you're trying to do, and it's a good idea (and question). I just don't understand exactly how you're going about it. Can you edit the question to add more steps, some code snippets, etc? Commented Jul 31, 2014 at 9:40
  • I agree with @StephenLead - what would be useful to see is the code that goes with a test toolbar that only has the one button that you say shows this symptom. With that it should be easy for anyone interested to try and reproduce, explain and/or prevent it happening. Commented Jul 31, 2014 at 10:40

1 Answer 1

4

If your code just finds and executes the Start Editing command item then ArcMap will start an edit session and launch the Editor toolbar. There's probably a whole bunch of code behind that control.

To start an edit session without launching the toolbar you'll need to start editing a workspace in the map via IEditor.StartEditing.

Here's some retro VBA code that starts an edit session on the first layer's workspace:

Public Sub se()
Dim pEditor As IEditor
Dim pID As New UID
Dim pDoc As IMxDocument
Dim pFtrLyr As IFeatureLayer
Dim pDataset As IDataset
Dim pWrkSpc As IWorkspace
 Set pDoc = ThisDocument
 Set pFtrLyr = pDoc.FocusMap.Layer(0)
 Set pDataset = pFtrLyr.FeatureClass
 Set pWrkSpc = pDataset.Workspace
 pID = "esriEditor.Editor"
 Set pEditor = Application.FindExtensionByCLSID(pID)
 pEditor.StartEditing pWrkSpc
End Sub
answered Aug 1, 2014 at 21:07
2
  • Have you tested this - I think the OP was finding that calling StartEditing programatically was also switching on the Editor toolbar... Commented Aug 4, 2014 at 6:29
  • 1
    Yes. Calling and executing the start editing button (command item) will show the toolbar. Start editing via the Editor API will not show it. Commented Aug 4, 2014 at 17:53

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.