Follow

Automated Publish Utility for Revit

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

  1. 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.
  2. Open Command Prompt and type the following command: assemble publish "c:\YOUR MODEL FOLDER LOCATION" -s “http://demo.tryassemble.com/” -e “name@assemblesystems.com
  3. 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.
  4. 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.

Batch.JPG

Required Variables

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”

Optional Variables

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.

Project Name

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.

Model Name

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.

Version Name

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.

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:

      Models:

Some_Model_XYZ_Rev0.5.rvt

Some_Model_XYZ_Rev0.8.rvt

Some_Model_ABC_Rev1.rvt

Regular Expression (JSON):

{

 "modelNameExpression": "((?<name>.+)_rev(?<version>.+)\\.rvt)|((?<name>.+)\\.rvt)"

}

Results:

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 support@assemblesystems.com.

Was this article helpful?
0 out of 0 found this helpful
Have more questions? Submit a request

0 Comments

Please sign in to leave a comment.
Powered by Zendesk