NXOpen: RGB of a DisplayableObject
NXOpen: RGB of a DisplayableObject
(OP)
According to the documentation, DisplayableObject has a Color property, but it's an index, and I'm not sure what it's an index into. I assume it's am index into a palette (maybe a CDF object), but I don't know how to access the palette for a given object.
I tried passing the Color property value to UF_DISP_ask_color as the clr_num parameter, but it returned an RGB value that didn't match the color on the screen.
This is for NX 8.0.3
Thanks.
I tried passing the Color property value to UF_DISP_ask_color as the clr_num parameter, but it returned an RGB value that didn't match the color on the screen.
This is for NX 8.0.3
Thanks.





RE: NXOpen: RGB of a DisplayableObject
Preferences -> Color Palettes...
...and at the bottom of the dialog, in the section labeled 'Options', select the 'Information' icon.
Or you can look at the CDF file specified at...
Customer Defaults -> gateway -> Visualization -> Color Palette
...but becareful because this does NOT necessarily represent the CDF file used in any particular part file, just the one that will be used if a new 'blank' part of created or will be used if you replace the CDF file in an open part with the current default, which can also be done from the 'Options' section of the Color Palette dialog. However, the scheme described above, selecting the 'Information' icon in the 'Options' section of the Color Palette dialog, will ALWAYS provide you the correct color data.
Not sure if this helps you all that much, but...
John R. Baker, P.E.
Product 'Evangelist'
Product Engineering Software
Siemens PLM Software Inc.
Industry Sector
Cypress, CA
Siemens PLM:
UG/NX Museum:
To an Engineer, the glass is twice as big as it needs to be.
RE: NXOpen: RGB of a DisplayableObject
Sketch entities may change display color depending on your preferences and the state of the sketch.
Components of an assembly add their own color complications.
www.nxjournaling.com
RE: NXOpen: RGB of a DisplayableObject
So given a face and a part, I can get the RGB components of a face like so:
ColorManager colors = part.Colors;
int color_index = face.Color;
NXColor color = colors.Find(color_index);
NXColor.Rgb components = color.GetRgb();
Thanks for the help.