With Assemble’s automated publish utility for Revit, users are able to publish a group of models, without direct Revit interaction, using Windows command line interface. This saves time when publishing a number of model on a routine basis. With this utility, you can set up a routine script or batch file to run against a set of projects, models, or model versions.
Note: We do our best to dismiss the various Revit dialogs that may be specific to each model being opened. If we are not able to resolve all opening dialogs, the model will be skipped and the process will move to the next model.
To publish your set of Revit models
- The automated publish utility uses the containing folder as the Project name. Organize models into folders with the project names. Sub-folders will be included in the publish process.
- Open Command Prompt and type the following command: assemble publish "c:\YOUR MODEL FOLDER LOCATION" -s “http://demo.tryassemble.com/” -e “firstname.lastname@example.org”
- After this command, you will be prompted to enter your password. Once you enter your password, the command will launch Revit and publish each model within the selected folder, including any models contained within subfolders.
- Additional options include the ability to ignore links (--ignore-links) and configure the model name and version name (-c "c:\CONFIG FILE PATH\filename.json").
Note: When running this command, the publisher will step through each Revit file, open the appropriate version (Revit 2014-2017 supported). If you do not have the associated version of Revit installed, the model will be skipped. If links are not ignored, the process will find the model which contains the most links and begin there.
Publish Directory: “C:\Users\Admin\Documents\BatchPubFolder” Provide the directory path, within quotes. Any Revit files within directory will be processed.
Site Name: -s or --site “https://demo.tryassemble.com” Provide your sitename in quotes preceded by “-s” or “--site”
User Email: -e or --email “admin.assemblesystems.com” Provide your email in quotes preceded by “-e” or “--email”
Ignore Links: -i or --ignore-links
Publish Sheets: -a or --all-sheets
Configure Model and Version Naming: -c “C:\Users\Admin\Documents\ModelNameConfig.json” Provide file path to JSON config file. See Configuration File below.
To allow for Flexibility, the project name will be generated by the containing folder name. This means that if you have the ability to publish models for multiple projects within the same batch process. If you specify a folder that contains three subfolders (Project A, Project B, and Project C) each containing Revit models, you will be publishing to Project A, Project B, and Project C within Assemble. If the project does not exist within Assemble, a new project will be created.
By default, the model name will be the same as the Revit filename. If the model exists within the selected project, a new version will be created. If not, a new model is created. If you specify a configuration file, you can use a substring of the filename. See Configuration File below. An example would be to split “Architecture_revision5.rvt” into model name “Architecture” as defined in the configuration file.
Note: Be careful if your typical model name includes the version or date within the filename. Without using a configuration file, this will result in a new model for each version and you will not be able to compare versions within Assemble under this situation.
By default, the version name will be the timestamp generated when the publish begins. If you specify configuration file, you can use a substring of the filename. In the same example as above, “Architecture_revision5.rvt” can result in the version name “revision5” as defined in the configuration file.
We are currently using a regular expression (or regex) stored in a JSON file to allow you to parse a model name and version name from the Revit. Below is an example of using a regular expression to parse the Revit filename for the model and version:
Regular Expression (JSON):
Model: Some_Model_XYZ Version: 0.5 and 0.8
Model: Some_Model_ABC Version: 1
In this situation, “modelNameExpression” is the Revit filename and (?<name>.+) is taking the text prior to “_rev” and (?<version>.+) is taking the text after “_rev” and before .rvt. The second (?<name>.+) after the bar (|) is in the situation that “_rev” is not included in the filename, it will take all text prior to “.rvt” as the model name. To create your own, you can copy this text into a text editor and specify the delimiting text where you see “_rev” and save the file as “YourFileName.json”
If additional customization assistance is required, please contact email@example.com.