NX Open C++ Reference Guide
Public Types | Public Member Functions | List of all members
NXOpen::Preferences::PartObject Class Reference

Represents the set of object preferences applicable to entire part. More...

Public Types

enum  ColorSelection { ColorSelectionNoChange, ColorSelectionDefaultColor, ColorSelectionColor }
 Describes whether color of object is not changed or it is default color or it is defined by user. More...
 
enum  LineFontType {
  LineFontTypePartDefault = 1, LineFontTypeSolid, LineFontTypeDashed, LineFontTypePhantom,
  LineFontTypeCenterline, LineFontTypeDotted, LineFontTypeLongDashed, LineFontTypeDottedDashed
}
 Represents the available types for font. More...
 
enum  ObjectType {
  ObjectTypeGeneral, ObjectTypeLine, ObjectTypeArc, ObjectTypeConic,
  ObjectTypeSpline, ObjectTypeSolidbody, ObjectTypeSheetbody, ObjectTypeDatum,
  ObjectTypePoint, ObjectTypeCoordinateSystem, ObjectTypeAllButDefault, ObjectTypeDatumCsys,
  ObjectTypeTraceline, ObjectTypeInfiniteLine, ObjectTypePointCloud
}
 Describes all available Types for object selection. More...
 
enum  WidthType {
  WidthTypePartDefault = 1, WidthTypeThinWidth, WidthTypeNormalWidth, WidthTypeThickWidth,
  WidthTypeWidthOne, WidthTypeWidthTwo, WidthTypeWidthThree, WidthTypeWidthFour,
  WidthTypeWidthFive, WidthTypeWidthSix, WidthTypeWidthSeven, WidthTypeWidthEight,
  WidthTypeWidthNine
}
 Describes the available types for width. More...
 

Public Member Functions

NXOpen::Preferences::ViewVisualizationSpecialEffects::ColorRGB ConvertColorNumberToRGBValue (int colorNumber)
 Converts color number to RGB constituents. More...
 
int ConvertRGBValueToColorNumber (const NXOpen::Preferences::ViewVisualizationSpecialEffects::ColorRGB &fogColorRgbValue)
 Converts RGB color constituents to color number. More...
 
bool FaceAnalysis ()
 Returns the face analysis flag for Solid and Sheets
Created in NX3.0.0. More...
 
int GetColor (NXOpen::Preferences::PartObject::ObjectType type)
 Returns the current color value for specified type. More...
 
void GetLegacyLineWidthMap (std::vector< NXOpen::Preferences::PartObject::WidthType > &newLineWidths)
 Gets line width map that is used to convert legacy line widths to new line widths. More...
 
NXOpen::Preferences::PartObject::LineFontType GetLineFont (NXOpen::Preferences::PartObject::ObjectType type)
 Returns the current line font for specified object type. More...
 
NXOpen::Preferences::PartObject::WidthType GetWidth (NXOpen::Preferences::PartObject::ObjectType type)
 Returns the current width for specified object type. More...
 
bool MigrateLegacyLineWidths ()
 Migrates line width attributes stored in the part file to corresponding new line widths. More...
 
bool PartiallyShaded ()
 Returns the partially shaded flag for Solid and Sheets
Created in NX3.0.0. More...
 
void SetColor (NXOpen::Preferences::PartObject::ObjectType type, int color)
 Sets the color. More...
 
void SetFaceAnalysis (bool faceAnalysis)
 Sets the face analysis flag for Solid and Sheets
Created in NX3.0.0. More...
 
void SetLegacyLineWidthMap (const std::vector< NXOpen::Preferences::PartObject::WidthType > &newLineWidths)
 Sets line width map that is used to convert legacy line widths to new line widths. More...
 
void SetLineFont (NXOpen::Preferences::PartObject::ObjectType type, NXOpen::Preferences::PartObject::LineFontType lineFont)
 Sets line font for specified object type
Created in NX3.0.0. More...
 
void SetPartiallyShaded (bool partiallyShaded)
 Sets the partially shaded flag for Solid and Sheets
Created in NX3.0.0. More...
 
void SetTranslucency (int translucency)
 Sets the translucency value
Created in NX3.0.0. More...
 
void SetWidth (NXOpen::Preferences::PartObject::ObjectType type, NXOpen::Preferences::PartObject::WidthType width)
 Sets width for specified object type
Created in NX3.0.0. More...
 
tag_t Tag () const
 Returns the tag of this object. More...
 
int Translucency ()
 Returns the translucency value
Created in NX3.0.0. More...
 

Detailed Description

Represents the set of object preferences applicable to entire part.

