<?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: Getting RevitCommandID for any commands users executes in Revit API Forum</title>
    <link>https://forums.autodesk.com/t5/revit-api-forum/getting-revitcommandid-for-any-commands-users-executes/m-p/10192283#M27303</link>
    <description>&lt;P&gt;For that kind of analytics, I think looking at journals would be an easier way. I remember seeing a a post with similar topic on builduing coder.&lt;/P&gt;</description>
    <pubDate>Sat, 27 Mar 2021 17:05:10 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2021-03-27T17:05:10Z</dc:date>
    <item>
      <title>Getting RevitCommandID for any commands users executes</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/getting-revitcommandid-for-any-commands-users-executes/m-p/10174686#M27293</link>
      <description>&lt;P&gt;Hi Everyone,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;after doing some research I couldn't find the answer to my question and I was hoping I can get some help from people here.&lt;/P&gt;&lt;P&gt;I have parsed a large number of Revit journals and have extracted the RevitCommandIds from it based on user name and project name. I have trained a machine learning model to predict what would be the next command based on a given sequence.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Now I want to integrate my machine learning model with Revit such that I can get the RevitCommandId (e.g "ID_EDIT_MOVE" or "ID_FINISH_SKETCH" ) as the user executes the commands and feed that string to my prediction function and get a prediction for the next commands.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The question I have is if there any ways that I can listen to command execution and get RevitCommandID, I taught of command binding but it is not feasible to do that for 500+ commands I have recorded and there will be some performance issues also as far as I understand it can be used with portable commands.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have already looked into these links but I couldn't figure out a way:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://thebuildingcoder.typepad.com/blog/2012/06/replacing-built-in-commands-and-their-ids.html" target="_blank" rel="noopener"&gt;building coder(Command ID )&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://forums.autodesk.com/t5/revit-api-forum/recording-executed-commands/td-p/6675159" target="_blank" rel="noopener"&gt;Revit Forum (IUpdater)&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://forums.autodesk.com/t5/revit-api-forum/how-to-handle-the-firing-of-a-revit-command-with/m-p/8296301" target="_blank" rel="noopener"&gt;Revit Forum ( Same question Unresolved)&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I would appreciate any suggestions.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 21 Mar 2021 22:51:38 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/getting-revitcommandid-for-any-commands-users-executes/m-p/10174686#M27293</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-03-21T22:51:38Z</dc:date>
    </item>
    <item>
      <title>Re: Getting RevitCommandID for any commands users executes</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/getting-revitcommandid-for-any-commands-users-executes/m-p/10176995#M27294</link>
      <description>&lt;P&gt;Wow! That sounds like a really exciting project!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Don't know whether this will help...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The&amp;nbsp;DocumentChangedEvent enables you to determine the transaction names using the GetTransactionNames method:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://www.revitapidocs.com/2021.1/bc13391a-66bd-1530-3d08-f1b48a460416.htm" target="_blank"&gt;https://www.revitapidocs.com/2021.1/bc13391a-66bd-1530-3d08-f1b48a460416.htm&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This enables detecting launch and completion of specific commands:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://thebuildingcoder.typepad.com/blog/2020/01/torsion-tools-command-event-and-info-in-da4r.html#3" target="_blank"&gt;https://thebuildingcoder.typepad.com/blog/2020/01/torsion-tools-command-event-and-info-in-da4r.html#3&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 22 Mar 2021 18:43:32 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/getting-revitcommandid-for-any-commands-users-executes/m-p/10176995#M27294</guid>
      <dc:creator>jeremy_tammik</dc:creator>
      <dc:date>2021-03-22T18:43:32Z</dc:date>
    </item>
    <item>
      <title>Re: Getting RevitCommandID for any commands users executes</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/getting-revitcommandid-for-any-commands-users-executes/m-p/10177574#M27295</link>
      <description>&lt;P&gt;There is an event in AdWindows you can subscribe to which will give you the ids similar to how they appear in the journal but it only covers UI clicks:&lt;/P&gt;&lt;P&gt;Autodesk.Windows.ComponentManager.ItemExecuted&lt;BR /&gt;Autodesk.Internal.Windows.RibbonItemExecutedEventArgs&lt;BR /&gt;Autodesk.Internal.Windows.RibbonItemExecutedEventArgs.Item.Cookie&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If you use context menu you don't get the above. AdWindows is also not part of the API so is used without guarantees of stability or fitness for purpose attached.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;There is no secret if I place a beam the next command is often to place a second beam then a third...On some other occasion I'll be doing the walls or foundations perhaps.&lt;/P&gt;</description>
      <pubDate>Mon, 22 Mar 2021 22:12:45 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/getting-revitcommandid-for-any-commands-users-executes/m-p/10177574#M27295</guid>
      <dc:creator>RPTHOMAS108</dc:creator>
      <dc:date>2021-03-22T22:12:45Z</dc:date>
    </item>
    <item>
      <title>Re: Getting RevitCommandID for any commands users executes</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/getting-revitcommandid-for-any-commands-users-executes/m-p/10184408#M27296</link>
      <description>&lt;P&gt;Thank you Jeremy for your quick response,&lt;/P&gt;&lt;P&gt;I am just experimenting with different things to see how data recorded in journals be of use other than troubleshooting.&lt;/P&gt;&lt;P&gt;I looked into transaction names and I was wondering if is there enumerable transaction names like the one for postable commands?&amp;nbsp; If I couldn't find a way to get the command IDs I am going to try pairing transaction names with command IDs if there is any relations between these two.&lt;/P&gt;</description>
      <pubDate>Wed, 24 Mar 2021 22:07:06 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/getting-revitcommandid-for-any-commands-users-executes/m-p/10184408#M27296</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-03-24T22:07:06Z</dc:date>
    </item>
    <item>
      <title>Re: Getting RevitCommandID for any commands users executes</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/getting-revitcommandid-for-any-commands-users-executes/m-p/10184419#M27297</link>
      <description>&lt;P&gt;Thanks for the info I will look into those events and methods.&lt;/P&gt;&lt;P&gt;About the prediction you are right, there are some obvious next moves based on the context and it is easy for us, humans to predict but I am just experimenting with different things such as predicting errors or failures, recommending better workflows and etc.&lt;/P&gt;</description>
      <pubDate>Wed, 24 Mar 2021 22:12:57 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/getting-revitcommandid-for-any-commands-users-executes/m-p/10184419#M27297</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-03-24T22:12:57Z</dc:date>
    </item>
    <item>
      <title>Re: Getting RevitCommandID for any commands users executes</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/getting-revitcommandid-for-any-commands-users-executes/m-p/10188609#M27298</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I think the below code will help you to get the active command id.&lt;/P&gt;&lt;P&gt;var cmdId = UIFrameworkServices.CommandHandlerService.getActiveCommandId();&lt;/P&gt;</description>
      <pubDate>Fri, 26 Mar 2021 08:23:38 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/getting-revitcommandid-for-any-commands-users-executes/m-p/10188609#M27298</guid>
      <dc:creator>sankar_g</dc:creator>
      <dc:date>2021-03-26T08:23:38Z</dc:date>
    </item>
    <item>
      <title>Re: Getting RevitCommandID for any commands users executes</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/getting-revitcommandid-for-any-commands-users-executes/m-p/10190793#M27299</link>
      <description>&lt;P&gt;Thanks for the reference , Do you know where I can find documentation on UIFrameworkServices ? and what would be a proper event to subscribe to?&lt;/P&gt;</description>
      <pubDate>Sat, 27 Mar 2021 00:38:03 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/getting-revitcommandid-for-any-commands-users-executes/m-p/10190793#M27299</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-03-27T00:38:03Z</dc:date>
    </item>
    <item>
      <title>Re: Getting RevitCommandID for any commands users executes</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/getting-revitcommandid-for-any-commands-users-executes/m-p/10190867#M27300</link>
      <description>&lt;LI-CODE lang="python"&gt;from pyrevit import HOST_APP, framework
