Revit 2025.3 API
Routing |
Adds a new routing preference rule to the specified position in the rule group.
Namespace: Autodesk.Revit.DB
Assembly: RevitAPI (in RevitAPI.dll) Version: 25.3.0.0 (25.3.0.0)
Syntax
public void AddRule( RoutingPreferenceRuleGroupType groupType, RoutingPreferenceRule rule, int index )
Public Sub AddRule ( groupType As RoutingPreferenceRuleGroupType, rule As RoutingPreferenceRule, index As Integer )
public: void AddRule( RoutingPreferenceRuleGroupType groupType, RoutingPreferenceRule^ rule, int index )
member AddRule : groupType : RoutingPreferenceRuleGroupType * rule : RoutingPreferenceRule * index : int -> unit
Parameters
- groupType RoutingPreferenceRuleGroupType
- The routing preference group type in which the rule should be added.
- rule RoutingPreferenceRule
- The new rule to be added.
- index Int32
- The zero-based index position where the new rule will be added.
| Exception | Condition |
|---|---|
| ArgumentException | index is not a valid zero-based index within groupType. -or- 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). |
| ArgumentNullException | A non-optional argument was null |
| ArgumentOutOfRangeException | A value passed for an enumeration argument is not a member of that enumeration |
See Also