1、打开dxf文件,默认已有图层layer 1
2、手动新建图层layer 2
3、鼠标点选图元,属性页,修改它的图层序号
4、图元的颜色
\libs\qcadcore
/**
* \return CAD index of this color used in MTEXT strings.
*/
int RColor::getColorIndex() const {
if (isByBlock()) {
return 0;
}
if (isByLayer()) {
return 256;
}
for (int i=1; i<255; i++) {
if (red()==RMath::mround(cadColors[i][0]*255) &&
green()==RMath::mround(cadColors[i][1]*255) &&
blue()==RMath::mround(cadColors[i][2]*255)) {
return i;
}
}
return -1;
}
int RColor::getCustomColorCode() const {
return (red() << 0) + (green() << 8) + (blue() << 16);
}