Current Situation: When working in the Revit Family Editor, geometric constraints (alignments, locks, etc.) between family elements are managed internally by Revit's constraint solver. These constraints are only visible to users when:
Problem: There is currently no way to programmatically query these constraint relationships through the Revit API. The constraint information shown in warning dialogs (see attached screenshot) is not accessible via FilteredElementCollector, GetDependentElements(), or any other API method.
Use Case: Family authors need to audit and document constraint relationships in complex families without manually breaking each constraint. Current workflow requires:
This is time-consuming and error-prone for families with dozens or hundreds of constrained elements.
Requested API Enhancement: Expose family geometric constraints through the API, similar to how the warning dialog displays them. Suggested implementation:
# Proposed API usage element = doc.GetElement(elementId) constraints = element.GetGeometricConstraints() for constraint in constraints: constraint.ConstraintType # e.g., "Alignment", "Lock", "Equality" constraint.ConstrainedElements # List of ElementIds involved constraint.References # Reference planes or faces involved
Expected Benefits:
Reference: This information is already computed and displayed by Revit (as shown in constraint violation warnings), but is not currently exposed through the API.
Can't find what you're looking for? Ask the community or share your knowledge.