Sample Code Revit Batch Processor 1.1.11 documentation

Contents:

This Page

duHast.Revit.Warnings.Utility package

Submodules

duHast.Revit.Warnings.Utility.curves_util module

duHast.Revit.Warnings.Utility.curves_util.get_curves_from_failure_messages(doc, failure_messages, group_id)

Loops over failure messages and extracts separation lines listed. There are always two curves per exception, even if one curve overlaps a number of other curves.

Parameters:
  • doc (Autodesk.Revit.DB.Document) – The current model document.

  • failure_messages ([Autodesk.Revit.DB.FailureMessage]) – List of failure messages relating to separation lines overlap

  • group_id (int) – group id curves need to belong to for processing (-1 not in a group)

Returns:

List of RevitWarningOverlap instances.

Return type:

[RevitWarningOverlap]

duHast.Revit.Warnings.Utility.curves_util.check_curves_overlaps(curves, group_id)

Check a list of curve sets for overlaps or duplicates.

Parameters:
  • curves ([:class: RevitWarningOverlap]) – A list of curve sets, where each set contains two curves.

  • group_id (int) – group id curves need to belong to for processing (-1 not in a group)

Returns:

list: A list of curves that can be deleted because they are either completely within another curve or identical to another curve.

Raises:

ValueError: If a curve set does not have a length of 2.

Example:

curves = [[curve1, curve2], [curve3, curve4], …] result = check_curves_overlaps(curves) print(result)

duHast.Revit.Warnings.Utility.curves_util.delete_curves(doc, curves_to_delete, curve_descriptor)

Deletes curves in a Revit model.

Parameters:
  • doc ((Autodesk.Revit.DB.Document)) – The Revit model document.

  • curves_to_delete ([:class: RevitWarningOverlap]) – List of curves to be deleted.

  • curve_descriptor (str) – line type descriptor

Returns:

res.Result: A res.Result object that contains the status of the deletion operation.

duHast.Revit.Warnings.Utility.curves_util.modify_curves_by_lengthening(doc, guid, transaction_manager, group_id, callback)

Modifies curves in a Revit model by lengthening them.

Parameters:
  • doc ((Autodesk.Revit.DB.Document)) – The Revit model document.

  • guid ((Autodesk.Revit.DB.Guid):) – The GUID used to filter the failure messages.

  • transaction_manager ((function)) – The transaction manager used to perform the modifications.

  • group_id (int) – group id curves need to belong to for processing (-1 not in a group)

  • callback (func (value, maximum_value)) – function reporting progress update.

Returns:

res.Result: A res.Result object that contains the status of the modifications performed.

duHast.Revit.Warnings.Utility.curves_util.modify_curves_by_shortening(doc, guid, transaction_manager, group_id, callback)

Modifies curves in a Revit model by lengthening them.

Parameters:
  • doc ((Autodesk.Revit.DB.Document)) – The Revit model document.

  • guid ((Autodesk.Revit.DB.Guid):) – The GUID used to filter the failure messages.

  • transaction_manager ((function)) – The transaction manager used to perform the modifications.

Returns:

res.Result: A res.Result object that contains the status of the modifications performed.

Module contents