3

Currently in Config.esriaddinx I have

<Button id="my_UniqueID" class="MyWrapperClass" caption="My Caption"
         image="Images\My_Image.png" ...> </Button>

and then I implement MyWrapperClass with:

protected override void OnClick()
{
    UID uid = new UIDClass();
    uid.Value = "esriArcMapUI.GraphicsToFeaturesCommand";

    ICommandItem cmd = ArcMap.Application.Document.CommandBars.Find(uid);
    if (cmd != null)
        cmd.Execute();
}

I'd like to just have the following in Config.esriaddinx

<Button id="esriArcMapUI.GraphicsToFeaturesCommand" />

and have the built-in command object do all the work for me.

Is this possible?

4

Yes it is possible to reference a built-in command (button) on a custom menu/toolbar (What I really need to do). It is not possible to redefine a built-in command (What I was trying to do).

One can reference a built-in command on a custom menu/toolbar like this.

    <Menu id="my_id" caption="Cool_tools">
      <Items>
        <Button refID="my_custom_button" />
        <Button refID="esriArcMapUI.GraphicsToFeaturesCommand" />
        ...
      </Items>
    </Menu>

And similarly for a tool on a toolbar.

1
  • 1
    Still, this is very useful and good to know. +1
    – Petr Krebs
    Dec 13 '10 at 22:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.