Using Dynamo to Execute Keyboard Shortucts


#1

Hi all,

Quick question regarding dynamo. Can I use dynamo to execute a keyboard shortcut?

I need to automate a process that requires a Revit add-in. I’ve assigned a keyboard shortcut to the required command within Revit. The command works within Revit perfectly well. I just need to use the command 1,200 times for this task, instead of my usual 3-5.

Thanks in advance.


#2

Dynamo has no built in nodes for this, and I am not aware of any packages that contain it. However, with a python node, it should be possible as there are libraries for it. Try googling a guide on how to use python to control keyboard inputs, there should be a lot of tutorials around.


#3

Thanks Kenny. I was in a pretty big time crunch last week and just used an autoclicker to execute the revit command alongside my script. Now I can check out how to do this with python!


#4

While you can call native windows handlers for key presses from within Dynamo, that would not have helped you, because while Dynamo is executing (which is also a Revit plugin), no other plugins would be able to work.