Revit API Forum
Welcome to Autodesk’s Revit API Forums. Share your knowledge, ask questions, and explore popular Revit API topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How to assign new Command with Shortcut Key through Revit API

3 REPLIES 3
Reply
Message 1 of 4
DMallikarjuna
851 Views, 3 Replies

How to assign new Command with Shortcut Key through Revit API

Hi All,

 

I want to create a new command with my own Shortcut key in Revit 2015 through API.

 

I able to provide only shortcutkey for existing command, but in my scenario, i want to create a  new command in that list.

 

I unable to find, where exactly 'KeyboardShortcuts.xml' or  KeyboardShortcuts.txt will be available in our systems.

 

Please help me.

Thank You,
Mallikarjuna
3 REPLIES 3
Message 2 of 4
Anonymous
in reply to: DMallikarjuna

If you create your own IExternalCommand, it will appear in the list of commands that you can assign a keyboard shortcut to. This is true whether you add it to a ribbon panel or to the External Tools menu.
Message 3 of 4

The shortcuts config file is found here:

%appdata%\Autodesk\Revit\Autodesk Revit 2015\KeyboardShortcuts.xml

 

which on a typical installation translates to:

C:\Users\[UserName]\AppData\Roaming\Autodesk\Revit\Autodesk Revit 2015\KeyboardShortcuts.xml

 

I couldn't find an equivalent location in %programdata%, so doing it for all users at one time such as in an installation script would be a problem. I'd suggest getting your add-in application to check at startup whether its shortcut keys are assigned and update as required. I'm not sure whether Revit needs restarting to recognise new shortcuts added directly to the file so this might not be ideal.

 

Message 4 of 4
lionel.kai
in reply to: DMallikarjuna

I created the Idea / feature request here:

Keyboard Shortcuts API


Lionel J. Camara
BIM Manager at KAI Hawaii, Inc. - Structural and Forensic Engineers
Autodesk Certified Professional

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk DevCon in Munich May 28-29th


Rail Community