# Can I create a button in my toolwindow ,the function of button is same to AutoPath button.

**URL:** <https://tech-community.robotics.abb.com/t/can-i-create-a-button-in-my-toolwindow-the-function-of-button-is-same-to-autopath-button/8139>\
**Category:** Developer Tools\
**Tags:** c, robotstudio-sdk\
**Created:** [March 16, 2018, 7:55am UTC](https://tech-community.robotics.abb.com/t/can-i-create-a-button-in-my-toolwindow-the-function-of-button-is-same-to-autopath-button/8139 "2018-03-16T07:55:28Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![zhang](https://dub1.discourse-cdn.com/flex005/user_avatar/tech-community.robotics.abb.com/zhang/32/2562_2.png) [@zhang](https://tech-community.robotics.abb.com/u/zhang)\
**Post date:** [March 16, 2018, 7:55am UTC](https://tech-community.robotics.abb.com/t/can-i-create-a-button-in-my-toolwindow-the-function-of-button-is-same-to-autopath-button/8139/1 "2018-03-16T07:55:28Z")

</div>

Hello

I’m developing in RobotStudio using C# .I add a “AutoPath” button in my toolwindow,I want the function of the button is same to AutoPath Button in the Home(Tabs)\_Path Programmming(Groups).First I try to find the id of the button in the RobotStudio API Reference ,but I cann’t find it.

Does anyone have an idea how i make my “AutoPath” button have the same function.

 ![image.png](https://europe1.discourse-cdn.com/flex005/uploads/robotics1/original/1X/603149f648bbf93fc9c99cd651302c35dfbaaeaa.png)  
 ![|324x418.png](https://europe1.discourse-cdn.com/flex005/uploads/robotics1/original/2X/4/4fca3cbb9a612d52b1c89d8a100bb234905a9201.png)

---

<div class="post-metadata">

**Author:** ![zhang](https://dub1.discourse-cdn.com/flex005/user_avatar/tech-community.robotics.abb.com/zhang/32/2562_2.png) [@zhang](https://tech-community.robotics.abb.com/u/zhang)\
**Post date:** [March 17, 2018, 10:20am UTC](https://tech-community.robotics.abb.com/t/can-i-create-a-button-in-my-toolwindow-the-function-of-button-is-same-to-autopath-button/8139/2 "2018-03-17T10:20:14Z")

</div>

Below is an example of my addin written in C#,to attempt to simulate clicking the “AutoPath” button,but it not work.

Unfortunately,when I click the "AutoPath"button in "Home"Tab,the button losed efficacy that Pop-up "AutoPath"dialog box. Does the software have a bug?

[code]private void AutoPath\_Click(object sender, EventArgs e)  
{

CommandBarButton.FromID(“AutoPath”).Execute();  
}[code]

Another question,Have anyone show me that where can I get the “RobotStudioIDSummary.html”.

---

<div class="post-metadata">

**Author:** ![somenasty](https://avatars.discourse-cdn.com/v4/letter/s/9de053/32.png) [@somenasty](https://tech-community.robotics.abb.com/u/somenasty)\
**Post date:** [April 9, 2018, 9:20am UTC](https://tech-community.robotics.abb.com/t/can-i-create-a-button-in-my-toolwindow-the-function-of-button-is-same-to-autopath-button/8139/3 "2018-04-09T09:20:29Z")

</div>

可以告诉以下我怎么把button2事件设置成启动abb的RAPID程序吗

---

<div class="post-metadata">

**Author:** ![somenasty](https://avatars.discourse-cdn.com/v4/letter/s/9de053/32.png) [@somenasty](https://tech-community.robotics.abb.com/u/somenasty)\
**Post date:** [April 9, 2018, 9:20am UTC](https://tech-community.robotics.abb.com/t/can-i-create-a-button-in-my-toolwindow-the-function-of-button-is-same-to-autopath-button/8139/4 "2018-04-09T09:20:56Z")

</div>

可以告诉以下我怎么把button2事件设置成启动abb的RAPID程序吗？

---

<div class="post-metadata">

**Author:** ![zhang](https://dub1.discourse-cdn.com/flex005/user_avatar/tech-community.robotics.abb.com/zhang/32/2562_2.png) [@zhang](https://tech-community.robotics.abb.com/u/zhang)\
**Post date:** [April 10, 2018, 7:50am UTC](https://tech-community.robotics.abb.com/t/can-i-create-a-button-in-my-toolwindow-the-function-of-button-is-same-to-autopath-button/8139/5 "2018-04-10T07:50:40Z")

</div>

Hi somenasty,

我不知道你具体要用RAPID（Tabs）下面的什么功能。

你可以参考一下下面的代码。如果你要实现这个功能，可以找到它的IDs，然后用formIDmethods,但是不是所有的button都有相应的IDs，我也没有找到这些button的IDs。

[code]

CommandBarControl commandBarControl = UIEnvironment.RibbonTabs[“RAPID”].Groups[“Controller”].Controls[“RapidApplyMenu”];

if (commandBarControl != null)  
{  
((CommandBarPopup)commandBarControl).ClickButton.ExecuteCommand += ClickButton\_ExecuteCommand;  
((CommandBarButton)((CommandBarPopup)commandBarControl).Controls[“RapidApplyAll”]).ExecuteCommand += ClickButton\_ExecuteCommand;  
((CommandBarButton)((CommandBarPopup)commandBarControl).Controls[“RapidModuleApply”]).ExecuteCommand += ClickButton\_ExecuteCommand;

}  
Logger.AddMessage(new LogMessage(“ONload”));

[code]

Regards,  
zhang

---

<div class="post-metadata">

**Author:** ![DenisFR](https://avatars.discourse-cdn.com/v4/letter/d/dc4da7/32.png) [@DenisFR](https://tech-community.robotics.abb.com/u/DenisFR)\
**Post date:** [April 10, 2018, 8:31am UTC](https://tech-community.robotics.abb.com/t/can-i-create-a-button-in-my-toolwindow-the-function-of-button-is-same-to-autopath-button/8139/6 "2018-04-10T08:31:03Z")

</div>

Hello,  
@zhang: did you get your code for Apply button working with SmartComponent?  
I can’t.  
I code the same for mine ([https://github.com/DenisFR/RSDrawGraphics](https://github.com/DenisFR/RSDrawGraphics)) but this doesn’t works.  
[\RSDrawGraphics\RSDrawGraphics.cs:234](https://github.com/DenisFR/RSDrawGraphics/blob/master/RSDrawGraphics/RSDrawGraphics.cs#L234)

---

<div class="post-metadata">

**Author:** ![zhang](https://dub1.discourse-cdn.com/flex005/user_avatar/tech-community.robotics.abb.com/zhang/32/2562_2.png) [@zhang](https://tech-community.robotics.abb.com/u/zhang)\
**Post date:** [April 11, 2018, 8:16am UTC](https://tech-community.robotics.abb.com/t/can-i-create-a-button-in-my-toolwindow-the-function-of-button-is-same-to-autopath-button/8139/7 "2018-04-11T08:16:04Z")

</div>

Hi DenisFR,

This is the code you posted on the forum before. But I didn’t test it before.Today I get the code for Apply button working with Add-in,it doesn’t works.

You can ask the others again.

Regards,  
zhang

---

<div class="post-metadata">

**Author:** ![DenisFR](https://avatars.discourse-cdn.com/v4/letter/d/dc4da7/32.png) [@DenisFR](https://tech-community.robotics.abb.com/u/DenisFR)\
**Post date:** [April 11, 2018, 12:33pm UTC](https://tech-community.robotics.abb.com/t/can-i-create-a-button-in-my-toolwindow-the-function-of-button-is-same-to-autopath-button/8139/8 "2018-04-11T12:33:28Z")

</div>

> [@zhang](#):
>
> Today I get the code for Apply button **working** with Add-in,it **doesn’t** works.

Does it works or not?

> [@](#):
>
> You can ask the others again.

Yes, maybe @Henrik_Berlin can answer me?

---

<div class="post-metadata">

**Author:** ![zhang](https://dub1.discourse-cdn.com/flex005/user_avatar/tech-community.robotics.abb.com/zhang/32/2562_2.png) [@zhang](https://tech-community.robotics.abb.com/u/zhang)\
**Post date:** [April 15, 2018, 10:12am UTC](https://tech-community.robotics.abb.com/t/can-i-create-a-button-in-my-toolwindow-the-function-of-button-is-same-to-autopath-button/8139/9 "2018-04-15T10:12:35Z")

</div>

OK，thank you very munch.

Regards,  
zhang
