ColorDefinition Class

class NXOpen.ColorDefinition

Bases: NXOpen.TaggedObject

Represents a NXOpen.ColorDefinition, which is a representation of one color on an NX color palette.

Each color has an index into the palette, a name, rgb values, and an optional favorite index.

New in version NX5.0.0.

Properties

Property Description
ColorIndex Returns or sets the color index.
ColorName Returns or sets the color name.
FavoriteIndex Returns or sets the favorite index.
Tag Returns the Tag for this object.

Methods

Method Description
GetColorValues Gets the color values.
SetColorValues Sets the color values.

Property Detail

ColorIndex

ColorDefinition.ColorIndex

Returns or sets the color index.

This is an number ranging from 0 to 216, each color on the color palette must have a unique index.

-------------------------------------

Getter Method

Signature ColorIndex

Returns:
Return type:int

New in version NX5.0.0.

License requirements: None.

-------------------------------------

Setter Method

Signature ColorIndex

Parameters:colorIdx (int) –

New in version NX5.0.0.

License requirements: None.

ColorName

ColorDefinition.ColorName

Returns or sets the color name.

-------------------------------------

Getter Method

Signature ColorName

Returns:
Return type:str

New in version NX5.0.0.

License requirements: None.

-------------------------------------

Setter Method

Signature ColorName

Parameters:colorName (str) –

New in version NX5.0.0.

License requirements: None.

FavoriteIndex

ColorDefinition.FavoriteIndex

Returns or sets the favorite index.

The favorite index is a unique number between 0 and 29 specifing the index into the favorite color array. If the color is not a favorite, it has an index of -1.

-------------------------------------

Getter Method

Signature FavoriteIndex

Returns:
Return type:int

New in version NX5.0.0.

License requirements: None.

-------------------------------------

Setter Method

Signature FavoriteIndex

Parameters:favoriteIdx (int) –

New in version NX5.0.0.

License requirements: None.

Method Detail

GetColorValues

ColorDefinition.GetColorValues

Gets the color values.

This is an array of 3 doubles containing the RGB values of the color.

Signature GetColorValues()

Returns:
Return type:NXOpen.ColorDefinitionRgb

New in version NX5.0.0.

License requirements: None.

SetColorValues

ColorDefinition.SetColorValues

Sets the color values.

This is an array of 3 doubles containing the RGB values of the color.

Signature SetColorValues(colorVals)

Parameters:colorVals (NXOpen.ColorDefinitionRgb) –

New in version NX5.0.0.

License requirements: None.