
# IPCB_Rule interface

A design rule on a PCB document; the base interface of the PCB design rule and constraint interfaces.

```csharp
public interface IPCB_Rule : IPCB_Primitive
```

**Namespace:** PCB · **Assembly:** Altium.SDK.Interfaces

**Inherits:** [IPCB_Primitive](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md)

**Derived:** [IPCB_AcuteAngle](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_AcuteAngle.md), [IPCB_BoardOutlineClearanceConstraint](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_BoardOutlineClearanceConstraint.md), [IPCB_BrokenNetRule](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_BrokenNetRule.md), [IPCB_CheckNetAntennaeRule](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_CheckNetAntennaeRule.md), [IPCB_ClearanceConstraint](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_ClearanceConstraint.md), [IPCB_ComponentClearanceConstraint](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_ComponentClearanceConstraint.md), [IPCB_ComponentRotationsRule](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_ComponentRotationsRule.md), [IPCB_ConfinementConstraint](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_ConfinementConstraint.md), [IPCB_DaisyChainStubLengthConstraint](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_DaisyChainStubLengthConstraint.md), [IPCB_DifferentialPairsRoutingRule](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_DifferentialPairsRoutingRule.md), [IPCB_FanoutControlRule](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_FanoutControlRule.md), [IPCB_HoleToHoleClearanceRule](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_HoleToHoleClearanceRule.md), [IPCB_LayerPairsRule](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_LayerPairsRule.md), [IPCB_MatchedNetLengthsConstraint](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_MatchedNetLengthsConstraint.md), [IPCB_MaxMinHeightConstraint](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_MaxMinHeightConstraint.md), [IPCB_MaxMinHoleSizeConstraint](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_MaxMinHoleSizeConstraint.md), [IPCB_MaxMinLengthConstraint](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_MaxMinLengthConstraint.md), [IPCB_MaxMinWidthConstraint](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_MaxMinWidthConstraint.md), [IPCB_MaxOvershootFall](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_MaxOvershootFall.md), [IPCB_MaxOvershootRise](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_MaxOvershootRise.md), [IPCB_MaxUndershootFall](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_MaxUndershootFall.md), [IPCB_MaxUndershootRise](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_MaxUndershootRise.md), [IPCB_MaximumViaCountRule](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_MaximumViaCountRule.md), [IPCB_MinimumAnnularRing](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_MinimumAnnularRing.md), [IPCB_MinimumSolderMaskSliverRule](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_MinimumSolderMaskSliverRule.md), [IPCB_ModifiedPolygonRule](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_ModifiedPolygonRule.md), [IPCB_NetsToIgnoreRule](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_NetsToIgnoreRule.md), [IPCB_ParallelSegmentConstraint](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_ParallelSegmentConstraint.md), [IPCB_PasteMaskExpansionRule](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_PasteMaskExpansionRule.md), [IPCB_PermittedLayersRule](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_PermittedLayersRule.md), [IPCB_PolygonConnectStyleRule](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_PolygonConnectStyleRule.md), [IPCB_PowerPlaneClearanceRule](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_PowerPlaneClearanceRule.md), [IPCB_PowerPlaneConnectStyleRule](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_PowerPlaneConnectStyleRule.md), [IPCB_RoutingCornerStyleRule](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_RoutingCornerStyleRule.md), [IPCB_RoutingLayersRule](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_RoutingLayersRule.md), [IPCB_RoutingPriorityRule](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_RoutingPriorityRule.md), [IPCB_RoutingTopologyRule](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_RoutingTopologyRule.md), [IPCB_RoutingViaStyleRule](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_RoutingViaStyleRule.md), [IPCB_RuleFlightTime_FallingEdge](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_RuleFlightTime_FallingEdge.md), [IPCB_RuleFlightTime_RisingEdge](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_RuleFlightTime_RisingEdge.md), [IPCB_RuleMaxMinImpedance](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_RuleMaxMinImpedance.md), [IPCB_RuleMaxSignalBaseValue](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_RuleMaxSignalBaseValue.md), [IPCB_RuleMaxSlopeFallingEdge](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_RuleMaxSlopeFallingEdge.md), [IPCB_RuleMaxSlopeRisingEdge](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_RuleMaxSlopeRisingEdge.md), [IPCB_RuleMinSignalTopValue](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_RuleMinSignalTopValue.md), [IPCB_RuleSupplyNets](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_RuleSupplyNets.md), [IPCB_SMDNeckDownConstraint](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_SMDNeckDownConstraint.md), [IPCB_SMDPADEntryConstraint](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_SMDPADEntryConstraint.md), [IPCB_SMDToCornerConstraint](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_SMDToCornerConstraint.md), [IPCB_SMDToPlaneConstraint](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_SMDToPlaneConstraint.md), [IPCB_ShortCircuitConstraint](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_ShortCircuitConstraint.md), [IPCB_SignalStimulus](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_SignalStimulus.md), [IPCB_SilkToSilkClearanceRule](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_SilkToSilkClearanceRule.md), [IPCB_SilkToSolderMaskClearanceRule](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_SilkToSolderMaskClearanceRule.md), [IPCB_SolderMaskExpansionRule](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_SolderMaskExpansionRule.md), [IPCB_TestPointStyleRule](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_TestPointStyleRule.md), [IPCB_TestPointUsage](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_TestPointUsage.md), [IPCB_UnConnectedPinRule](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_UnConnectedPinRule.md), [IPCB_ViasUnderSMDConstraint](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_ViasUnderSMDConstraint.md)

