AddRule Method (RoutingPreferenceRuleGroupType, RoutingPreferenceRule)


Adds a new routing preference rule to the rule group.

Namespace: Autodesk.Revit.DB
Assembly: RevitAPI (in RevitAPI.dll) Version: 24.0.0.0 (24.0.0.0)
Since:  2013

Syntax

C#
public void AddRule(
	RoutingPreferenceRuleGroupType groupType,
	RoutingPreferenceRule rule
)
Visual Basic
Public Sub AddRule ( _
	groupType As RoutingPreferenceRuleGroupType, _
	rule As RoutingPreferenceRule _
)
Visual C++
public:
void AddRule(
	RoutingPreferenceRuleGroupType groupType, 
	RoutingPreferenceRule^ rule
)

Parameters

groupType
Type: Autodesk.Revit.DBRoutingPreferenceRuleGroupType
The routing preference group in which the rule should be added.
rule
Type: Autodesk.Revit.DBRoutingPreferenceRule
The new rule to be added.

Exceptions

ExceptionCondition
Autodesk.Revit.ExceptionsArgumentException The rule cannot be added to the groupType. -or- Thrown if the index is out of bounds, or the rule is not valid for this group (e.g. an elbow may not be added to the junction group).
Autodesk.Revit.ExceptionsArgumentNullException A non-optional argument was null
Autodesk.Revit.ExceptionsArgumentOutOfRangeException A value passed for an enumeration argument is not a member of that enumeration
Autodesk.Revit.ExceptionsDisabledDisciplineException None of the following disciplines is enabled: Mechanical Electrical Piping.

See Also

ArchiLabs Desktop

Put AI to work inside Revit.

Give Desktop your instructions and project files to build Revit families, update model elements, and create views and schedules. Works directly in Revit and AutoCAD.

Explore Desktop →