Skip to content

layer color change not applied to all entities in the same layer #219

Description

@ezhil-metagibs

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.

Image

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!

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions