All,
I am having issues using a report to read the Color/Style of attributes from an occurrence in a model. I am trying to determine if the name of the object is in Red, Black, or another color. My current code is shown below.
function getFontColor(oOccDef)
{
//Get the attribute definition from the current object occurrence
var Attr_Occ = oOccDef.AttrOcc(Constants.AT_Name);
//Get the color of the font from the attribute
var Attr_Font_Color = Attr_Occ.getFontStyleSheet().Font(nLocale).Color();
return Attr_Font_Color;
}
However, regardless of the color of the font, the return value is always '0'.
Please advise on any action I could take to remedy this issue.
Thank you!
Matias Kokko on
Hi,
Is the attribute formatted on the occurrence level (by using the database font formats), or is it formatted on the definition level? i.e. can you see the formatting in the object properties? If formatting is on a definition level you need to use Attr.getHTMLFormattedValue.getHTML() to get the formatting.