<?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: Context Menu - Experiments and first Observations in Revit API Forum</title>
    <link>https://forums.autodesk.com/t5/revit-api-forum/context-menu-experiments-and-first-observations/m-p/13365893#M813</link>
    <description>&lt;P&gt;Not entirely sure, but I know there are some oddities with commands (Shortcut keys / Visibility) if the commands are not loaded on the Ribbon.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'd also say that the availability component of the Context menu could probably be helpful here as I can't imagine ALL of those are useful on / in every view.&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;menuItem.SetAvailabilityClassName(typeof(TAvailability).FullName)&lt;/LI-CODE&gt;</description>
    <pubDate>Wed, 12 Mar 2025 04:33:31 GMT</pubDate>
    <dc:creator>Sean_Page</dc:creator>
    <dc:date>2025-03-12T04:33:31Z</dc:date>
    <item>
      <title>Context Menu - Experiments and first Observations</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/context-menu-experiments-and-first-observations/m-p/13349107#M808</link>
      <description>&lt;P&gt;I've been recently playing a lot with context menus and managed to create some interesting problems.&lt;/P&gt;&lt;P&gt;Here they are:&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;Command started from context menu doesn’t save itself in the list of recently used commands:&lt;OL&gt;&lt;LI&gt;It won't be shown on the list of recent commands.&lt;/LI&gt;&lt;LI&gt;You won’t be able to repeat them with “repeat the last command”. Revit will run the previous command instead.&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="JulianWandzilak_0-1741005716305.png" style="width: 600px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1473174i9D4AE831FF80CDF7/image-size/medium?v=v2&amp;amp;px=400" role="button" title="JulianWandzilak_0-1741005716305.png" alt="JulianWandzilak_0-1741005716305.png" /&gt;&lt;/span&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;BR /&gt;It is super annoying especially that we want to be able to use these commands often and start them quickly (which is the main reason to use context menu vs normal buttons) &amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;/LI&gt;&lt;LI&gt;There is a maximum number of register commands. After hitting some magical number (I didn’t count them, but the number is probably somewhere close to 150), Revit will allow you to create more of them but will block us from using them. They will be greyed out as in the picture below - I learn about it by a fluke after spending an hour trying to find out why commands for one of my tools are grayed out.&amp;nbsp;&lt;BR /&gt;One thing to keep in mind is that you share this number between all loaded add-ins.&lt;BR /&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="JulianWandzilak_1-1741005716308.png" style="width: 600px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1473175iA1D54A3AB8090EA7/image-size/medium?v=v2&amp;amp;px=400" role="button" title="JulianWandzilak_1-1741005716308.png" alt="JulianWandzilak_1-1741005716308.png" /&gt;&lt;/span&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 03 Mar 2025 12:53:11 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/context-menu-experiments-and-first-observations/m-p/13349107#M808</guid>
      <dc:creator>Julian.Wandzilak</dc:creator>
      <dc:date>2025-03-03T12:53:11Z</dc:date>
    </item>
    <item>
      <title>Re: Context Menu - Experiments and first Observations</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/context-menu-experiments-and-first-observations/m-p/13349345#M809</link>
      <description>&lt;P&gt;Oh dear. That sounds a bit irritating. Thank you very much for documenting and sharing this! I guess I can understand (or imagine, at least) the Revit developers' point of view. Problem is, whenever you provide a customisation possibility, somebody will find a completely unexpected use case for it which hits limits that you never imagined would be reached or relevant. Anyway, &lt;A href="https://autodesk.slack.com/archives/C0SR6NAP8/p1741012628822899" target="_blank"&gt;I shared your findings with them&lt;/A&gt;. Let's wait and see what they say.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 03 Mar 2025 14:40:20 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/context-menu-experiments-and-first-observations/m-p/13349345#M809</guid>
      <dc:creator>jeremy_tammik</dc:creator>
      <dc:date>2025-03-03T14:40:20Z</dc:date>
    </item>
    <item>
      <title>Re: Context Menu - Experiments and first Observations</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/context-menu-experiments-and-first-observations/m-p/13350008#M810</link>
      <description>&lt;P&gt;Learning by breaking... My favourite method. And now I have to figure out a way of making some settings for my users to personalize their choice of items in context menu. More learning &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&amp;nbsp; &amp;nbsp;&lt;/P&gt;&lt;P&gt;To be fair, I have 240+ commands across all my tools now, so I am probably the only one who was able to hit this problem. The context menus are glorious and such a big present from devs so naturally it would be great to be somehow responsible for making them even better.&lt;/P&gt;</description>
      <pubDate>Mon, 03 Mar 2025 20:03:31 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/context-menu-experiments-and-first-observations/m-p/13350008#M810</guid>
      <dc:creator>Julian.Wandzilak</dc:creator>
      <dc:date>2025-03-03T20:03:31Z</dc:date>
    </item>
    <item>
      <title>Re: Context Menu - Experiments and first Observations</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/context-menu-experiments-and-first-observations/m-p/13355178#M811</link>
      <description>&lt;P&gt;Initial discussion of this:&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp;&lt;/P&gt;
