Hi,
I wonder if Revit does have the command window like AutoCAD or not. So we can type any command to run inside Revit like AutoCAD.
For example, if I define a new class: public class Lab1PlaceGroup : IExternalCommand
Then I can type my new command Lab1PlaceGroup to the "Revit command line" (as I imagine with AutoCAD). It will be better than to define an addin file for each command. Therefore, I can have many classes inherited from IExternalCommand interface in a single DLL file.
Thanks,
Solved! Go to Solution.
Solved by jeremytammik. Go to Solution.
Solved by Scott_Wilson. Go to Solution.
There's no command line that I know of.
You can however assign keyboard shortcuts to any custom commands that you have added using the UI customization functionality found in Revit's Options window.
There is nothing stoping you from creating your own command console as a dockable window though 🙂
A simpler alternative might be to create a TextBox item in the ribbon labelled "Execute" where you type in the name of the command that you want to run and hit enter. Your "EnterPressed" event handler can then use reflection and some predetermined assembly / namespace locations to find the specified method and call it, passing through its "TextBoxEnterPressedEventArgs" paramter to provide a valid API context.
You can also take a look at the Revit Python and Ruby Shells.
They provide an interactive scripting command line:
Cheers,
Jeremy
Hi Jeremy,
Those two projects of Python and Ruby for Revit are very interesting. I am looking into them.
Thank you!
Khoa