Does the LookupCommandId only find commands found un the Add-Ins tab?

Does the LookupCommandId only find commands found un the Add-Ins tab?

dtartaglia_PYEBEB5KA84W
Enthusiast Enthusiast
766 Views
5 Replies
Message 1 of 6

Does the LookupCommandId only find commands found un the Add-Ins tab?

dtartaglia_PYEBEB5KA84W
Enthusiast
Enthusiast

Hi,

 

I'm trying to use this method to return the id of commands found in a custom company tab. I followed all the steps by grabbing the value from the journal file but it only seems to work if the command exists in a non-custom revit tab. Is this correct? I'm using Revit 2023.

 

Thank you,

Dan

 

0 Likes
Accepted solutions (1)
767 Views
5 Replies
Replies (5)
Message 2 of 6

caroline.gitonga
Autodesk
Autodesk

Hi @dtartaglia_PYEBEB5KA84W,

I would suggest you try to lookup the command using ClientId on youradd-in manifest. You may check this forum case thread that is related: https://forums.autodesk.com/t5/revit-api-forum/how-to-get-the-parameter-value-of-lookupcommandid-str.... Also, check this resource from my colleague Jeremy elaborating the implementation further:  https://thebuildingcoder.typepad.com/blog/2013/10/programmatic-custom-add-in-external-command-launch...

 

Carol Gitonga, Developer Advocacy and Support, ADN Open
0 Likes
Message 3 of 6

dtartaglia_PYEBEB5KA84W
Enthusiast
Enthusiast

Hi,

 

I've seen those articles and ran a lot of tests. Have you tried creating your own tab with buttons and gotten the id from any of the buttons/commands?

 

Thank you,

Dan

0 Likes
Message 4 of 6

caroline.gitonga
Autodesk
Autodesk
Accepted solution

Hi @dtartaglia_PYEBEB5KA84W,

I have a command that I have placed on a custom tab.

On the journal file log it reads: "Jrn.RibbonEvent "Execute external command:CustomCtrl_%CustomCtrl_%Grimshaw%Tools%cmdCurveTotalLength:AddCustomRibbonTab.Command". The string to use on the LookupCommandId is: "CustomCtrl_%CustomCtrl_%Grimshaw%Tools%cmdCurveTotalLength";

as below:

string name = "CustomCtrl_%CustomCtrl_%Grimshaw%Tools%cmdCurveTotalLength";

RevitCommandId id_addin = RevitCommandId.LookupCommandId(name);

carolinegitonga_0-1684840528078.png

Kindly, try on your end and see if this works. The string parameter should be string between the full-colons:

"Jrn.RibbonEvent "Execute external command:CustomCtrl_%CustomCtrl_%Grimshaw%Tools%cmdCurveTotalLength:AddCustomRibbonTab.Command"

 

 

 

Carol Gitonga, Developer Advocacy and Support, ADN Open
Message 5 of 6

dtartaglia_PYEBEB5KA84W
Enthusiast
Enthusiast

Thanks, I'll try again later today. Hope it works.

Message 6 of 6

dtartaglia_PYEBEB5KA84W
Enthusiast
Enthusiast

Thanks, if it worked for you it should work for me. I'll check your syntax later today.