pyrevit.revit.units

Unit conversion utilities for Revit.

pyrevit.revit.units.format_area(area_value, doc=None)

Return formatted area value in document units.

Parameters:
  • area_value (float) – area value
  • doc (DB.Document, optional) – Revit document, defaults to current
Returns:

formatted value

Return type:

str

pyrevit.revit.units.project_to_viewport(xyz, view)

Project a point to viewport coordinates

Parameters:
  • xyz (DB.XYZ) – point to project
  • view (DB.View) – target view
Returns:

[description]

Return type:

DB.UV

pyrevit.revit.units.project_to_world(uv, view)

Get view-based point (UV) back to model coordinates.

Parameters:
  • uv (DB.UV) – point on a view
  • view (DB.View) – view to get coordinates from
Returns:

point in world coordinates

Return type:

DB.XYZ