
# IRule interface

The `IRule` interface represents the one of the rules attached to a parameter within the PCB Layout directive (as a Parameter Set object with a small flag symbol) on a net aware object on a schematic object. A parameter set object can be placed on the schematic sheet by the Place » Directives » PCB Layout menu item.

```csharp
public interface IRule : IDMObject
```

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

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

## Remarks

This PCB Layout directive allows you to assign PCB layout information to a net in the schematic. When a PCB is created from the schematic, the information in the PCB layout directive is used to create relevant PCB design rules.

## Methods

| Method | Returns | Description |
| --- | --- | --- |
| [DM_Attributes](#dm_attributes) | `string` | The method denotes the attributes of the `IRule` interface. |
| [DM_Description](#dm_description) | `string` | The method denotes the description of this `IRule` interface. |
| [DM_MaxViaHole](#dm_maxviahole) | `int` | The method denotes the max Via Hole rule property of a Routing Via style PCB Rule. |
| [DM_MaxViaWidth](#dm_maxviawidth) | `int` | The method denotes the max Via width rule property of a Routing Via style PCB Rule. |
| [DM_MaxWidth](#dm_maxwidth) | `int` | The method denotes the Maximum Width rule property of a PCB rule. |
| [DM_MinViaHole](#dm_minviahole) | `int` | The method denotes the min Via Hole rule property of a Routing Via style PCB Rule. |
| [DM_MinViaWidth](#dm_minviawidth) | `int` | The method denotes the min Via width rule property of a Routing Via style PCB Rule. |
| [DM_MinWidth](#dm_minwidth) | `int` | The method denotes the Minimum Width rule property of a PCB Rule. |
| [DM_PreferedWidth](#dm_preferedwidth) | `int` | The method denotes the preferred Width rule property of a PCB Rule. |
| [DM_Priority](#dm_priority) | `int` | The method denotes the priority of the PCB Design Rule. |
| [DM_RoutingLayers](#dm_routinglayers) | `int` | The method denotes the indexed routing layer rule property (Top layer, Mid1-Mid30, Bottom Layer) of a Routing Layers PCB rule. |
| [DM_RuleKind](#dm_rulekind) | `int` | The method denotes the type of PCB Rule. |
| [DM_RuleName](#dm_rulename) | `string` | The method denotes the name of this `IRule` interface representing a PCB rule. |
| [DM_Scope1Expression](#dm_scope1expression) | `string` | The method denotes the first scope expression string. |
| [DM_Scope2Expression](#dm_scope2expression) | `string` | The method denotes the second scope expression string. |
| [DM_Topology](#dm_topology) | `int` | The method Denotes the topology (Shortest, Horizontal, Vertical, Daisy-Simple, Daisy-MidDriven, Daisy-Balanced and Daisy-StarBurst) rule property of a Routing Topology PCB Rule. |
| [DM_UniqueId](#dm_uniqueid) | `string` | Each rule has a Unique ID assigned so that when Schematic and PCB documents are synchronized, the ECO knows which rules to update or apply to/from. |
| [DM_ViaHole](#dm_viahole) | `int` | Denotes the Via Hole rule property of a Routing Via style PCB Rule. |
| [DM_ViaStyle](#dm_viastyle) | `int` | This method denotes the via style rule property of a Routing Via style PCB Rule. |
| [DM_ViaWidth](#dm_viawidth) | `int` | The method denotes the Via width rule property of a Routing Via style PCB Rule. |

### DM_Attributes

The method denotes the attributes of the `IRule` interface.

```csharp
string DM_Attributes();
```

**Returns:** `string`

### DM_Description

The method denotes the description of this `IRule` interface.

```csharp
string DM_Description();
```

**Returns:** `string`

### DM_MaxViaHole

The method denotes the max Via Hole rule property of a Routing Via style PCB Rule.

```csharp
int DM_MaxViaHole();
```

**Returns:** `int`

### DM_MaxViaWidth

The method denotes the max Via width rule property of a Routing Via style PCB Rule.

```csharp
int DM_MaxViaWidth();
```

**Returns:** `int`

### DM_MaxWidth

The method denotes the Maximum Width rule property of a PCB rule.

```csharp
int DM_MaxWidth();
```

**Returns:** `int`

### DM_MinViaHole

The method denotes the min Via Hole rule property of a Routing Via style PCB Rule.

```csharp
int DM_MinViaHole();
```

**Returns:** `int`

### DM_MinViaWidth

The method denotes the min Via width rule property of a Routing Via style PCB Rule.

```csharp
int DM_MinViaWidth();
```

**Returns:** `int`

### DM_MinWidth

The method denotes the Minimum Width rule property of a PCB Rule.

```csharp
int DM_MinWidth();
```

**Returns:** `int`

### DM_PreferedWidth

The method denotes the preferred Width rule property of a PCB Rule.

```csharp
int DM_PreferedWidth();
```

**Returns:** `int`

### DM_Priority

The method denotes the priority of the PCB Design Rule. The priority value of 1 denotes the highest priority.

```csharp
int DM_Priority();
```

**Returns:** `int`

### DM_RoutingLayers

The method denotes the indexed routing layer rule property (Top layer, Mid1-Mid30, Bottom Layer) of a Routing Layers PCB rule.

```csharp
int DM_RoutingLayers(int argIndexLayer);
```

| Parameter | Type | Passing |
| --- | --- | --- |
| `argIndexLayer` | `int` | value |

**Returns:** `int`

### DM_RuleKind

The method denotes the type of PCB Rule.

```csharp
int DM_RuleKind();
```

**Returns:** `int`

### DM_RuleName

The method denotes the name of this `IRule` interface representing a PCB rule.

```csharp
string DM_RuleName();
```

**Returns:** `string`

### DM_Scope1Expression

The method denotes the first scope expression string. The scope of Design rules are determined by the defined boundary or objects.

```csharp
string DM_Scope1Expression();
```

**Returns:** `string`

### DM_Scope2Expression

The method denotes the second scope expression string. The scope of Design rules are determined by the defined boundary or objects.

```csharp
string DM_Scope2Expression();
```

**Returns:** `string`

### DM_Topology

The method Denotes the topology (Shortest, Horizontal, Vertical, Daisy-Simple, Daisy-MidDriven, Daisy-Balanced and Daisy-StarBurst) rule property of a Routing Topology PCB Rule.

```csharp
int DM_Topology();
```

**Returns:** `int`

### DM_UniqueId

Each rule has a Unique ID assigned so that when Schematic and PCB documents are synchronized, the ECO knows which rules to update or apply to/from.

```csharp
string DM_UniqueId();
```

**Returns:** `string`

### DM_ViaHole

Denotes the Via Hole rule property of a Routing Via style PCB Rule.

```csharp
int DM_ViaHole();
```

**Returns:** `int`

### DM_ViaStyle

This method denotes the via style rule property of a Routing Via style PCB Rule.

```csharp
int DM_ViaStyle();
```

**Returns:** `int`

### DM_ViaWidth

The method denotes the Via width rule property of a Routing Via style PCB Rule.

```csharp
int DM_ViaWidth();
```

**Returns:** `int`

## Inherited members

- From [IDMObject](https://altiumdeveloper.github.io/ad-sdk-docs/reference/edp/IDMObject.md): [DM_CalculateParameterValue](https://altiumdeveloper.github.io/ad-sdk-docs/reference/edp/IDMObject.md#dm_calculateparametervalue), [DM_CurrentSheetInstanceNumber](https://altiumdeveloper.github.io/ad-sdk-docs/reference/edp/IDMObject.md#dm_currentsheetinstancenumber), [DM_FullCrossProbeString](https://altiumdeveloper.github.io/ad-sdk-docs/reference/edp/IDMObject.md#dm_fullcrossprobestring), [DM_GeneralField](https://altiumdeveloper.github.io/ad-sdk-docs/reference/edp/IDMObject.md#dm_generalfield), [DM_GetVCSProject](https://altiumdeveloper.github.io/ad-sdk-docs/reference/edp/IDMObject.md#dm_getvcsproject), [DM_ImageIndex](https://altiumdeveloper.github.io/ad-sdk-docs/reference/edp/IDMObject.md#dm_imageindex), [DM_IsFormulaString](https://altiumdeveloper.github.io/ad-sdk-docs/reference/edp/IDMObject.md#dm_isformulastring), [DM_IsInferredObject](https://altiumdeveloper.github.io/ad-sdk-docs/reference/edp/IDMObject.md#dm_isinferredobject), [DM_LocationString](https://altiumdeveloper.github.io/ad-sdk-docs/reference/edp/IDMObject.md#dm_locationstring), [DM_LocationX](https://altiumdeveloper.github.io/ad-sdk-docs/reference/edp/IDMObject.md#dm_locationx), [DM_LocationY](https://altiumdeveloper.github.io/ad-sdk-docs/reference/edp/IDMObject.md#dm_locationy), [DM_LongDescriptorString](https://altiumdeveloper.github.io/ad-sdk-docs/reference/edp/IDMObject.md#dm_longdescriptorstring), [DM_NetIndex_Flat](https://altiumdeveloper.github.io/ad-sdk-docs/reference/edp/IDMObject.md#dm_netindex_flat), [DM_NetIndex_Sheet](https://altiumdeveloper.github.io/ad-sdk-docs/reference/edp/IDMObject.md#dm_netindex_sheet), [DM_NetIndex_SubNet](https://altiumdeveloper.github.io/ad-sdk-docs/reference/edp/IDMObject.md#dm_netindex_subnet), [DM_ObjectKindString](https://altiumdeveloper.github.io/ad-sdk-docs/reference/edp/IDMObject.md#dm_objectkindstring), [DM_ObjectKindStringForCrossProbe](https://altiumdeveloper.github.io/ad-sdk-docs/reference/edp/IDMObject.md#dm_objectkindstringforcrossprobe), [DM_OwnerDocument](https://altiumdeveloper.github.io/ad-sdk-docs/reference/edp/IDMObject.md#dm_ownerdocument), [DM_OwnerDocumentFullPath](https://altiumdeveloper.github.io/ad-sdk-docs/reference/edp/IDMObject.md#dm_ownerdocumentfullpath), [DM_OwnerDocumentName](https://altiumdeveloper.github.io/ad-sdk-docs/reference/edp/IDMObject.md#dm_ownerdocumentname), [DM_ParameterCount](https://altiumdeveloper.github.io/ad-sdk-docs/reference/edp/IDMObject.md#dm_parametercount), [DM_Parameters](https://altiumdeveloper.github.io/ad-sdk-docs/reference/edp/IDMObject.md#dm_parameters), [DM_PcbHandle](https://altiumdeveloper.github.io/ad-sdk-docs/reference/edp/IDMObject.md#dm_pcbhandle), [DM_PCBObjectHandle](https://altiumdeveloper.github.io/ad-sdk-docs/reference/edp/IDMObject.md#dm_pcbobjecthandle), [DM_PCBObjectInterface](https://altiumdeveloper.github.io/ad-sdk-docs/reference/edp/IDMObject.md#dm_pcbobjectinterface), [DM_PrimaryCrossProbeString](https://altiumdeveloper.github.io/ad-sdk-docs/reference/edp/IDMObject.md#dm_primarycrossprobestring), [DM_SchHandle](https://altiumdeveloper.github.io/ad-sdk-docs/reference/edp/IDMObject.md#dm_schhandle), [DM_SCHObjectHandle](https://altiumdeveloper.github.io/ad-sdk-docs/reference/edp/IDMObject.md#dm_schobjecthandle), [DM_SCHObjectInterface](https://altiumdeveloper.github.io/ad-sdk-docs/reference/edp/IDMObject.md#dm_schobjectinterface), [DM_SecondaryCrossProbeString](https://altiumdeveloper.github.io/ad-sdk-docs/reference/edp/IDMObject.md#dm_secondarycrossprobestring), [DM_SetVCSProject](https://altiumdeveloper.github.io/ad-sdk-docs/reference/edp/IDMObject.md#dm_setvcsproject), [DM_SheetIndex_Logical](https://altiumdeveloper.github.io/ad-sdk-docs/reference/edp/IDMObject.md#dm_sheetindex_logical), [DM_SheetIndex_Physical](https://altiumdeveloper.github.io/ad-sdk-docs/reference/edp/IDMObject.md#dm_sheetindex_physical), [DM_ShortDescriptorString](https://altiumdeveloper.github.io/ad-sdk-docs/reference/edp/IDMObject.md#dm_shortdescriptorstring), [DM_ValidForNavigation](https://altiumdeveloper.github.io/ad-sdk-docs/reference/edp/IDMObject.md#dm_validfornavigation), [DM_VHDLEntity](https://altiumdeveloper.github.io/ad-sdk-docs/reference/edp/IDMObject.md#dm_vhdlentity)

## Returned by

[IDocument.DM_Rules](https://altiumdeveloper.github.io/ad-sdk-docs/reference/edp/IDocument.md#dm_rules)