&lt;P&gt;1. Sounds like a it should be filed if there's a reproducible case.&lt;BR /&gt;2. 150 is a lot of content for the context menu. Please remember that it is a shared space and Revit design does not put everything you can do in the entire Ribbon/other UI into the context menu, only the commands we believe will be the most needed. That being said, I wonder if we can clarify this limitation and perhaps fail better than showing a non-usable button. &lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp;&lt;/P&gt;
&lt;P&gt;Not adding context menu commands to the list of recent commands is the same for internal commands. Maybe, to avoid commands that may depend on selection and therefore may be not repeatable. This doesn't work perfectly though...&amp;nbsp;There's an additional complication for external context menu commands because we clear the commands before building a new menu&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp;&lt;/P&gt;
&lt;P&gt;External context menu commands are assigned temporary ids.&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp;&lt;/P&gt;
&lt;P&gt;There's a debug warning if too many commands are created. That needs to surface to the plugin developer.&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/P&gt;
&lt;P&gt;BTW, our current estimate is that no more than 200 external context menu commands are possible, it seems.&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 06 Mar 2025 00:59:50 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/context-menu-experiments-and-first-observations/m-p/13355178#M811</guid>
      <dc:creator>jeremy_tammik</dc:creator>
      <dc:date>2025-03-06T00:59:50Z</dc:date>
    </item>
    <item>
      <title>Re: Context Menu - Experiments and first Observations</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/context-menu-experiments-and-first-observations/m-p/13361099#M812</link>
      <description>&lt;P&gt;Thanks Jeremy,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;1. Happy to provide my plugins at some point - just need some time to finish Drafter for revit 2026.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;2. It is rather enough. As mentioned before, I'm going to code myself some "settings". It will allow user to choose which ones they are using. Still, right now it fails without style and creates confusion &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt; No way to check if it is going to happen, so it is hard to even warn a user about it.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;3. Don't really see a good reason to keep it this way. Below the print screen with my external Command (part of my free plugin Extra). It registers nicely in the last commands and at the same time you can run it via last used command. First things which it does is to prompt user to select something (or it checks currently selected elements if there are some)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="JulianWandzilak_0-1741554101468.jpeg" style="width: 600px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1475545i901605732455A046/image-size/medium?v=v2&amp;amp;px=400" role="button" title="JulianWandzilak_0-1741554101468.jpeg" alt="JulianWandzilak_0-1741554101468.jpeg" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;link to the animation presenting it:&lt;/P&gt;&lt;P&gt;&lt;A title="Link to my web page with a short gif animation " href="https://w7k.pl/tools/extra/#measure-outside-perimeter-of-selected-regions" target="_blank" rel="noopener"&gt;Link to my web page with a short gif animation &lt;/A&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 09 Mar 2025 21:06:30 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/context-menu-experiments-and-first-observations/m-p/13361099#M812</guid>
      <dc:creator>Julian.Wandzilak</dc:creator>
      <dc:date>2025-03-09T21:06:30Z</dc:date>
    </item>
    <item>
      <title>Re: Context Menu - Experiments and first Observations</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/context-menu-experiments-and-first-observations/m-p/13365893#M813</link>
      <description>&lt;P&gt;Not entirely sure, but I know there are some oddities with commands (Shortcut keys / Visibility) if the commands are not loaded on the Ribbon.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'd also say that the availability component of the Context menu could probably be helpful here as I can't imagine ALL of those are useful on / in every view.&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;menuItem.SetAvailabilityClassName(typeof(TAvailability).FullName)&lt;/LI-CODE&gt;</description>
      <pubDate>Wed, 12 Mar 2025 04:33:31 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/context-menu-experiments-and-first-observations/m-p/13365893#M813</guid>
      <dc:creator>Sean_Page</dc:creator>
      <dc:date>2025-03-12T04:33:31Z</dc:date>
    </item>
    <item>
      <title>Re: Context Menu - Experiments and first Observations</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/context-menu-experiments-and-first-observations/m-p/13385827#M814</link>
      <description>&lt;P&gt;Thanks &lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/3064449"&gt;@Sean_Page&lt;/a&gt; for this suggestion, I managed to implement it.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;A quick question, right now it grays out the command - Have you found out a way of hiding it completely? Also, in case of having all the options grayed out, we should be able to hide SubMenuItems, but I haven't seen anything allowing it.&lt;/P&gt;</description>
      <pubDate>Sun, 23 Mar 2025 15:46:18 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/context-menu-experiments-and-first-observations/m-p/13385827#M814</guid>
      <dc:creator>Julian.Wandzilak</dc:creator>
      <dc:date>2025-03-23T15:46:18Z</dc:date>
    </item>
    <item>
      <title>Re: Context Menu - Experiments and first Observations</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/context-menu-experiments-and-first-observations/m-p/13385833#M815</link>
      <description>&lt;P&gt;Since the menus are initiated on Context (click) then you have to provide logic with each call to show (add) calls to the menu.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Example here is a method that check current selection and if they are of a certain category the menu option is added.&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;if(CheckReferences(BuiltInCategory.OST_Rooms) || CheckReferences(BuiltInCategory.OST_Areas))
                    {
                        menu.AddSubMenu("Spaces", SpacesSubMenu);
                        menu.AddSeparator();
                    }&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 23 Mar 2025 16:00:53 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/context-menu-experiments-and-first-observations/m-p/13385833#M815</guid>
      <dc:creator>Sean_Page</dc:creator>
      <dc:date>2025-03-23T16:00:53Z</dc:date>
    </item>
  </channel>
</rss>

