A way to apply color to layers, in bulk.

Discussion forum for C++ and script developers who are using the QCAD development platform or who are looking to contribute to QCAD (translations, documentation, etc).

Moderator: andrew

Forum rules

Always indicate your operating system and QCAD version.

Attach drawing files, scripts and screenshots.

Post one question per topic.

Post Reply
User avatar
Theoryshaw
Newbie Member
Posts: 4
Joined: Fri Aug 14, 2020 4:15 am

A way to apply color to layers, in bulk.

Post by Theoryshaw » Fri Jan 26, 2024 8:31 pm

Let's say you have 100 layers all assigned to the color white. Is there script or UI approach that could apply random colors to these layers, in bulk?

Or a mapping interface where you could have a text file with something like the following

Code: Select all

Layer Name X = Red
Layer Name Y = Green
Layer Name Z = Blue
...and run this in bulk?

CVH
Premier Member
Posts: 3480
Joined: Wed Sep 27, 2017 4:17 pm

Re: A way to apply color to layers, in bulk.

Post by CVH » Fri Jan 26, 2024 11:54 pm

Theoryshaw wrote:
Fri Jan 26, 2024 8:31 pm
Is there a (script or) UI approach that could apply random colors to these layers, in bulk?
Or a mapping interface where you could have a text file with something like the following
Yes these things are perfectly possible with scripting.
I don't see the purpose of random colors but how distinct should they be? QCAD supports 24bit colors.
There are 18 predefined CAD colors.

For mapping you list primary colors and for this you need those 100+ layer names.

Regards,
CVH

Post Reply

Return to “QCAD Programming, Script Programming and Contributing”