I'm trying to change an attribute display from off to "value".
Each design component has its own attribute containing the Farnell reference. For manual mounting, I would like to show this attribute on the board layout.
I've tried to make this script:
string strCmd; // script command text
output("sample.txt","wt")
{
board(B) {
strCmd = "";
B.elements(E) {
E.attributes(A) {
if(A.name=="FARNELL")
{
string tmp,strAttrValue;
sprintf(tmp, "ATTRIBUTE %s FARNELL DELETE;\n",E.name);
strCmd += tmp;
sprintf(tmp, "CHANGE DISPLAY VALUE;\n");
strCmd += tmp;
strAttrValue=A.value;
sprintf(tmp, "ATTRIBUTE %s FARNELL '%s';\n", E.name, strAttrValue);
strCmd += tmp;
}
}
}
printf("%s\n",strCmd);
exit(strCmd);
}
}
Unfortunately the attribute must be deleted on a schematic !
If I just add the attribute with same datas and a different display data, it won't be updated.
Have you got any solution to update a display attribute in script ?
Thanks in advance,
Luc