[Solved] Layer scripting

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
pogocad
Junior Member
Posts: 16
Joined: Tue Dec 01, 2020 3:31 pm

[Solved] Layer scripting

Post by pogocad » Mon Mar 15, 2021 8:16 am

Hi,

I changed my background from black to white. Unfortunately some layer colors are now hard to see on the white background. So I am looking for a scripting example to alter the layer colors for my existinng drawings. Or does anyone know an easier way?

Regards

QCAD Professional
Version: 3.26.1.0 (3.26.1)
Build Date: Mar 8 2021
Revision: eec8166
Qt Version: 5.13.2
Architecture: x86_64
Last edited by pogocad on Tue Mar 16, 2021 11:21 am, edited 1 time in total.

User avatar
petevick
Premier Member
Posts: 392
Joined: Tue May 19, 2020 9:34 am
Location: North Norfolk coast UK

Re: Layer scripting

Post by petevick » Mon Mar 15, 2021 8:33 am

would the Color Adjustment setting help you in Application Preferences>Graphics View>Appearance :?:
Pete Vickerstaff
Linux Mint 21.2 Cinnamon, Qcad Pro 3.29.6

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

Re: Layer scripting

Post by CVH » Mon Mar 15, 2021 8:38 am

Hi,
for an example of a script that alters layer colors see the 'all in one' variant here:
https://qcad.org/rsforum/viewtopic.php?t=7865
This script has two stages as required by the user in the topic.
The first RModifyObjectsOperation changes any layer with 'whiteColor' to 'blackColor'

In your case that might test for more colors.
Color names or RGB values, names are SVG names ... CAD "green" = "lime" ...

Regards,
CVH

pogocad
Junior Member
Posts: 16
Joined: Tue Dec 01, 2020 3:31 pm

Re: Layer scripting

Post by pogocad » Tue Mar 16, 2021 11:20 am

Hi
thanks for the hint. The first part of the script does what i looking for.

Regards

Post Reply

Return to “QCAD Programming, Script Programming and Contributing”