from pyrevit import revit
from pyrevit.framework import clr
clr.AddReference('UIFrameworkServices')

import UIFramework
import UIFrameworkServices


def event_handler_function(sender, args):

    transName=args.GetTransactionNames()
    commandID=UIFrameworkServices.
    CommandHandlerService.getActiveCommandId()
    print(transName)
    print(commandID)


HOST_APP.app.DocumentChanged  += \
    framework.EventHandler[DocumentChangedEventArgs](
        event_handler_function
        )
&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm using pyrevit because machine learning libraries I am using are in python and I know python more in general.&lt;/P&gt;&lt;P&gt;This is how I was subscribing to documentChanged event and I was getting transaction names but when I don't get anything for the getActiveCommandID. any help is much appreciated.&lt;/P&gt;</description>
      <pubDate>Sat, 27 Mar 2021 01:26:41 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/getting-revitcommandid-for-any-commands-users-executes/m-p/10190867#M27300</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-03-27T01:26:41Z</dc:date>
    </item>
    <item>
      <title>Re: Getting RevitCommandID for any commands users executes</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/getting-revitcommandid-for-any-commands-users-executes/m-p/10191283#M27301</link>
      <description>&lt;P&gt;I wonder if this can be used to monitor which addins are being used, to get an idea of their usefullness.&lt;/P&gt;</description>
      <pubDate>Sat, 27 Mar 2021 08:25:15 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/getting-revitcommandid-for-any-commands-users-executes/m-p/10191283#M27301</guid>
      <dc:creator>frankholidayjunior</dc:creator>
      <dc:date>2021-03-27T08:25:15Z</dc:date>
    </item>
    <item>
      <title>Re: Getting RevitCommandID for any commands users executes</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/getting-revitcommandid-for-any-commands-users-executes/m-p/10191405#M27302</link>
      <description>&lt;P&gt;thanx,&lt;/P&gt;&lt;P&gt;this solves my problem.&lt;/P&gt;&lt;P&gt;i just need to prefix my transactions with the addin name&lt;/P&gt;</description>
      <pubDate>Sat, 27 Mar 2021 09:59:28 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/getting-revitcommandid-for-any-commands-users-executes/m-p/10191405#M27302</guid>
      <dc:creator>frankholidayjunior</dc:creator>
      <dc:date>2021-03-27T09:59:28Z</dc:date>
    </item>
    <item>
      <title>Re: Getting RevitCommandID for any commands users executes</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/getting-revitcommandid-for-any-commands-users-executes/m-p/10192283#M27303</link>
      <description>&lt;P&gt;For that kind of analytics, I think looking at journals would be an easier way. I remember seeing a a post with similar topic on builduing coder.&lt;/P&gt;</description>
      <pubDate>Sat, 27 Mar 2021 17:05:10 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/getting-revitcommandid-for-any-commands-users-executes/m-p/10192283#M27303</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-03-27T17:05:10Z</dc:date>
    </item>
    <item>
      <title>Re: Getting RevitCommandID for any commands users executes</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/getting-revitcommandid-for-any-commands-users-executes/m-p/10192795#M27304</link>
      <description>&lt;P&gt;thanx Aradnia&lt;/P&gt;</description>
      <pubDate>Sat, 27 Mar 2021 23:01:50 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/getting-revitcommandid-for-any-commands-users-executes/m-p/10192795#M27304</guid>
      <dc:creator>frankholidayjunior</dc:creator>
      <dc:date>2021-03-27T23:01:50Z</dc:date>
    </item>
    <item>
      <title>Re: Getting RevitCommandID for any commands users executes</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/getting-revitcommandid-for-any-commands-users-executes/m-p/10195350#M27305</link>
      <description>&lt;P&gt;yes works fine as long as your namespace is well structured you can use to filter the string as its a mess otherwise&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 29 Mar 2021 10:24:05 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/getting-revitcommandid-for-any-commands-users-executes/m-p/10195350#M27305</guid>
      <dc:creator>frankholidayjunior</dc:creator>
      <dc:date>2021-03-29T10:24:05Z</dc:date>
    </item>
    <item>
      <title>Re: Getting RevitCommandID for any commands users executes</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/getting-revitcommandid-for-any-commands-users-executes/m-p/10210900#M27306</link>
      <description>&lt;P&gt;There is no documentation for UIFrameworkServices.&lt;/P&gt;&lt;P&gt;I haven't worked with pyRevit. I am sure the &lt;SPAN&gt;getActiveCommandId() method&amp;nbsp;&lt;/SPAN&gt;is working fine with C# API.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 04 Apr 2021 14:33:51 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/getting-revitcommandid-for-any-commands-users-executes/m-p/10210900#M27306</guid>
      <dc:creator>sankar_g</dc:creator>
      <dc:date>2021-04-04T14:33:51Z</dc:date>
    </item>
  </channel>
</rss>

