<?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: Best practice: loading a cuix vs generating the ribbon from code in .NET Forum</title>
    <link>https://forums.autodesk.com/t5/net-forum/best-practice-loading-a-cuix-vs-generating-the-ribbon-from-code/m-p/11968765#M10712</link>
    <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/10282622"&gt;@karl.sch1983&lt;/a&gt;&amp;nbsp;to be perfectly honest, I don't recall even noticing that there is an icon displayed in the command line...I had to go look, used the Line command and Hah! sure enough, a line icon. Therefor I've never looked into whether we can add them in code. A quick look at the docs and I didn't find anything. The closest I came is &lt;A href="https://adndevblog.typepad.com/autocad/2016/03/adding-icon-next-to-custom-command.html" target="_blank" rel="noopener"&gt;THIS&lt;/A&gt; blog post, but it creates a CUIX file.&lt;/P&gt;</description>
    <pubDate>Tue, 16 May 2023 23:58:42 GMT</pubDate>
    <dc:creator>Jeff_M</dc:creator>
    <dc:date>2023-05-16T23:58:42Z</dc:date>
    <item>
      <title>Best practice: loading a cuix vs generating the ribbon from code</title>
      <link>https://forums.autodesk.com/t5/net-forum/best-practice-loading-a-cuix-vs-generating-the-ribbon-from-code/m-p/11604227#M10705</link>
      <description>&lt;P&gt;Is it better to manually create a cuix and then have the addin load it, or have the addin generating its own UI from code?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What are the pros and cons for each of the two approaches?&lt;/P&gt;</description>
      <pubDate>Wed, 07 Dec 2022 15:31:24 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/best-practice-loading-a-cuix-vs-generating-the-ribbon-from-code/m-p/11604227#M10705</guid>
      <dc:creator>stefanome</dc:creator>
      <dc:date>2022-12-07T15:31:24Z</dc:date>
    </item>
    <item>
      <title>Re: Best practice: loading a cuix vs generating the ribbon from code</title>
      <link>https://forums.autodesk.com/t5/net-forum/best-practice-loading-a-cuix-vs-generating-the-ribbon-from-code/m-p/11605348#M10706</link>
      <description>&lt;P&gt;I prefer the code route, that way I don't need to maintain a separate cuix file.&lt;/P&gt;</description>
      <pubDate>Wed, 07 Dec 2022 23:53:51 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/best-practice-loading-a-cuix-vs-generating-the-ribbon-from-code/m-p/11605348#M10706</guid>
      <dc:creator>Jeff_M</dc:creator>
      <dc:date>2022-12-07T23:53:51Z</dc:date>
    </item>
    <item>
      <title>Re: Best practice: loading a cuix vs generating the ribbon from code</title>
      <link>https://forums.autodesk.com/t5/net-forum/best-practice-loading-a-cuix-vs-generating-the-ribbon-from-code/m-p/11605381#M10707</link>
      <description>&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Generating the UI from code you don't need to maintain a separate file, but what about the bitmaps? Do I need to deploy a folder with all the bitmaps together with the dll?&lt;/P&gt;&lt;P&gt;If yes, do you find it easier than managing the cuix file?&lt;/P&gt;&lt;P&gt;If no, how are the bitmaps included in the dll?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;(In the past I created an addin for Revit where I used a json file with all the information required to generate the UI elements. It was working, I liked that approach, but that project has been cancelled and was never deployed, so I never crossed the deployment bridge. But this is AutoCAD anyway and things are different.)&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried to go the code direction, but I was not able to find an example that shows how to do it.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried with some examples from the documentation, but no luck. The first line on &lt;A href="https://help.autodesk.com/view/OARX/2023/ENU/?guid=GUID-01548FB4-7DE1-4025-B4C6-5E33D3530E15" target="_blank" rel="noopener"&gt;this page&lt;/A&gt;&amp;nbsp;for example doesn't even compile:&lt;/P&gt;&lt;LI-CODE lang="general"&gt;// the documentation shows:
RibbonButton button1 = new RibbonButton;