All the preferences available at UG GUI for object can be set by using this class except work layer. Work Layer should be set by using NXOpen::Layer::LayerManager class which holds a work layer property.
To obtain an instance of this class, refer to NXOpen::Preferences::PartPreferences

Created in NX3.0.0.

Member Enumeration Documentation

Describes whether color of object is not changed or it is default color or it is defined by user.

Enumerator
ColorSelectionNoChange 

No Change.

ColorSelectionDefaultColor 

Default Color.

ColorSelectionColor 

User Defined Color.

Represents the available types for font.

Enumerator
LineFontTypePartDefault 

Default Value from Part.

LineFontTypeSolid 

Solid.

LineFontTypeDashed 

Dashed.

LineFontTypePhantom 

Phantom.

LineFontTypeCenterline 

Centerline.

LineFontTypeDotted 

Dotted.

LineFontTypeLongDashed 

Long Dashed.

LineFontTypeDottedDashed 

Dotted Dashed.

Describes all available Types for object selection.

Enumerator
ObjectTypeGeneral 

Default Type Value.

ObjectTypeLine 

Line.

ObjectTypeArc 

Arc.

ObjectTypeConic 

Conic.

ObjectTypeSpline 

Spline.

ObjectTypeSolidbody 

Solid Body.

ObjectTypeSheetbody 

Sheet Body.

ObjectTypeDatum 

Datum.

ObjectTypePoint 

Point.

ObjectTypeCoordinateSystem 

Coordinate System.

ObjectTypeAllButDefault 

All But Default.

ObjectTypeDatumCsys 

Datum CSYS Feature.

ObjectTypeTraceline 

Traceline.

ObjectTypeInfiniteLine 

Infinite Line.

ObjectTypePointCloud 

Point Cloud.

Describes the available types for width.

Enumerator
WidthTypePartDefault 

Default Value from Part.

WidthTypeThinWidth 

Thin Width.

WidthTypeNormalWidth 

Normal Width.

WidthTypeThickWidth 

Thick Width.

WidthTypeWidthOne 

width one

WidthTypeWidthTwo 

width two

WidthTypeWidthThree 

width three

WidthTypeWidthFour 

width four

WidthTypeWidthFive 

width five

WidthTypeWidthSix 

width six

WidthTypeWidthSeven 

width seven

WidthTypeWidthEight 

width eight

WidthTypeWidthNine 

width nine

Member Function Documentation

NXOpen::Preferences::ViewVisualizationSpecialEffects::ColorRGB NXOpen::Preferences::PartObject::ConvertColorNumberToRGBValue ( int  colorNumber)

Converts color number to RGB constituents.

The color number passed should be between 1 to 216

Returns
Equivalent RGB constituents
Created in NX3.0.0.

License requirements : None
Parameters
colorNumberColor value
int NXOpen::Preferences::PartObject::ConvertRGBValueToColorNumber ( const NXOpen::Preferences::ViewVisualizationSpecialEffects::ColorRGB fogColorRgbValue)

Converts RGB color constituents to color number.

The Red, Green and Blue color constituents should be between 0 to 255.

Returns
Equivalent color value
Created in NX3.0.0.

License requirements : None
Parameters
fogColorRgbValuefog color rgb value
bool NXOpen::Preferences::PartObject::FaceAnalysis ( )

Returns the face analysis flag for Solid and Sheets
Created in NX3.0.0.



License requirements : None

int NXOpen::Preferences::PartObject::GetColor ( NXOpen::Preferences::PartObject::ObjectType  type)

Returns the current color value for specified type.

The equivalent RGB values can be found by calling ConvertColorNumberToRGBValue

Red Component is ((((216 - color_number) % 36)/6)* 51) Green component is (((216 - color_number)/36) * 51) Blue is (((216 - color_number) % 6)* 51). So for example if returned color value is 47 then Red is ((((216 - 47) % 36)/6)* 51) = (((169 % 36)/6)* 51) = ((25/6)* 51) = 4*51 = 204 Green is (((216 - 47)/36) * 51) = ((169/36) * 51) = 4*51 = 204 Blue is (((216 - 47) % 6)* 51) = ((169 % 6)* 51) = 1*51 = 51

Returns

Created in NX3.0.0.

License requirements : None
Parameters
typetype
void NXOpen::Preferences::PartObject::GetLegacyLineWidthMap ( std::vector< NXOpen::Preferences::PartObject::WidthType > &  newLineWidths)

Gets line width map that is used to convert legacy line widths to new line widths.

Following widths are considered as legacy line widths. Preferences::PartObject::WidthTypeThinWidth Preferences::PartObject::WidthTypeNormalWidth Preferences::PartObject::WidthTypeThickWidth

