<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Unable to add Ribbon by AutoCAD startup in .NET Forum</title>
    <link>https://forums.autodesk.com/t5/net-forum/unable-to-add-ribbon-by-autocad-startup/m-p/11449122#M11567</link>
    <description>&lt;P&gt;Thank you its works ...&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 28 Sep 2022 04:19:20 GMT</pubDate>
    <dc:creator>kite15</dc:creator>
    <dc:date>2022-09-28T04:19:20Z</dc:date>
    <item>
      <title>Unable to add Ribbon by AutoCAD startup</title>
      <link>https://forums.autodesk.com/t5/net-forum/unable-to-add-ribbon-by-autocad-startup/m-p/11447951#M11565</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I have tried to create the Ribbon by AutoCAD startup. Previously, was created a CUIX file and enter CUIX detail to load through the xml. Now, trying to create a Ribbon dynamically through stratup while its chosen by the user to load.&lt;/P&gt;&lt;P&gt;Issue is: While, executing the netload command its works as expected. However, its not working by startup (by xml).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is my code for your reference.. Please, help...&lt;/P&gt;&lt;P&gt;Xml file content&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="general"&gt;&amp;lt;?xml version="1.0" encoding="utf-8"?&amp;gt;
&amp;lt;ApplicationPackage SchemaVersion="1.0" AutodeskProduct="AutoCAD" ProductType="Addins" Name="NewCADTools" AppVersion="0.0.0" 
                    Description="NewCADTools" Author="Kite15" 
                    AppNameSpace="a" 
ProductCode="{95891FA5-7CD2-495E-A68D-138FF2475085}" UpgradeCode="{88989D32-522F-440F-85D8-0EB7EFD0BAD4}"&amp;gt;
  &amp;lt;Components&amp;gt;
    &amp;lt;RuntimeRequirements OS="Win64" Platform="AutoCAD*" SeriesMin="R24.2" SeriesMax="R24.2" /&amp;gt;
    &amp;lt;ComponentEntry AppName="NewAutoCADTestTool" Version="1.0.0" ModuleName="./Contents/2023/NewAutoCADRibbon.dll" AppDescription="test." LoadOnAutoCADStartup="True"&amp;gt;
	&amp;lt;/ComponentEntry&amp;gt;
  &amp;lt;/Components&amp;gt;
  
&amp;lt;/ApplicationPackage&amp;gt;&lt;/LI-CODE&gt;&lt;P&gt;Extension Application initialization code:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="general"&gt;		 public class NewAutoCADlugin : IExtensionApplication
        {
            void IExtensionApplication.Initialize()
            {
                try
                {
                    
                    #region Adding new toolButtons
                    NewAutoCADTools addAutoCADToolButton = new NewAutoCADTools();
                    addAutoCADToolButton.CreateRibbon();
                    #endregion
                }
                catch (System.Exception ex)
                {
                    var error=ex.Message;
                }
            }

            void IExtensionApplication.Terminate()
            {
                // Do plug-in application clean up here if required
                // throw new NotImplementedException();
            }
        }&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Code for Ribbon creation:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="general"&gt; public void CreateRibbon()
        {
            RibbonControl ribbon = ComponentManager.Ribbon;
            if (ribbon != null)
            {
                RibbonTab rtab = ribbon.FindTab(RibbonTabName);
                if (rtab != null)
                {
                    ribbon.Tabs.Remove(rtab);
                }
                rtab = new RibbonTab();
                rtab.Title = RibbonTabTitle;
                rtab.Id = RibbonTabId;
                //Add the Tab
                AddRibbonPanelContent(rtab);
            }
        }&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 27 Sep 2022 14:09:10 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/unable-to-add-ribbon-by-autocad-startup/m-p/11447951#M11565</guid>
      <dc:creator>kite15</dc:creator>
      <dc:date>2022-09-27T14:09:10Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to add Ribbon by AutoCAD startup</title>
      <link>https://forums.autodesk.com/t5/net-forum/unable-to-add-ribbon-by-autocad-startup/m-p/11448979#M11566</link>
      <description>&lt;P&gt;That is because when your DLL is loaded automatically, AutoCAD may not has finished its ribbon system loading. That is, in your code, the ComponentManager.Ribbon property is still null, thus, nothing loaded.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The better approach would be that you add Application.Idle event handler in the Initialize(), and move your code in the Initialize() to the Applicaion_Idle handler. (Of course, once your code in Idle event handler is called, you then remove the Idle event handler).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 28 Sep 2022 01:40:37 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/unable-to-add-ribbon-by-autocad-startup/m-p/11448979#M11566</guid>
      <dc:creator>norman.yuan</dc:creator>
      <dc:date>2022-09-28T01:40:37Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to add Ribbon by AutoCAD startup</title>
      <link>https://forums.autodesk.com/t5/net-forum/unable-to-add-ribbon-by-autocad-startup/m-p/11449122#M11567</link>
      <description>&lt;P&gt;Thank you its works ...&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 28 Sep 2022 04:19:20 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/unable-to-add-ribbon-by-autocad-startup/m-p/11449122#M11567</guid>
      <dc:creator>kite15</dc:creator>
      <dc:date>2022-09-28T04:19:20Z</dc:date>
    </item>
  </channel>
</rss>

