RevitPythonWrapper

A Python Wrapper For the Revit API

Revit Python Wrapper was created to help Python programmers write Revit API code. Wrapper classes make the interaction with API objects less repetitive, and more consistent with Python’s conventions.

Star

Media

project-logo

Usage

from rpw import revit, db, ui, DB, UI

# Collector Wrapper
doors = db.Collector(of_category='Doors')

# Transaction Wrapper
with db.Transaction('Delete'):
    [revit.doc.Delete(door.id) for door in doors]

# Curves
line = Line.new([-10,0], [10,0])
line.create_detail()

# Parameter Wrapper
wall = db.Element(SomeElementId)
# wall = <rpw: WallInstance % DB.Wall >
wall.parameters['Height']
# 10.0
>>> wall.parameters.builtins['WALL_LOCATION_LINE']
# 1
comments powered by Disqus