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.
-
1Would 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.PolyGeo– PolyGeo ♦2014年07月30日 12:36:29 +00:00Commented Jul 30, 2014 at 12:36
-
1Can 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 itStephen Lead– Stephen Lead2014年07月31日 06:56:28 +00:00Commented 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.Geo graphy– Geo graphy2014年07月31日 07:20:02 +00:00Commented 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?Stephen Lead– Stephen Lead2014年07月31日 09:40:40 +00:00Commented 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.PolyGeo– PolyGeo ♦2014年07月31日 10:40:36 +00:00Commented Jul 31, 2014 at 10:40
1 Answer 1
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
-
Have you tested this - I think the OP was finding that calling StartEditing programatically was also switching on the Editor toolbar...Stephen Lead– Stephen Lead2014年08月04日 06:29:29 +00:00Commented Aug 4, 2014 at 6:29
-
1Yes. Calling and executing the start editing button (command item) will show the toolbar. Start editing via the Editor API will not show it.SeaJunk– SeaJunk2014年08月04日 17:53:56 +00:00Commented Aug 4, 2014 at 17:53