As David says, no switch required to load the RVT model. Just list it on the command line with Revit.exe and Revit will open it.
Similarly for add-ins: no switch required. Revit will load them as specified in the add-in manifests located in the add-ins folder in the standard manner.
Cheers,
Jeremy
How can you open a file in a particular version with process.start? I've tried many variations of the path to the .exe and the path to the file and always get an error message. (File opens fine through UI.) Thanks.
Replying on Command Line switches,
are there StartUp switches using Revit?
Is there a way to start revit (from API or add switch to .exe) using a specific .rte?
For now you can select a template after starting Revit, I would like to do it before I start Revit.
Thanks!!!
Rolph
Dear Rolph,
I am not aware of any such switch.
You could probably write an add-in that creates a new project document based on any given template automatically at start-up, though.
Cheers,
Jeremy
In my case I wanted to start Revit with a particular file before it was opened. I used the Idling event that looks for a txt file with a path in it. As soon as Revit is finished loading, the idling event kicks in and finds the txt file and processes it with the API commands.
Michael,
using the Idling event is a possible approach, but not one I recommend. For this kind of a problem (start Revit with a particular file via the API), I suggest using the ApplicationInitialized event instead.It is raised by Revit only once after the application is initialize and after add-ins were started too. In the handler of the event you can use the OpenAndActivateDocument - it would work as long as there is no active document open yet, which can be easily tested, though.
Hi Arnošt,
Thank you for the good advice!
Look at these in-depth discussion of this all-to-unknown event:
http://thebuildingcoder.typepad.com/blog/2015/03/automatically-open-a-project-on-startup.html
Cheers,
Jeremy
I could use a switch to set the default View Option. For instance, one Desktop launch shortcut set to Mechanical, another set to Plumbing.
Cool idea.
Please submit it to the Revit idea station:
http://thebuildingcoder.typepad.com/blog/2016/05/idea-station-and-textnote-bounding-box.html#2
Cheers,
Jeremy
Jeremy,
I am looking for Revit switch that would enable autpmatic load of Revit file as a local (silent mode). Reason- I need to get Dynamo Automation working on Central files ( I have about 80 files to process every iteration)
I explained my line of investigation here:
https://forum.dynamobim.com/t/dynamo-automation-for-central-files/8597?u=erlich.denis
Please, advise if it is possible to "decentralize" revit file via python script
Thank you in advance!
Dear Denis,
Happy New Year to you!
You have no need for any additional switch to auto-load a document on Revit start-up.
Just providing the full document path is sufficient, e.g.:
C:\>"C:\Program Files\Autodesk\Revit 2017\Revit.exe" Y:\a\rvt\Test.rvt
Cheers,
Jeremy
Hi,
I know this is not in answer to the last question, but it may be useful to others higher up the conversation.
These are the switches etc I'm aware of (tested in Revit 2017):
*no switch* <fully qualified path of file to open> (Opens a Revit file. Seems to work with a template or project file. Haven't tried a family. I've been doing this since Revit 2011, though I put /o in there so I know what it is, though that seems to be ignored.)
*no switch* <fully qualified path of journal file> (Replays a journal file.)
/language <language code such as ENU>
/viewer (Launch Revit in viewer mode.)
Cheers,
-Matt
Dear Matt,
thank you for the succinct summary!
I promoted it to a blog post for better legibility and future reference:
http://thebuildingcoder.typepad.com/blog/2017/01/distances-switches-kiss-ing-and-a-dino.html#3
Cheers,
Jeremy
Some command line switches that Ive used:
/nosplash Suppresses the splash screen
/min Starts the session minimised
/max Starts the session ... maximised!
Dear Callumf,
Thank you for your additions! I appended them to the blog post list as well for future reference:
http://thebuildingcoder.typepad.com/blog/2017/01/distances-switches-kiss-ing-and-a-dino.html#3
Cheers,
Jeremy
This is an old thread, but I wish there were switches -detach and -audit, to have Revit upgrade and check the file named in the commandline;
e.g. "C:\Program Files\Autodesk\Revit 2021>revit.exe /audit /detach D:\project path\project 1\AR_CD ver_01020304.rvt"
This would allow me to pipe a folder/file list to Revit to upgrade 10,000s of files in one hit, with some reliability (the several RVT upgrade apps I've found don't seem to work very well if at all, and have to be spoon fed if you want anything from them).
You can probably achieve running the audit command automatically on thousands of models in many different ways. You might be able to use a journal file to drive the process. Maybe you can run the audit command from a Revit add-in using PostCommand. All of these approaches can be automatically launched file by file in a batch process.
Can't find what you're looking for? Ask the community or share your knowledge.