AnsweredAssumed Answered

Fire custom tool from another custom tool

Question asked by bulla_b on May 8, 2019
Latest reply on May 10, 2019 by bulla_b

Hi,

 

I'm trying to run a custom tool from an Editor Extension I am building.  I've done this before with out of the box ArcMap tools (ie. Zoom to Selection), but for some reason this code I am using will not work for a custom tool I have created.  The tool GUID is {079952c5-83c1-49e8-bd1a-4440f623281f} and it is definitely in my map, but when I run the tool it can't seem to find it based on the GUID, so cmdItem is null and the line "cmdItem.Execute();" does not run.

 

Any ideas what I am doing wrong??

 

                            if (inFeature.Fields.FindField("FACILITYID") != -1)
                            {
                                ICommandBars cmdBars = ArcMap.Application.Document.CommandBars;
                               
                                UID uid = new UID();
                                uid.Value = "{079952c5-83c1-49e8-bd1a-4440f623281f}";
                                ICommandItem cmdItem = cmdBars.Find(uid, false, false);
                                if (cmdItem != null)
                                    cmdItem.Execute();
                            }

Outcomes