Revit Batch Add List of Parameter to Family

Attending: Due to other commitments I'yard unable to back up RBP for the hereafter. For questions please seek help from the customs such as the Dynamo and Revit API forums.

Revit Batch Processor (RBP)

Fully automated batch processing of Revit files with your own Python or Dynamo task scripts!

Latest version (NEW)

Installer for Revit Batch Processor v1.7.0 beta

Version 1.vii.0 beta release is available, bringing support for Revit 2022!

Cheers to Nicklas Oestergaard (@NicklasOestergaard) for upgrading the codebase to support Revit 2022.

Come across the Releases page for more data.

RBP Sample Scripts

Click here for some sample RBP python scripts maintained past Jan Christel (@jchristel)

Many thanks to Jan for authoring and making these RBP sample scripts public!

FAQ

See the Revit Batch Processor FAQ.

Use cases

This tool doesn't practice whatever of these things, but information technology allows you to exercise them:

  • Open all the Revit files across your Revit projects and run a health-check script against them. Keeping an eye on the health and operation of many Revit files is fourth dimension-consuming. You could use this to cheque in on all your files daily and react to problems before they get too gnarly.
  • Perform project and family audits across your Revit projects.
  • Run big scale queries confronting many Revit files.
  • Mine data from your Revit projects for analytics or car learning projects.
  • Automated milestoning of Revit projects.
  • Automated housekeeping tasks (e.g. identify elements on appropriate worksets)
  • Batch upgrading of Revit projects and family files.
  • Testing your own Revit API scripts and Revit addins against a variety of Revit models and families in an automated style.
  • Essentially anything you can practice to 1 Revit file with the Revit API or a Dynamo script, y'all can at present exercise to many!

Screenshot of the UI

Features

  • Batch processing of Revit files (.rvt and .rfa files) using either a specific version of Revit or a version that matches the version of Revit the file was saved in. Currently supports processing files in Revit versions 2015 through 2022. (Of class the required version of Revit must be installed!)
  • Custom task scripts written in Python or Dynamo! Python scripts have total access to the Revit API. Dynamo scripts can of course exercise any Dynamo can do :)
  • Option to create a new Python task script at the click of a push that contains the minimal amount of code required for the custom task script to operate on an opened Revit file. The new job script can then easily be extended to do some useful work. It tin even load and execute your existing functions in a C# DLL (see Executing functions in a C# DLL).
  • Option for custom pre- and mail-processing job scripts. Useful if the overall batch processing task requires some additional setup / tear downwardly work to be washed.
  • Central file processing options (Create a new local file, Detach from central).
  • Option to process files (of the same Revit version) in the same Revit session, or to process each file in its own Revit session. The latter is useful if Revit happens to crash during processing, since this won't block further processing.
  • Automated Revit dialog / bulletin box handling. These, in addition to Revit error letters are handled and logged to the GUI console. This makes the batch processor very likely to complete its tasks without any user intervention required!
  • Ability to import and export settings. This feature combined with the simple command-line interface allows for batch processing tasks to exist setup to run automatically on a schedule (using the Windows Chore Scheduler) without the GUI.
  • Generate a .txt-based list of Revit model file paths compatible with RBP. The New List button in the GUI will prompt for a binder path to browse for Revit files. Optionally you can specify the type of Revit files to scan for and also whether to include subfolders in the scan.

Unlimited Power

"With groovy power come peachy responsibility" -- Spiderman

This tool enables you to do things with Revit files on a very large scale. Because of this ability, Python or Dynamo scripts that brand modifications to Revit files (esp. workshared files) should be developed with the utmost care! Yous will need to exist confident in your ability to write Python or Dynamo scripts that won't ruin your files en-masse. The Revit Batch Processor's 'Detach from Central' pick should exist used both while testing and for scripts that practice not explicitly depend on working with a live workshared Primal file.

Build & Installation Instructions

Installer

Installer for Revit Batch Processor v1.7.0

The Revit Batch Processor (GUI) application volition appear in the Start menu after the installation.

Build from Source code

Open the solution file RevitBatchProcessor.sln in Visual Studio 2017 or later on and run Build Solution (F6).

Revit addins will be automatically deployed to the Addins binder for each available Revit version [2015-2022]. e.k. %APPDATA%\Autodesk\Revit\Addins\2019

The BatchRvtGUI projection is the GUI that drives the underlying engine (the BatchRvt project). Once built, run BatchRvtGUI.exe to start the Revit Batch Processor GUI.

When rebuilding, please brand sure all Revit applications are closed before attempting the rebuild.

