DesignRuleViolation Class — NXOpen Python API Reference 12.0.0 documentation

# DesignRuleViolation Class

class `NXOpen.Routing.``DesignRuleViolation`

  Bases: `NXOpen.NXObject`

  Represents `NXOpen.Routing.DesignRuleViolation` object

  Design Rule Violation object is created automatically during design rule check

  New in version NX4.0.2.

# Properties

Property | Description
--- | ---
IsOccurrence | Returns whether this object is an occurrence or not.
JournalIdentifier | Returns the identifier that would be recorded in a journal for this object.
LongDescription | Returns or sets the long description of the design rule violation is returned
Name | Returns the custom name of the object.
Override | Returns or sets the override object for the violation is inquired
OwningComponent | Returns the owning component, if this object is an occurrence.
OwningPart | Returns the owning part of this object
Prototype | Returns the prototype of this object if it is an occurrence.
ShortDescription | Returns or sets the short description of the design rule violation is returned
Tag | Returns the Tag for this object.
TimeStamp | Returns or sets the date/time stamp of the violation is inquired

# Methods

Method | Description
--- | ---
AddObjects | Add an object in violation to the violation
AddViolationLocations | This will add given number of violation location objects.
BlankLocationObjectsOfViolation | This function will blank location objects of given violation.
CreateAttributeIterator | Create an attribute iterator
DeleteAllAttributesByType | Deletes all attributes of a specific type.
DeleteAttributeByTypeAndTitle | Deletes an attribute by type and title.
DeleteRuleOverride | Override object will be deleted
DeleteUserAttribute | Deletes the first attribute encountered with the given Type, Title.
DeleteUserAttributes | Deletes the attributes on the object, if any, that satisfy the given iterator
FindObject | Finds the `NXOpen.NXObject` with the given identifier as recorded in a journal.
GetAttributeTitlesByType | Gets all the attribute titles of a specific type.
GetBooleanUserAttribute | Gets a boolean attribute by Title and array Index.
GetComputationalTimeUserAttribute | Gets a time attribute by Title and array Index.
GetIntegerAttribute | Gets an integer attribute by title.
GetIntegerUserAttribute | Gets an integer attribute by Title and array Index.
GetLocations | This will give all violation location objects stored in calling violation object.
GetNextUserAttribute | Gets the next attribute encountered on the object, if any, that satisfies the given iterator.
GetObjects | Get the array of objects in violation
GetPdmReferenceAttributeValue | Gets the value of PDM Reference attribute for given object.
GetRealAttribute | Gets a real attribute by title.
GetRealUserAttribute | Gets a real attribute by Title and array Index.
GetReferenceAttribute | Gets the reference string (not the calculated value) of a string attribute that uses a reference string.
GetStringAttribute | Gets a string attribute value by title.
GetStringUserAttribute | Gets a string attribute by Title and array Index.
GetTimeAttribute | Gets a time attribute by title.
GetTimeUserAttribute | Gets a time attribute by Title and array Index.
GetUserAttribute | Gets the first attribute encountered on the object, if any, with a given Title, Type and array Index.
GetUserAttributeAsString | Gets the first attribute encountered on the object, if any, with a given title, type and array index.
GetUserAttributeCount | Gets the count of set attributes on the object, if any, that satisfy the given iterator.
GetUserAttributeLock | Determine the lock of the given attribute.
GetUserAttributeSize | Gets the size of the first attribute encountered on the object, if any, with a given Title and Type.
GetUserAttributeSourceObjects | Returns an array of objects from which this object presents attributes.
GetUserAttributes | Gets all the attributes that have been set on the given object, if any, that satisfy the given iterator.
GetUserAttributesAsStrings | Gets all the attributes that have been set on the given object.
GetViolationLocation | This will return violation location object stored at given postion of array.
HasUserAttribute | Determines if an attribute exists on the object, that satisfies the given iterator
IsRuleOverridden | Violation is overridden or not is inquired
Print | Prints a representation of this object to the system log file.
RemoveViolationOverride | Removes violation override from given violation object.
SetAttribute | Creates or modifies an integer attribute.
SetBooleanUserAttribute | Creates or modifies a boolean attribute with the option to update or not.
SetLocations |
SetName | Sets the custom name of the object.
SetObjects | Sets the array of objects in violation
SetPdmReferenceAttribute | Sets the value of PDM Reference attribute on the object.
SetReferenceAttribute | Creates or modifies a string attribute which uses a reference string.
SetTimeAttribute | Creates or modifies a time attribute.
SetTimeUserAttribute | Creates or modifies a time attribute with the option to update or not.
SetUserAttribute | Creates or modifies an attribute with the option to update or not.
SetUserAttributeLock | Lock or unlock the given attribute.
SetViolationLocation | This will set violation location object at given postion of array.
SetViolationOverride | Sets the violation override