New line widths contain corresponding line widths for above three legacy line widths respectively. New line widths start at Preferences::PartObject::WidthTypeWidthOne .


Created in NX10.0.0.

License requirements : None

Parameters
newLineWidthsArray of 3 new widths each corresponding to a legacy width. First element corresponds to Thin width Second element corresponds to Normal width Third element corresponds to Thick width.

Returns the current line font for specified object type.

Returns

Created in NX3.0.0.

License requirements : None
Parameters
typetype

Returns the current width for specified object type.

Returns

Created in NX3.0.0.

License requirements : None
Parameters
typetype
bool NXOpen::Preferences::PartObject::MigrateLegacyLineWidths ( )

Migrates line width attributes stored in the part file to corresponding new line widths.

The migration is performed based on the legacy line width map stored in the part file.

See Preferences::PartObject::GetLegacyLineWidthMap

Line widths of various displayable objects such as solids, wireframe, drawing views etc. will be updated to new line widths. Display is regenerated if necessary to reflect the changes. A displayable object, that already has new line width assigned to it, is not affected.

Returns
At least one legacy line width attribute has been migrated.
Created in NX10.0.0.

License requirements : None
bool NXOpen::Preferences::PartObject::PartiallyShaded ( )

Returns the partially shaded flag for Solid and Sheets
Created in NX3.0.0.



License requirements : None

void NXOpen::Preferences::PartObject::SetColor ( NXOpen::Preferences::PartObject::ObjectType  type,
int  color 
)

Sets the color.

For Default color pass -2 as color value and for no change pass -1. For other color calculate the color in RGB format. If you pass R value of Red component G value of Green and B value of Blue the color will be: color = (((255-R)/51)*6 + ((255-G)/51)*36 + ((255-B)/51)*1) + 1 ; Where R G and B values are between 0 and 255 . So for Green (0,255,0)we will pass color = (((255-0)/51)*6 + ((255-255)/51)*36 + ((255-0)/51)*1) + 1 = 30+0+5+1 = 36 The equivalent color number value can be found by calling ConvertRGBValueToColorNumber


Created in NX3.0.0.

License requirements : None

Parameters
typetype
colorSpecified Color
void NXOpen::Preferences::PartObject::SetFaceAnalysis ( bool  faceAnalysis)

Sets the face analysis flag for Solid and Sheets
Created in NX3.0.0.



License requirements : None

Parameters
faceAnalysisface analysis
void NXOpen::Preferences::PartObject::SetLegacyLineWidthMap ( const std::vector< NXOpen::Preferences::PartObject::WidthType > &  newLineWidths)

Sets line width map that is used to convert legacy line widths to new line widths.

See Preferences::PartObject::GetLegacyLineWidthMap

The new line widths used to map legacy line width are in logical order; i.e.; Preferences::PartObject::WidthTypeThinWidth maps to a smaller width value compared to Preferences::PartObject::WidthTypeNormalWidth and so on. Otherwise, the legacy line width map will be rejected.


Created in NX10.0.0.

License requirements : None

Parameters
newLineWidthsArray of 3 new widths each corresponding to a legacy width. First element corresponds to Thin width Second element corresponds to Normal width Third element corresponds to Thick width.
void NXOpen::Preferences::PartObject::SetLineFont ( NXOpen::Preferences::PartObject::ObjectType  type,
NXOpen::Preferences::PartObject::LineFontType  lineFont 
)

Sets line font for specified object type
Created in NX3.0.0.



License requirements : None

Parameters
typetype
lineFontline font
void NXOpen::Preferences::PartObject::SetPartiallyShaded ( bool  partiallyShaded)

Sets the partially shaded flag for Solid and Sheets
Created in NX3.0.0.



License requirements : None

Parameters
partiallyShadedpartially shaded
void NXOpen::Preferences::PartObject::SetTranslucency ( int  translucency)

Sets the translucency value
Created in NX3.0.0.



License requirements : None

Parameters
translucencytranslucency
void NXOpen::Preferences::PartObject::SetWidth ( NXOpen::Preferences::PartObject::ObjectType  type,
NXOpen::Preferences::PartObject::WidthType  width 
)

Sets width for specified object type
Created in NX3.0.0.



License requirements : None

Parameters
typetype
widthwidth
tag_t NXOpen::Preferences::PartObject::Tag ( ) const

Returns the tag of this object.

int NXOpen::Preferences::PartObject::Translucency ( )

Returns the translucency value
Created in NX3.0.0.



License requirements : None


The documentation for this class was generated from the following file:
Copyright 2017 Siemens Product Lifecycle Management Software Inc. All Rights Reserved.