https://github.com/pyrevitlabs/rsparam
Command-line utility for managing Revit Shared Parameter files
https://github.com/pyrevitlabs/rsparam
autodesk revit revit-api
Last synced: 9 months ago
JSON representation
Command-line utility for managing Revit Shared Parameter files
- Host: GitHub
- URL: https://github.com/pyrevitlabs/rsparam
- Owner: pyrevitlabs
- License: mit
- Created: 2018-03-01T17:15:09.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2025-06-17T10:54:03.000Z (12 months ago)
- Last Synced: 2025-06-17T11:47:29.272Z (12 months ago)
- Topics: autodesk, revit, revit-api
- Language: Python
- Homepage:
- Size: 40 KB
- Stars: 14
- Watchers: 7
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[](https://pypi.org/project/rsparam)
# rsparam
Command-line utility and python module for managing Revit Shared Parameter files.
## Installation
``` bash
pip install rsparam
```
## Usage: Command line utility
``` text
Utilities for working with Revit shared parameter files
Usage:
rsparam (-h | --help)
rsparam (-V | --version)
rsparam (-W | --writerversion)
rsparam [-q -e ] list [-a -s -c -o ]
rsparam [-q -e ] list [-p -g -s -c -o ]
rsparam [-q -e ] list -p [-f -o ]
rsparam [-q -e ] find dupl [-n -a -p -g -s -c -o ]
rsparam [-q -e ] find [-p -g -s -c -o ]
rsparam [-q -e ] comp [-p -g -1 -2 -s -c -O]
rsparam [-q -e ] merge [-o ] ...
rsparam [-q -e ] subtract [-o ] ...
Options:
-h, --help Show this help
-V, --version Show command version
-W, --writerversion Show shared param file version
-q, --quiet Quiet mode [default: False]
-e , --encode File encoding [default: utf-8]
-a, --all All items
-p, --params Parameters only
-g, --groups Parameter groups only
-s , --sortby Sort by "name", "group" [default: name]
-c , --columns List of data columns separated by :
-f , --filter Filter by group guid
-o , --output Write results to output file
-O, --OUTPUT Write complex results to output file(s)
-n, --byname Compare by name instead of guid
-1, --first Output results for first file only
-2, --second Output results for second file only
```
#### Examples
`rsparam list -p /path/to/file.txt` List all parameters in source file
`rsparam list -g /path/to/file.txt` List all groups in source file
`rsparam list -pf 100 /path/to/file.txt` List all parameters in group with id 100
`rsparam find dupl -p /path/to/file.txt` List all duplicate parameters
`rsparam find dupl -pn /path/to/file.txt` List all duplicate parameters compared by name
`rsparam find Mech -g /path/to/file.txt` List any group matching string
`rsparam comp -p2 /path/to/file1.txt /path/to/file2.txt` List all unique parameters in second file
`rsparam subtract /path/to/file1.txt /path/to/file2.txt` Remove parameters in file2 from file1
## Usage: python module
``` python
import rsparam
# returned entries are a tuple of `groups` and `params`
# rsparam.SharedParamEntries
def print_entries(entries):
for g in entries.groups:
# each group is rsparam.SharedParamGroup
print(g)
for p in entries.params:
# each parameter is rsparam.SharedParam
print (p)
# getting groups and parameters
spentries = rsparam.read_entries(src_file, encoding='utf-16')
print_entries(spentries)
# getting groups only
groups = rsparam.get_paramgroups(src_file)
# getting parameters only
params = rsparam.get_params(src_file)
# finding duplicate groups and params by guid (set byname=True to compare by name)
dupl_entries = rsparam.find_duplicates(src_file, byname=False)
print_entries(dupl_entries)
# find groups and parameters matching string
matched_entries = rsparam.find(src_file, searchstr)
print_entries(matched_entries)
# comparing two shared param files
uniq_first_entries, unique_second_entries = rsparam.compare(first_file, second_file)
print_entries(uniq_first_entries)
print_entries(unique_second_entries)
```