# Enumerations

DesignRuleViolationBlankOption Enumeration | Design Rule Violation Location Object Blank Option

# Property Detail

## IsOccurrence

`DesignRuleViolation.``IsOccurrence`

  Returns whether this object is an occurrence or not.

  `-------------------------------------`

  Getter Method

  Signature `IsOccurrence`

  Returns: | This object is an occurrence
  Return type: | bool

  New in version NX3.0.0.

  License requirements: None.

## JournalIdentifier

`DesignRuleViolation.``JournalIdentifier`

  Returns the identifier that would be recorded in a journal for this object.

  This may not be the same across different releases of the software.

  `-------------------------------------`

  Getter Method

  Signature `JournalIdentifier`

  Returns: |
  Return type: | str

  New in version NX3.0.0.

  License requirements: None.

## LongDescription

`DesignRuleViolation.``LongDescription`

  Returns or sets the long description of the design rule violation is returned

  `-------------------------------------`

  Getter Method

  Signature `LongDescription`

  Returns: | Violation Description
  Return type: | str

  New in version NX4.0.0.

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

  `-------------------------------------`

  Setter Method

  Signature `LongDescription`

  Parameters: | longDescription (str) –

  New in version NX4.0.2.

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

## Name

`DesignRuleViolation.``Name`

  Returns the custom name of the object.

  `-------------------------------------`

  Getter Method

  Signature `Name`

  Returns: |
  Return type: | str

  New in version NX3.0.0.

  License requirements: None.

## Override

`DesignRuleViolation.``Override`

  Returns or sets the override object for the violation is inquired

  `-------------------------------------`

  Getter Method

  Signature `Override`

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

  New in version NX4.0.2.

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

  `-------------------------------------`

  Setter Method

  Signature `Override`

  Parameters: | overrideTag (`NXOpen.Routing.DesignRuleOverride`) –

  New in version NX4.0.2.

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

## OwningComponent

`DesignRuleViolation.``OwningComponent`

  Returns the owning component, if this object is an occurrence.

  `-------------------------------------`

  Getter Method

  Signature `OwningComponent`

  Returns: |
  Return type: | `NXOpen.Assemblies.Component`

  New in version NX3.0.0.

  License requirements: None.

## OwningPart

`DesignRuleViolation.``OwningPart`

  Returns the owning part of this object

  `-------------------------------------`

  Getter Method

  Signature `OwningPart`

  Returns: | The owning part of this object or null if it does not have an owner
  Return type: | `NXOpen.BasePart`

  New in version NX3.0.0.

  License requirements: None.

## Prototype

`DesignRuleViolation.``Prototype`

  Returns the prototype of this object if it is an occurrence.

  `-------------------------------------`

  Getter Method

  Signature `Prototype`

  Returns: | The prototype of this object or null if this object is not an occurrence
  Return type: | `NXOpen.INXObject`

  New in version NX3.0.0.

  License requirements: None.

## ShortDescription

`DesignRuleViolation.``ShortDescription`

  Returns or sets the short description of the design rule violation is returned

  `-------------------------------------`

  Getter Method

  Signature `ShortDescription`

  Returns: | Violation Description
  Return type: | str

  New in version NX4.0.2.

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

  `-------------------------------------`

  Setter Method

  Signature `ShortDescription`

  Parameters: | shortDescription (str) –

  New in version NX4.0.0.

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

## TimeStamp

`DesignRuleViolation.``TimeStamp`

  Returns or sets the date/time stamp of the violation is inquired

  `-------------------------------------`

  Getter Method

  Signature `TimeStamp`

  Returns: |
  Return type: | int

  New in version NX4.0.2.

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

  `-------------------------------------`

  Setter Method

  Signature `TimeStamp`

  Parameters: | timeStamp (int) –

  New in version NX4.0.2.

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

# Method Detail

## AddObjects

`DesignRuleViolation.``AddObjects`

  Add an object in violation to the violation

  Signature `AddObjects(objects)`

  Parameters: | objects (list of `NXOpen.Routing.DesignRuleViolation`) –

  New in version NX4.0.2.

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

## AddViolationLocations

`DesignRuleViolation.``AddViolationLocations`

  This will add given number of violation location objects.

  Signature `AddViolationLocations(locationObjects)`

  Parameters: | locationObjects (list of `NXOpen.Routing.DesignRuleViolationLocation`) – Array of violation locations to be added.

  New in version NX6.0.0.

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

## BlankLocationObjectsOfViolation

`DesignRuleViolation.``BlankLocationObjectsOfViolation`

  This function will blank location objects of given violation.

  Signature `BlankLocationObjectsOfViolation(blankOption)`

  Parameters: | blankOption (`NXOpen.Routing.DesignRuleViolationBlankOption`) –

  New in version NX6.0.0.

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