## Remarks

Design rules cover clearances, object geometry, impedance control, routing priority, routing topology and parallelism, among others.

The scope of a rule is the set of objects that the rule applies to. It is defined by one scope expression for a rule that applies to single objects, or by two scope expressions for a rule that applies to pairs of objects.

A rule is a PCB object: its [`ObjectID`](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#objectid) is `TObjectId.eRuleObject`, so the rules of a board are found by iterating the board with an object filter for `TObjectId.eRuleObject`. A new rule is created with [`IPCB_ServerInterface.PCBRuleFactory`](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_ServerInterface.md#pcbrulefactory) for a [`TRuleKind`](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/TRuleKind.md) and added to the board with [`IPCB_Board.AddPCBObject`](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Board.md#addpcbobject).

This interface has what all rules share: name, comment, kind, scope and whether the rule is checked. The constraint values are on the interface of the rule kind, for example [`IPCB_ClearanceConstraint`](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_ClearanceConstraint.md) or [`IPCB_MaxMinHoleSizeConstraint`](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_MaxMinHoleSizeConstraint.md); cast the rule to that interface to read or change them.

## Properties

| Property | Type | Access | Description |
| --- | --- | --- | --- |
| [CollisionExpansion](#collisionexpansion) | `int` | get | The rule's collision expansion distance, in internal units (10,000 per mil). |
| [Comment](#comment) | `string` | get; set | A free-text comment on the rule. |
| [DataSummaryString](#datasummarystring) | `string` | get | A short text that lists the rule's constraint values. |
| [DefinedByLogicalDocument](#definedbylogicaldocument) | `bool` | get; set | Whether the rule comes from the rule definitions of the design's logical (schematic) documents. |
| [DRCEnabled](#drcenabled) | `bool` | get; set | Whether the rule is checked by design rule checking. |
| [LayerKind](#layerkind) | [TRuleLayerKind](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/TRuleLayerKind.md) | get; set | Whether the rule tests objects on the same layer or on adjacent layers. |
| [Name](#name) | `string` | get; set | The name of the rule. |
| [NetScope](#netscope) | [TNetScope](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/TNetScope.md) | get; set | Which net relationship a pair of objects must have for the rule to apply to them. |
| [RuleKind](#rulekind) | [TRuleKind](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/TRuleKind.md) | get; set | The kind of design rule, for example `TRuleKind.eRule_Clearance`. |
| [Scope1Expression](#scope1expression) | `string` | get; set | The query expression that selects the objects of the rule's first scope, for example `All`. |
| [Scope2Expression](#scope2expression) | `string` | get; set | The query expression that selects the objects of the rule's second scope, for rule kinds that apply to pairs of objects. |
| [ScopeDescriptorString](#scopedescriptorstring) | `string` | get | A text that shows the rule's scope expressions. |
| [ShortDescriptorString](#shortdescriptorstring) | `string` | get | The display name of the rule kind, for example `Clearance Constraint` for a clearance rule. |
| [ViolationDescriptorString](#violationdescriptorstring) | `string` | get | A text that describes the given violation of this rule. |

### CollisionExpansion

The rule's collision expansion distance, in internal units (10,000 per mil).

```csharp
int GetState_CollisionExpansion();
```

**Type:** `int` · **Access:** read-only

It is 0 for rule kinds that do not define one. For a clearance rule it is the gap, or the largest clearance of the rule when it defines clearances per object kind.

### Comment

A free-text comment on the rule.

```csharp
string GetState_Comment();
void SetState_Comment(string argValue);
```

**Type:** `string` · **Access:** read/write

A new rule has an empty comment.

### DataSummaryString

A short text that lists the rule's constraint values.

```csharp
string GetState_DataSummaryString();
```

**Type:** `string` · **Access:** read-only

The text depends on the rule kind: for example, a width rule lists its preferred, minimum and maximum width, and a short-circuit rule states whether short circuits are allowed. Sizes are shown in the board's display unit ([`IPCB_Board.DisplayUnit`](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Board.md#displayunit)).

### DefinedByLogicalDocument

Whether the rule comes from the rule definitions of the design's logical (schematic) documents.

```csharp
bool GetState_DefinedByLogicalDocument();
void SetState_DefinedByLogicalDocument(bool argValue);
```

**Type:** `bool` · **Access:** read/write

It is set to true when an engineering change order from the design project adds or updates the rule on the board. The default is false.

### DRCEnabled

Whether the rule is checked by design rule checking.

```csharp
bool GetState_DRCEnabled();
void SetState_DRCEnabled(bool argValue);
```

**Type:** `bool` · **Access:** read/write

A new rule is enabled. The value reads false when the rule belongs to a rule set that is disabled, even if the rule itself is enabled; assigning a value enables or disables the rule itself. While the value is false, [`Scope1Includes`](#scope1includes), [`Scope2Includes`](#scope2includes), [`CheckUnaryScope`](#checkunaryscope) and [`CheckBinaryScope`](#checkbinaryscope) return false.

### LayerKind

Whether the rule tests objects on the same layer or on adjacent layers.

```csharp
TRuleLayerKind GetState_LayerKind();
void SetState_LayerKind(TRuleLayerKind argValue);
```

**Type:** [TRuleLayerKind](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/TRuleLayerKind.md) · **Access:** read/write

The accessors are extension methods of `IPCB_RuleHelper` (`using PCB;`).

Used by the parallel segment rule (`TRuleKind.eRule_ParallelSegment`). The default is `TRuleLayerKind.eRuleLayerKind_SameLayer`.

### Name

The name of the rule.

```csharp
string GetState_Name();
void SetState_Name(string argValue);
```

**Type:** `string` · **Access:** read/write

When the rule is added to a board, an empty name is replaced by a name derived from the rule kind (for example `Clearance`), and a name that another rule of the board already has gets a numeric suffix such as `_1`.

### NetScope

Which net relationship a pair of objects must have for the rule to apply to them.

```csharp
TNetScope GetState_NetScope();
void SetState_NetScope(TNetScope argValue);
```

**Type:** [TNetScope](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/TNetScope.md) · **Access:** read/write

The accessors are extension methods of `IPCB_RuleHelper` (`using PCB;`).

[`NetScopeMatches`](#netscopematches) tests a pair of objects against it. The default is `TNetScope.eNetScope_AnyNet`; a clearance rule starts with `TNetScope.eNetScope_DifferentNetsOnly`.

### RuleKind

The kind of design rule, for example `TRuleKind.eRule_Clearance`.

```csharp
TRuleKind GetState_RuleKind();
void SetState_RuleKind(TRuleKind argValue);
```

**Type:** [TRuleKind](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/TRuleKind.md) · **Access:** read/write

The accessors are extension methods of `IPCB_RuleHelper` (`using PCB;`).

### Scope1Expression

The query expression that selects the objects of the rule's first scope, for example `All`.

```csharp
string GetState_Scope1Expression();
void SetState_Scope1Expression(string argValue);
```

**Type:** `string` · **Access:** read/write

Leading and trailing spaces are removed from an assigned value. Assigning a value that differs from the current one only in letter case leaves the expression unchanged.

### Scope2Expression

The query expression that selects the objects of the rule's second scope, for rule kinds that apply to pairs of objects.

```csharp
string GetState_Scope2Expression();
void SetState_Scope2Expression(string argValue);
```

**Type:** `string` · **Access:** read/write

Leading and trailing spaces are removed from an assigned value. Assigning a value that differs from the current one only in letter case leaves the expression unchanged.

### ScopeDescriptorString

A text that shows the rule's scope expressions.

```csharp
string GetState_ScopeDescriptorString();
```

**Type:** `string` · **Access:** read-only

The form is `(<Scope1Expression>),(<Scope2Expression>)` for rule kinds that apply to pairs of objects and `(<Scope1Expression>)` for the others. It starts with `(Disabled)` when [`DRCEnabled`](#drcenabled) is false.

### ShortDescriptorString

The display name of the rule kind, for example `Clearance Constraint` for a clearance rule.

```csharp
string GetState_ShortDescriptorString();
```

**Type:** `string` · **Access:** read-only

### ViolationDescriptorString

A text that describes the given violation of this rule.

```csharp
string GetState_ViolationDescriptorString(IPCB_Violation argV);
```

**Type:** `string` · **Access:** read-only · **Index:** `argV` ([IPCB_Violation](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Violation.md)): The violation to describe.

The accessors are extension methods of `IPCB_RuleHelper` (`using PCB;`).

Returns an empty string for a null violation.

## Methods

| Method | Returns | Description |
| --- | --- | --- |
| [ActualCheck](#actualcheck) | [IPCB_Violation](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Violation.md) | Checks the given object, or pair of objects, against the rule and returns the first violation found. |
| [ActualCheck_1](#actualcheck_1) | `bool` | Checks a pair of objects against the rule and adds every violation found to a list. |
| [CheckBinaryScope](#checkbinaryscope) | `bool` | Returns whether a pair of objects is in the rule's scope, in either order. |
| [CheckUnaryScope](#checkunaryscope) | `bool` | Returns whether the given object is in the scope of a rule that applies to single objects. |
| [Export_ToParameters_1](#export_toparameters_1) | `void` | Writes the rule's properties to a parameter string. |
| [GetWhatsThisHelpString](#getwhatsthishelpstring) | `string` | Returns the help topic identifier of the rule kind, for example `PCB_ClearanceRule_` for a clearance rule. |
| [IsUnary](#isunary) | `bool` | Returns whether the rule kind applies to single objects rather than to pairs of objects. |
| [NetScopeMatches](#netscopematches) | `bool` | Returns whether a pair of objects has the net relationship that the rule's [`NetScope`](#netscope) requires. |
| [Priority](#priority) | `ushort` | Returns the rule's position in the board's priority order for rules of the same [`RuleKind`](#rulekind), starting at 1. |
| [Scope1Includes](#scope1includes) | `bool` | Returns whether the given object is in the rule's first scope ([`Scope1Expression`](#scope1expression)). |
| [Scope2Includes](#scope2includes) | `bool` | Returns whether the given object is in the rule's second scope ([`Scope2Expression`](#scope2expression)). |
| [ScopeKindIsValid](#scopekindisvalid) | `bool` | Returns whether the given scope kind can be used in the rule's scope. |

### ActualCheck

Checks the given object, or pair of objects, against the rule and returns the first violation found.

```csharp
IPCB_Violation ActualCheck(IPCB_Primitive argP1, IPCB_Primitive argP2);
```

| Parameter | Type | Passing | Description |
| --- | --- | --- | --- |
| `argP1` | [IPCB_Primitive](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md) | value | The object to check, or the first object of the pair. |
| `argP2` | [IPCB_Primitive](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md) | value | The second object of the pair; null for a rule kind that applies to single objects ([`IsUnary`](#isunary) is true). |

**Returns:** [IPCB_Violation](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Violation.md)

Extension method of `IPCB_RuleHelper` (`using PCB;`).

Returns null when no violation is found.

### ActualCheck_1

Checks a pair of objects against the rule and adds every violation found to a list.

```csharp
bool ActualCheck_1(IPCB_Primitive argP1, IPCB_Primitive argP2, IInterfaceList argViolations);
bool ActualCheck_1(object argP1, object argP2, object argViolations);
```

| Parameter | Type | Passing | Description |
| --- | --- | --- | --- |
| `argP1` | [IPCB_Primitive](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md) | value | The first object of the pair. |
| `argP2` | [IPCB_Primitive](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md) | value | The second object of the pair. |
| `argViolations` | [IInterfaceList](https://altiumdeveloper.github.io/ad-sdk-docs/reference/dxp/IInterfaceList.md) | value | The list that receives the violations found ([`IPCB_Violation`](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Violation.md) objects). |

**Returns:** `bool`

The first overload is an extension method of `IPCB_RuleHelper` (`using PCB;`) with typed parameters; the second is declared by the interface.

Returns false without checking when one of the arguments is null; otherwise returns true, whether or not violations were found.

### CheckBinaryScope

Returns whether a pair of objects is in the rule's scope, in either order.

```csharp
bool CheckBinaryScope(IPCB_Primitive argP1, IPCB_Primitive argP2);
bool CheckBinaryScope(object argP1, object argP2);
```

| Parameter | Type | Passing |
| --- | --- | --- |
| `argP1` | [IPCB_Primitive](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md) | value |
| `argP2` | [IPCB_Primitive](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md) | value |

**Returns:** `bool`

The first overload is an extension method of `IPCB_RuleHelper` (`using PCB;`) with typed parameters; the second is declared by the interface.

Returns true when one object is in the first scope ([`Scope1Includes`](#scope1includes)) and the other in the second scope ([`Scope2Includes`](#scope2includes)). Returns false when the rule is not enabled for checking ([`DRCEnabled`](#drcenabled) is false).

### CheckUnaryScope

Returns whether the given object is in the scope of a rule that applies to single objects.

```csharp
bool CheckUnaryScope(IPCB_Primitive argP);
bool CheckUnaryScope(object argP);
```

| Parameter | Type | Passing |
| --- | --- | --- |
| `argP` | [IPCB_Primitive](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md) | value |

**Returns:** `bool`

The first overload is an extension method of `IPCB_RuleHelper` (`using PCB;`) with typed parameters; the second is declared by the interface.

Returns true when the rule is enabled for checking ([`DRCEnabled`](#drcenabled)) and the object matches [`Scope1Expression`](#scope1expression). Returns false when the expression cannot be evaluated.

### Export_ToParameters_1

Writes the rule's properties to a parameter string.

```csharp
void Export_ToParameters_1(ref string argParams);
```

| Parameter | Type | Passing | Description |
| --- | --- | --- | --- |
| `argParams` | `string` | ref | The string that receives the parameters. |

**Returns:** nothing (`void`)

The previous content of the string is replaced. The parameters include `Description`, which has the form `<kind name> [<summary>]`, built from [`ShortDescriptorString`](#shortdescriptorstring) and [`DataSummaryString`](#datasummarystring).

### GetWhatsThisHelpString

Returns the help topic identifier of the rule kind, for example `PCB_ClearanceRule_` for a clearance rule.

```csharp
string GetWhatsThisHelpString();
```

**Returns:** `string`

Returns an empty string for a rule kind without a help topic.

### IsUnary

Returns whether the rule kind applies to single objects rather than to pairs of objects.

```csharp
bool IsUnary();
```

**Returns:** `bool`

### NetScopeMatches

Returns whether a pair of objects has the net relationship that the rule's [`NetScope`](#netscope) requires.

```csharp
bool NetScopeMatches(IPCB_Primitive argP1, IPCB_Primitive argP2);
bool NetScopeMatches(object argP1, object argP2);
```

| Parameter | Type | Passing |
| --- | --- | --- |
| `argP1` | [IPCB_Primitive](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md) | value |
| `argP2` | [IPCB_Primitive](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md) | value |

**Returns:** `bool`

The first overload is an extension method of `IPCB_RuleHelper` (`using PCB;`) with typed parameters; the second is declared by the interface.

Rule kinds that do not use a net scope return true for any pair.

### Priority

Returns the rule's position in the board's priority order for rules of the same [`RuleKind`](#rulekind), starting at 1.

```csharp
ushort Priority();
```

**Returns:** `ushort`

Returns 0 when the rule is not on a board.

### Scope1Includes

Returns whether the given object is in the rule's first scope ([`Scope1Expression`](#scope1expression)).

```csharp
bool Scope1Includes(IPCB_Primitive argP);
bool Scope1Includes(object argP);
```

| Parameter | Type | Passing |
| --- | --- | --- |
| `argP` | [IPCB_Primitive](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md) | value |

**Returns:** `bool`

The first overload is an extension method of `IPCB_RuleHelper` (`using PCB;`) with typed parameters; the second is declared by the interface.

Returns false when the rule is not enabled for checking ([`DRCEnabled`](#drcenabled) is false). The expression `All` includes every object.

### Scope2Includes

Returns whether the given object is in the rule's second scope ([`Scope2Expression`](#scope2expression)).

```csharp
bool Scope2Includes(IPCB_Primitive argP);
bool Scope2Includes(object argP);
```

| Parameter | Type | Passing |
| --- | --- | --- |
| `argP` | [IPCB_Primitive](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md) | value |

**Returns:** `bool`

The first overload is an extension method of `IPCB_RuleHelper` (`using PCB;`) with typed parameters; the second is declared by the interface.

Returns false when the rule is not enabled for checking ([`DRCEnabled`](#drcenabled) is false). The expression `All` includes every object.

### ScopeKindIsValid

Returns whether the given scope kind can be used in the rule's scope.

```csharp
bool ScopeKindIsValid(TScopeKind argScopeKind);
bool ScopeKindIsValid(int argScopeKind);
```

| Parameter | Type | Passing |
| --- | --- | --- |
| `argScopeKind` | [TScopeKind](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/TScopeKind.md) | value |

**Returns:** `bool`

The first overload is an extension method of `IPCB_RuleHelper` (`using PCB;`) with typed parameters; the second is declared by the interface.

The result depends on the rule kind. For example, a short-circuit rule accepts only board, net and net class scopes, and a confinement rule only footprint, component and component class scopes. Rule kinds that do not restrict the scope kinds return true for every value.

## Inherited members

- From [IPCB_Primitive](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md): [AllowGlobalEdit](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#allowglobaledit), [BeginModify](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#beginmodify), [Board](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#board), [BoundingRectangle](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#boundingrectangle), [BoundingRectangleChildren](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#boundingrectanglechildren), [BoundingRectangleForPainting](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#boundingrectangleforpainting), [BoundingRectangleForSelection](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#boundingrectangleforselection), [CancelModify](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#cancelmodify), [Component](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#component), [Coordinate](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#coordinate), [DescriptorString](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#descriptorstring), [DetailString](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#detailstring), [Dimension](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#dimension), [DrawAsPreview](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#drawaspreview), [DRCError](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#drcerror), [Enabled](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#enabled), [Enabled_Direct](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#enabled_direct), [Enabled_vComponent](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#enabled_vcomponent), [Enabled_vCoordinate](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#enabled_vcoordinate), [Enabled_vDimension](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#enabled_vdimension), [Enabled_vNet](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#enabled_vnet), [Enabled_vPolygon](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#enabled_vpolygon), [EnableDraw](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#enabledraw), [EndModify](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#endmodify), [Export_ToParameters](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#export_toparameters), [FlipXY](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#flipxy), [GraphicallyInvalidate](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#graphicallyinvalidate), [Handle](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#handle), [Identifier](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#identifier), [InBoard](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#inboard), [InComponent](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#incomponent), [InCoordinate](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#incoordinate), [Index](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#index), [InDimension](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#indimension), [InNet](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#innet), [InPolygon](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#inpolygon), [InSelectionMemory](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#inselectionmemory), [IsAssyTestPoint_Bottom](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#isassytestpoint_bottom), [IsAssyTestPoint_Top](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#isassytestpoint_top), [IsElectricalPrim](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#iselectricalprim), [IsFreePrimitive](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#isfreeprimitive), [IsHidden](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#ishidden), [IsKeepout](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#iskeepout), [IsPreRoute](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#ispreroute), [IsSaveable](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#issaveable), [IsTenting](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#istenting), [IsTenting_Bottom](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#istenting_bottom), [IsTenting_Top](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#istenting_top), [IsTestPoint_Bottom](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#istestpoint_bottom), [IsTestPoint_Top](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#istestpoint_top), [Layer](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#layer), [MiscFlag1](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#miscflag1), [MiscFlag2](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#miscflag2), [MiscFlag3](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#miscflag3), [Moveable](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#moveable), [MoveByXY](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#movebyxy), [MoveToXY](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#movetoxy), [Net](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#net), [ObjectID](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#objectid), [ObjectIDString](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#objectidstring), [PadCacheRobotFlag](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#padcacherobotflag), [PasteMaskExpansion](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#pastemaskexpansion), [Polygon](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#polygon), [PolygonOutline](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#polygonoutline), [PowerPlaneClearance](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#powerplaneclearance), [PowerPlaneConnectStyle](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#powerplaneconnectstyle), [PowerPlaneReliefExpansion](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#powerplanereliefexpansion), [Preview](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#preview), [ReliefAirGap](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#reliefairgap), [ReliefConductorWidth](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#reliefconductorwidth), [ReliefEntries](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#reliefentries), [Replicate](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#replicate), [RequiredParamterSpace](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#requiredparamterspace), [RotateBy](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#rotateby), [Selected](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#selected), [SolderMaskExpansion](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#soldermaskexpansion), [SwapLayerPairs](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#swaplayerpairs), [TearDrop](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#teardrop), [UnionIndex](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#unionindex), [UniqueId](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#uniqueid), [UniqueID](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#uniqueid-1), [Used](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#used), [UserRouted](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#userrouted), [V7Layer](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#v7layer), [ViewableObjectID](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#viewableobjectid)

## Returned by

[IPCB_Board.FindDominantRuleForObject](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Board.md#finddominantruleforobject), [IPCB_Board.FindDominantRuleForObjectPair](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Board.md#finddominantruleforobjectpair), [IPCB_ServerInterface.PCBRuleFactory](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_ServerInterface.md#pcbrulefactory)

## Accepted by

[IPCB_Board.RuleNameUnique](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Board.md#rulenameunique), [IPCB_ManufactruingRuleList.AddPCBRule](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_ManufactruingRuleList.md#addpcbrule)
