
# IViolation interface

The `IViolation` interface represents a violation object on a design document in the Workspace Manager of Altium Designer.

```csharp
public interface IViolation : IDMObject
```

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

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

## Methods

| Method | Returns | Description |
| --- | --- | --- |
| [DM_AddRelatedObject](#dm_addrelatedobject) | `void` | This method adds the object that is part of the violation. |
| [DM_CompilationStage](#dm_compilationstage) | [TCompilationStage](https://altiumdeveloper.github.io/ad-sdk-docs/reference/edp/TCompilationStage.md) | This method returns the status of the complation stage: during compilation or during flattening process. |
| [DM_ConnectionCode1](#dm_connectioncode1) | [TConnectionCode](https://altiumdeveloper.github.io/ad-sdk-docs/reference/edp/TConnectionCode.md) |  |
| [DM_ConnectionCode2](#dm_connectioncode2) | [TConnectionCode](https://altiumdeveloper.github.io/ad-sdk-docs/reference/edp/TConnectionCode.md) |  |
| [DM_DescriptorString](#dm_descriptorstring) | `string` | This method returns the description string for this violation interface. |
| [DM_DetailString](#dm_detailstring) | `string` | This method returns the detailed description stirng of this violation interface. |
| [DM_ErrorKind](#dm_errorkind) | [TErrorKind](https://altiumdeveloper.github.io/ad-sdk-docs/reference/edp/TErrorKind.md) | Returns the kind of error this violation has been assigned to. |
| [DM_ErrorLevel](#dm_errorlevel) | [TErrorLevel](https://altiumdeveloper.github.io/ad-sdk-docs/reference/dxp/TErrorLevel.md) | Returns the level of error this violation has been assigned to. |
| [DM_IsSuppressed](#dm_issuppressed) | `bool` |  |
| [DM_RelatedObjectCount](#dm_relatedobjectcount) | `int` | This method returns the number of related objects of the violation. |
| [DM_RelatedObjects](#dm_relatedobjects) | [IDMObject](https://altiumdeveloper.github.io/ad-sdk-docs/reference/edp/IDMObject.md) | This method returns the indexed related object of the violation. |

### DM_AddRelatedObject

This method adds the object that is part of the violation.

```csharp
void DM_AddRelatedObject(IDMObject argnObject);
void DM_AddRelatedObject(object argnObject);
```

| Parameter | Type | Passing |
| --- | --- | --- |
| `argnObject` | [IDMObject](https://altiumdeveloper.github.io/ad-sdk-docs/reference/edp/IDMObject.md) | value |

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

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

### DM_CompilationStage

This method returns the status of the complation stage: during compilation or during flattening process.

```csharp
TCompilationStage DM_CompilationStage();
```

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

Extension method of `IViolationHelper` (`using EDP;`).

### DM_ConnectionCode1

*No description yet.*

```csharp
TConnectionCode DM_ConnectionCode1();
```

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

Extension method of `IViolationHelper` (`using EDP;`).

### DM_ConnectionCode2

*No description yet.*

```csharp
TConnectionCode DM_ConnectionCode2();
```

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

Extension method of `IViolationHelper` (`using EDP;`).

### DM_DescriptorString

This method returns the description string for this violation interface.

```csharp
string DM_DescriptorString();
```

**Returns:** `string`

### DM_DetailString

This method returns the detailed description stirng of this violation interface.

```csharp
string DM_DetailString();
```

**Returns:** `string`

### DM_ErrorKind

Returns the kind of error this violation has been assigned to.

```csharp
TErrorKind DM_ErrorKind();
```

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

Extension method of `IViolationHelper` (`using EDP;`).

### DM_ErrorLevel

Returns the level of error this violation has been assigned to. Various error levels include : eErrorLevelNoReport,eErrorLevelWarning,eErrorLevelError,eErrorLevelFatal

```csharp
TErrorLevel DM_ErrorLevel();
```

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

Extension method of `IViolationHelper` (`using EDP;`).

### DM_IsSuppressed

*No description yet.*

```csharp
bool DM_IsSuppressed();
```

**Returns:** `bool`

### DM_RelatedObjectCount

This method returns the number of related objects of the violation.

```csharp
int DM_RelatedObjectCount();
```

**Returns:** `int`

### DM_RelatedObjects

This method returns the indexed related object of the violation.

```csharp
IDMObject DM_RelatedObjects(int argIndex);
```

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

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

Extension method of `IViolationHelper` (`using EDP;`).

## 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_CreateViolation](https://altiumdeveloper.github.io/ad-sdk-docs/reference/edp/IDocument.md#dm_createviolation), [IProject.DM_Violations](https://altiumdeveloper.github.io/ad-sdk-docs/reference/edp/IProject.md#dm_violations)