## DeleteRuleOverride

`DesignRuleViolation.``DeleteRuleOverride`

  Override object will be deleted

  Signature `DeleteRuleOverride(deleteObject)`

  Parameters: | deleteObject (`NXOpen.Routing.DesignRuleOverride`) –

  New in version NX4.0.3.

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

## FindObject

`DesignRuleViolation.``FindObject`

  Finds the `NXOpen.NXObject` with the given identifier as recorded in a journal.

  An object may not return the same value as its JournalIdentifier in different versions of the software. However newer versions of the software should find the same object when FindObject is passed older versions of its journal identifier. In general, this method should not be used in handwritten code and exists to support record and playback of journals.

  An exception will be thrown if no object can be found with the given journal identifier.

  Signature `FindObject(journalIdentifier)`

  Parameters: | journalIdentifier (str) – Journal identifier of the object
  Returns: |
  Return type: | `NXOpen.INXObject`

  New in version NX3.0.0.

  License requirements: None.

## GetLocations

`DesignRuleViolation.``GetLocations`

  This will give all violation location objects stored in calling violation object.

  Signature `GetLocations()`

  Returns: | Array of `NXOpen.Routing.DesignRuleViolationLocation` object.
  Return type: | list of `NXOpen.Routing.DesignRuleViolationLocation`

  New in version NX6.0.0.

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

## GetObjects

`DesignRuleViolation.``GetObjects`

  Get the array of objects in violation

  Signature `GetObjects()`

  Returns: | Caller frees the array
  Return type: | list of `NXOpen.NXObject`

  New in version NX4.0.2.

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

## GetViolationLocation

`DesignRuleViolation.``GetViolationLocation`

  This will return violation location object stored at given postion of array.

  If there is no object at the given position, it will give appropriate message. and return None

  Signature `GetViolationLocation()`

  Returns: | a tuple
  Return type: | A tuple consisting of (locationObject, arrayPosition). locationObject is a `NXOpen.Routing.DesignRuleViolationLocation`. ViolationLocation object at given array position. arrayPosition is a int.

  New in version NX6.0.0.

  Deprecated since version NX8.0.3: Use `NXOpen.Routing.DesignRuleViolation.GetLocations()` instead.

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

## IsRuleOverridden

`DesignRuleViolation.``IsRuleOverridden`

  Violation is overridden or not is inquired

  Signature `IsRuleOverridden()`

  Returns: |
  Return type: | bool

  New in version NX4.0.2.

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

## Print

`DesignRuleViolation.``Print`

  Prints a representation of this object to the system log file.

  Signature `Print()`

  New in version NX3.0.0.

  License requirements: None.

## RemoveViolationOverride

`DesignRuleViolation.``RemoveViolationOverride`

  Removes violation override from given violation object.

  Signature `RemoveViolationOverride()`

  New in version NX4.0.2.

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

## SetLocations

`DesignRuleViolation.``SetLocations`

  Signature `SetLocations(violationLocations)`

  Parameters: | violationLocations (list of `NXOpen.Routing.DesignRuleViolationLocation`) –

  New in version NX6.0.0.

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

## SetName

`DesignRuleViolation.``SetName`

  Sets the custom name of the object.

  NOTE: This method should not be used to edit a read-only object such as a Mirrored PMI object. If it is, the changes will be overridden when the part is updated.

  Signature `SetName(name)`

  Parameters: | name (str) –

  New in version NX3.0.0.

  License requirements: None.

## SetObjects

`DesignRuleViolation.``SetObjects`

  Sets the array of objects in violation

  Signature `SetObjects(objects)`

  Parameters: | objects (list of `NXOpen.NXObject`) – Caller frees the array

  New in version NX4.0.2.

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

## SetViolationLocation

`DesignRuleViolation.``SetViolationLocation`

  This will set violation location object at given postion of array.

  If there is already an object at the given position, it will delete that object and set with new one.

  Signature `SetViolationLocation(arrayPosition, locationObject)`

  Parameters:

  - arrayPosition (int) –
  - locationObject (`NXOpen.Routing.DesignRuleViolationLocation`) – ViolationLocation object to be set at given array position.

  New in version NX6.0.0.

  Deprecated since version NX8.0.3: Use `NXOpen.Routing.DesignRuleViolation.AddViolationLocations()` instead.

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

## SetViolationOverride

`DesignRuleViolation.``SetViolationOverride`

  Sets the violation override

  Signature `SetViolationOverride(user, reason, timestamp)`

  Parameters:

  - user (str) –
  - reason (str) –
  - timestamp (int) –

  New in version NX4.0.2.

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