Requirements

  • At least one version of Revit installed. Currently supports Revit versions 2015 through 2022.
  • To build from source code, Visual Studio version 2017 or after.
  • If executing Dynamo scripts from the task script, Dynamo 1.three+ installed (currently supports Revit versions 2016 through 2022). Annotation: The Dynamo script MUST accept been saved with the 'Automated' Run mode. There MUST BE EXACTLY One VERSION OF DYNAMO INSTALLED for each version of Revit.
  • If using an Excel file for the Revit File List, Microsoft Office / Excel installed.

License

This projection is licensed under the terms of The GNU General Public License v3.0

Copyright (c) 2021 Daniel Rumery, BVN

This program is gratuitous software: you lot can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your pick) any subsequently version.

This program is distributed in the promise that it will exist useful, but WITHOUT ANY WARRANTY; without fifty-fifty the implied warranty of MERCHANTABILITY or Fitness FOR A Particular PURPOSE. See the GNU General Public License for more details.

You lot should take received a copy of the GNU General Public License forth with this plan. If non, see http://www.gnu.org/licenses/.

Credits

Daniel Rumery @DanRumery (Original / Primary Author)

Other Contributors (code)

  • Vincent Cadoret @vinnividivicci
  • Ryan Schwartz @RyanSchw
  • Dimitar Venkov @dimven
  • Nicklas Ostergaard @NicklasOestergaard (Upgraded support for Revit 2022)

Usage

The ii ingredients you will need in order to use the Revit Batch Processor ("RBP") are:

  • An Excel (.xlsx) file or Text (.txt) file that contains a list of Revit file paths. Each file path must be fully qualified (no partial paths).

    For an Excel file this means the kickoff column of each row contains a file path.

    For a Text file this means each line contains a file path.

    For case:

                      P:\15\ProjectABC\MainModel.rvt P:\xvi\ProjectXYZ\ModelA.rvt P:\sixteen\ProjectXYZ\ModelB.rvt P:\16\ProjectXYZ\ConsultantModel.rvt                                  

    NOTE: yous tin generate this listing in .txt format using the New List button in the GUI. Information technology will prompt you for a folder to scan for Revit files. Optionally you can specify the type of Revit files to scan for and also whether to include subfolders in the browse.

    New in version i.6+

    There is limited support for processing files in BIM360. For BIM360-hosted files, use the following format instead:

    <Revit version> <Projection Guid> <Model Guid>

    Note: these three components must be separated by space(s) (not tabs!).

    For example:

                      2020 75b6464c-ba0f-4529-b049-0de9e473c2d6 0d54b8cc-3837-4df2-8c8e-0a94f4828868 2020 c0dc2fda-fd34-42fe-8bb7-bd9f43841dbf d9f011d6-d52c-4c9f-9d7b-eb8388bd3ed0                                  

    RBP is not able to discover the Revit version of cloud models hence why the Revit version is specified explicitly.

  • A Dynamo (.dyn) or Python (.py) chore script. This script will be executed once for each file in the list.

    For Dynamo scripts, any workspace (.dyn) file should work equally a task script without modification. (Indeed, if yous detect a script that works in Dynamo but not in RBP, submit an Issue to the RBP github page!)

    For Python scripts (*.py) they should comprise at minimum the following code:

                      '''Output "How-do-you-do Revit earth!" to the console / log.'''                  # This section is common to all Python task scripts.                                    import                  clr                  import                  System                  clr.AddReference("RevitAPI")                  clr.AddReference("RevitAPIUI")                  from                  Autodesk.Revit.DB                  import                  *                  import                  revit_script_util                  from                  revit_script_util                  import                  Output                  sessionId                  =                  revit_script_util.GetSessionId()                  uiapp                  =                  revit_script_util.GetUIApplication()                  doc                  =                  revit_script_util.GetScriptDocument()                  revitFilePath                  =                  revit_script_util.GetRevitFilePath()                  # The code above is boilerplate, everything below is all yours.                  # You tin use almost whatever part of the Revit API here!                  Output()                  Output("Howdy Revit globe!")

Executing functions in a C# DLL

Using a python task script it's quite easy to load and execute code in a C# DLL. When RBP runs the python chore script, it adds the task script'due south folder path to the search paths and then that if your DLL is in the same folder equally your python task script you should exist able to execute your functions every bit follows:

              # For case assume your DLL is called MyUtilities.dll and you take a static function called SomeClass.DoSomeWork() in namespace MyNameSpace:              # Presume this python script exists in the aforementioned folder equally MyUtilities.dll.              clr.AddReference("MyUtilities")              from              MyNameSpace              import              SomeClass              # Invoke your static function, passing in whatever parameters y'all need.              SomeClass.DoSomeWork(md)