// it should be:
RibbonButton button1 = new RibbonButton(&amp;lt;missing parent&amp;gt;);&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can you point me to a working documentation page or to a working example?&lt;/P&gt;</description>
      <pubDate>Thu, 08 Dec 2022 00:13:33 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/best-practice-loading-a-cuix-vs-generating-the-ribbon-from-code/m-p/11605381#M10707</guid>
      <dc:creator>stefanome</dc:creator>
      <dc:date>2022-12-08T00:13:33Z</dc:date>
    </item>
    <item>
      <title>Re: Best practice: loading a cuix vs generating the ribbon from code</title>
      <link>https://forums.autodesk.com/t5/net-forum/best-practice-loading-a-cuix-vs-generating-the-ribbon-from-code/m-p/11605668#M10708</link>
      <description>&lt;P&gt;The images (I use PNG's, converted in code to the icon bitmap...this code has been posted before by others, will repost if you can't locate it) for the bitmaps are included in the Project's resources so get compiled into the DLL. Here is a short example of creating a ribbon&amp;nbsp;tab and panel in code:&lt;/P&gt;
&lt;LI-CODE lang="general"&gt;using Autodesk.AutoCAD.Runtime;
using Autodesk.Windows;

namespace AutoCADRibbonTesting
{
    public class Class1
    {
        [CommandMethod("testmyRibbon")]
        public void Testme()
        {
            RibbonControl ribbon = ComponentManager.Ribbon;
            if (ribbon != null)
            {
                RibbonTab rtab = ribbon.FindTab("TESTME");
                if (rtab != null)
                {
                    ribbon.Tabs.Remove(rtab);
                }
                rtab = new RibbonTab();
                rtab.Title = "TEST  ME";
                rtab.Id = "Testing";
                //Add the Tab
                ribbon.Tabs.Add(rtab);
                addContent(rtab);

            }
        }

        static void addContent(RibbonTab rtab)
        {
            rtab.Panels.Add(AddOnePanel());
        }

