Hi mlightcad team,
I'm currently exploring the CAD simple viewer and building a small project.
I'm trying to change the color of the "ROAD" layer using the following code:
colorPicker.onchange = () => {
const value = colorPicker.value;
const color = new AcCmColor();
color.setRGBFromCss(value);
const db = AcApDocManager.instance.curDocument.database;
const dbLayer = db.tables.layerTable.getAt(layer.name);
if (dbLayer) {
dbLayer.color = color;
}
};
However, the color update only affects some entities.
For reference, in the attached image, the red double line represents the road. When I change the layer color to green, only the text entities are updated, while the linework and other objects on the same layer are not affected.
Could you please help me understand why this is happening, or if I'm missing a step to apply the color change to all entities on the layer?
Thanks!
Hi mlightcad team,
I'm currently exploring the CAD simple viewer and building a small project.
I'm trying to change the color of the "ROAD" layer using the following code:
colorPicker.onchange = () => {
const value = colorPicker.value;
};
However, the color update only affects some entities.
For reference, in the attached image, the red double line represents the road. When I change the layer color to green, only the text entities are updated, while the linework and other objects on the same layer are not affected.
Could you please help me understand why this is happening, or if I'm missing a step to apply the color change to all entities on the layer?
Thanks!