DesignRuleViolationCollection Class — NXOpen Python API Reference 12.0.0 documentation

# DesignRuleViolationCollection Class

class `NXOpen.Routing.``DesignRuleViolationCollection`

  Bases: `object`

  Represents a collection of `NXOpen.Routing.DesignRuleViolation` objects.

  To obtain an instance of this class, refer to `NXOpen.Routing.RouteManager`

  New in version NX4.0.0.

# Methods

Method | Description
--- | ---
CreateDesignRuleViolation | Creates a `NXOpen.Routing.DesignRuleViolation` object.
ReasonExecuteRule | Executes design rules and returns all the violations of the rule

# Enumerations

DesignRuleViolationCollectionMode Enumeration | Design Rule Mode
DesignRuleViolationCollectionReason Enumeration | Design Rule reason

# Method Detail

## CreateDesignRuleViolation

`DesignRuleViolationCollection.``CreateDesignRuleViolation`

  Creates a `NXOpen.Routing.DesignRuleViolation` object.

  Once created, you must add the violation to a rule using `NXOpen.Routing.DesignRule.AddViolations()`.

  Signature `CreateDesignRuleViolation(shortDescription, longDescription, objects)`

  Parameters:

  - shortDescription (str) –
  - longDescription (str) –
  - objects (list of `NXOpen.NXObject`) –

  Returns: |
  Return type: | `NXOpen.Routing.DesignRuleViolation`

  New in version NX4.0.2.

  Deprecated since version NX11.0.0: Use `Routing.DesignRule.CreateViolation()` instead.

  License requirements: routing_advanced (“Routing Advanced”), routing_base (“Routing Basic”)

## ReasonExecuteRule

`DesignRuleViolationCollection.``ReasonExecuteRule`

  Executes design rules and returns all the violations of the rule

  Signature `ReasonExecuteRule(mode, reason, objs)`

  Parameters:

  - mode (`NXOpen.Routing.DesignRuleViolationCollectionMode`) – Design Rule Mode
  - reason (`NXOpen.Routing.DesignRuleViolationCollectionReason`) – Design Rule Reason
  - objs (list of `NXOpen.NXObject`) – Objects to check the design rule violation against

  Returns: | Violations
  Return type: | list of `NXOpen.Routing.DesignRuleViolation`

  New in version NX4.0.0.

  License requirements: routing_advanced (“Routing Advanced”), routing_base (“Routing Basic”)