        static RibbonPanel AddOnePanel()
        {
            RibbonButton rb;
            RibbonRowBreak rbrk;
            RibbonPanelSource rps = new RibbonPanelSource();
            rps.Title = "Test One";
            RibbonPanel rp = new RibbonPanel();
            rp.Source = rps;

            rb = new RibbonButton();
            rb.Name = "Test Button 1";
            rb.ShowText = true;
            rb.Text = "Test Button 1";
            //Add the Button to the Tab
            rps.Items.Add(rb);

            rbrk = new RibbonRowBreak();
            rps.Items.Add(rbrk);

            rb = new RibbonButton();
            rb.Name = "Test Button 2";
            rb.ShowText = true;
            rb.Text = "Test Button 2";
            //Add the Button to the Tab
            rps.Items.Add(rb);

            rbrk = new RibbonRowBreak();
            rps.Items.Add(rbrk);
            rb = new RibbonButton();
            rb.Name = "Test Button 3";
            rb.ShowText = true;
            rb.Text = "Test Button 3";
            //Add the Button to the Tab
            rps.Items.Add(rb);

            rbrk = new RibbonRowBreak();
            rps.Items.Add(rbrk);
            rb = new RibbonButton();
            rb.Name = "Test Button 4";
            rb.ShowText = true;
            rb.Text = "Test Button 4";
            //Add the Button to the Tab
            rps.Items.Add(rb);

            return rp;
        }
    }
}&lt;/LI-CODE&gt;</description>
      <pubDate>Thu, 08 Dec 2022 04:47:32 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/best-practice-loading-a-cuix-vs-generating-the-ribbon-from-code/m-p/11605668#M10708</guid>
      <dc:creator>Jeff_M</dc:creator>
      <dc:date>2022-12-08T04:47:32Z</dc:date>
    </item>
    <item>
      <title>Re: Best practice: loading a cuix vs generating the ribbon from code</title>
      <link>https://forums.autodesk.com/t5/net-forum/best-practice-loading-a-cuix-vs-generating-the-ribbon-from-code/m-p/11609688#M10709</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/32637"&gt;@Jeff_M&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Rather minor, but your code as it stands creates duplicate tabs.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="general"&gt;RibbonTab rtab = ribbon.FindTab("TESTME");&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Should be&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="general"&gt;RibbonTab rtab = ribbon.FindTab("Testing");&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 09 Dec 2022 16:31:53 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/best-practice-loading-a-cuix-vs-generating-the-ribbon-from-code/m-p/11609688#M10709</guid>
      <dc:creator>hippe013</dc:creator>
      <dc:date>2022-12-09T16:31:53Z</dc:date>
    </item>
    <item>
      <title>Re: Best practice: loading a cuix vs generating the ribbon from code</title>
      <link>https://forums.autodesk.com/t5/net-forum/best-practice-loading-a-cuix-vs-generating-the-ribbon-from-code/m-p/11610121#M10710</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/1633394"&gt;@hippe013&lt;/a&gt;&amp;nbsp;I put that in there to see if anyone was actually checking it out .&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":grinning_squinting_face:"&gt;😆&lt;/span&gt; Funny no one has caught that the few other times I've posted the code. Thanks for catching it!&lt;/P&gt;</description>
      <pubDate>Fri, 09 Dec 2022 20:04:36 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/best-practice-loading-a-cuix-vs-generating-the-ribbon-from-code/m-p/11610121#M10710</guid>
      <dc:creator>Jeff_M</dc:creator>
      <dc:date>2022-12-09T20:04:36Z</dc:date>
    </item>
    <item>
      <title>Re: Best practice: loading a cuix vs generating the ribbon from code</title>
      <link>https://forums.autodesk.com/t5/net-forum/best-practice-loading-a-cuix-vs-generating-the-ribbon-from-code/m-p/11968485#M10711</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/32637"&gt;@Jeff_M&lt;/a&gt;,&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/1633394"&gt;@hippe013&lt;/a&gt;. I have started a post &lt;A title="https://forums.autodesk.com/t5/net/command-icons/td-p/11968173" href="https://forums.autodesk.com/t5/net/command-icons/td-p/11968173" target="_blank" rel="noopener"&gt;here&lt;/A&gt; and &lt;A title="https://forums.autodesk.com/t5/objectarx/command-icons-next-to-command/td-p/11968186" href="https://forums.autodesk.com/t5/objectarx/command-icons-next-to-command/td-p/11968186" target="_blank" rel="noopener"&gt;here&lt;/A&gt;. I was wondering if either of you can confirm that ribbon runtime API route does not allow for icons to be displayed next to command name in command line. Seems like &lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/32637"&gt;@Jeff_M&lt;/a&gt;&amp;nbsp;has chosen the code route and I was wondering if you could shed some light. Thank you all.&lt;/P&gt;</description>
      <pubDate>Tue, 16 May 2023 20:41:59 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/best-practice-loading-a-cuix-vs-generating-the-ribbon-from-code/m-p/11968485#M10711</guid>
      <dc:creator>karl.sch1983</dc:creator>
      <dc:date>2023-05-16T20:41:59Z</dc:date>
    </item>
    <item>
      <title>Re: Best practice: loading a cuix vs generating the ribbon from code</title>
      <link>https://forums.autodesk.com/t5/net-forum/best-practice-loading-a-cuix-vs-generating-the-ribbon-from-code/m-p/11968765#M10712</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/10282622"&gt;@karl.sch1983&lt;/a&gt;&amp;nbsp;to be perfectly honest, I don't recall even noticing that there is an icon displayed in the command line...I had to go look, used the Line command and Hah! sure enough, a line icon. Therefor I've never looked into whether we can add them in code. A quick look at the docs and I didn't find anything. The closest I came is &lt;A href="https://adndevblog.typepad.com/autocad/2016/03/adding-icon-next-to-custom-command.html" target="_blank" rel="noopener"&gt;THIS&lt;/A&gt; blog post, but it creates a CUIX file.&lt;/P&gt;</description>
      <pubDate>Tue, 16 May 2023 23:58:42 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/best-practice-loading-a-cuix-vs-generating-the-ribbon-from-code/m-p/11968765#M10712</guid>
      <dc:creator>Jeff_M</dc:creator>
      <dc:date>2023-05-16T23:58:42Z</dc:date>
    </item>
    <item>
      <title>Re: Best practice: loading a cuix vs generating the ribbon from code</title>
      <link>https://forums.autodesk.com/t5/net-forum/best-practice-loading-a-cuix-vs-generating-the-ribbon-from-code/m-p/11971482#M10713</link>
      <description>&lt;P&gt;Thanks&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/32637"&gt;@Jeff_M&lt;/a&gt;. That is what I suspected from all the posts I could find. I will see if there is any method exposed in ObjectARX. Thanks again for your time.&lt;/P&gt;</description>
      <pubDate>Wed, 17 May 2023 22:14:37 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/best-practice-loading-a-cuix-vs-generating-the-ribbon-from-code/m-p/11971482#M10713</guid>
      <dc:creator>karl.sch1983</dc:creator>
      <dc:date>2023-05-17T22:14:37Z</dc:date>
    </item>
  </channel>
</rss>