Control-line Interface

Revit Batch Processor can exist run from the control-line (bypassing the GUI). Kickoff configure and export the required processing settings from the GUI application. Once this is done you can simply run the control line utility BatchRvt.exe passing the exported settings file path as an argument:

              %LOCALAPPDATA%\RevitBatchProcessor\BatchRvt.exe --settings_file "BatchRvt.Settings.json"                          

Optionally yous can also specify the location for the log file:

              %LOCALAPPDATA%\RevitBatchProcessor\BatchRvt.exe --log_folder "C:\MyBatchTasks\Logs" --settings_file "C:\MyBatchTasks\BatchRvt.Settings.json"                          

Alternatively, RBP can exist run in batch processing style without a settings file, using some bones arguments:

              %LOCALAPPDATA%\RevitBatchProcessor\BatchRvt.exe --task_script MyDynamoWorkspace.dyn --file_list RevitFileList.xlsx --revit_version 2018                          

Annotation: this mode will operate in Detach mode when processing Key files. The --revit_version argument is optional here---if information technology is omitted then RBP will use the version of Revit that each Revit file was saved in.

To see assist on all available command-line options use --help:

              %LOCALAPPDATA%\RevitBatchProcessor\BatchRvt.exe --help                          
              Help:  	Usage (using a settings file):  		BatchRvt.exe --settings_file <SETTINGS FILE PATH> [--log_folder <LOG FOLDER PATH>]  	Example:  		BatchRvt.exe --settings_file BatchRvt.Settings.json --log_folder .   	Usage (without a settings file):  		BatchRvt.exe --file_list <REVIT FILE LIST PATH> --task_script <TASK SCRIPT FILE PATH>  	(Note: this style operates in batch mode merely; by default operates in detach mode for primal files.)   	Additional command-line options:  		--revit_version <REVIT VERSION>  		--log_folder <LOG Folder PATH>  		--detach | --create_new_local  		--worksets <open_all | close_all>  		--audit  		--help   	Examples:  		BatchRvt.exe --task_script MyDynamoWorkspace.dyn --file_list RevitFileList.xlsx  		BatchRvt.exe --task_script MyDynamoWorkspace.dyn --file_list RevitFileList.xlsx --detach --audit  		BatchRvt.exe --task_script MyTask.py --file_list RevitFileList.txt --create_new_local --worksets open_all  		BatchRvt.exe --task_script MyTask.py --file_list RevitFileList.xlsx --revit_version 2019 --disassemble --worksets close_all                          

Contribute

Feedback and suggestions for improvement are more welcome! Delight track and submit bugs via the Github Bug folio. If y'all're feeling particularly adventurous you lot may even submit your ain code via a Github pull request.

https://github.com/bvn-compages/RevitBatchProcessor

Known Limitations / Bug

  • At that place MUST Be EXACTLY I VERSION OF DYNAMO INSTALLED for each version of Revit. If two or more versions of Dynamo are installed for the same Revit version and so the Revit Batch Processor fails to run the Dynamo task script considering the required Dynamo Revit module is not loaded. This may be fixed in a futurity version.
  • Dynamo scripts will always be executed using the 'Utilise separate Revit session for each Revit file' option. This restriction is due to the context in which Revit Batch Processor operates with the Revit API, which prevents the agile UI document from being closed or switched during the Revit session. (NOTE: When executing a Dynamo chore script, the Revit Batch Processor opens the document in the UI and is therefore subject to this Revit API limitation. For Python chore scripts, the Revit Batch Processor only opens the document in memory, so Python scripts do not suffer this restriction!)
  • Revit Batch Processor currently only recognizes and automatically handles Revit dialog boxes presented in English (dialog title, text and button text). If yous're using a non-English version of Windows or Revit and then it's very likely RBP will fail to handle any dialog boxes that appear during processing.
  • Revit Batch Processor requires write access to the folder containing the Dynamo script. This because information technology makes a temporary copy of the Dynamo script in the same binder as the original. The temporary copy is made so that the script's Run style tin be temporarily set to 'Automatic' (if information technology isn't already). It is created in the aforementioned binder every bit the original and so that any relative paths in the script will remain valid.

lynchlabould.blogspot.com

Source: https://github.com/bvn-architecture/RevitBatchProcessor

0 Response to "Revit Batch Add List of Parameter to Family"

Post a Comment

Iklan Atas Artikel

Iklan Tengah Artikel 1

Iklan Tengah Artikel 2

Iklan Bawah Artikel