ExSetColor.js script issue

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
WildWolfCJ
Full Member
Posts: 84
Joined: Fri Oct 20, 2023 7:21 am

ExSetColor.js script issue

Post by WildWolfCJ » Tue Nov 14, 2023 3:57 am

QCAD 3.28.2 pro windows10

I'm learning to debug the ExSetColor.js script using .\qcadcmd.com -enable-script-debugger -autostart .\scripts\Misc\Examples\CommandLineExamples\ExSetColor\ExSetColor.js D:\software\QCAD3.28License-20231026\qcad -3.28.2-pro-win64-2\qcad-3.28.2-pro-win64\scripts\Misc\Examples\CommandLineExamples\ExSetColor\test.dxf D:\test1.dxf prompt Warning: RScriptHandlerEcma::eval: script engine exception: "ReferenceError: Can't find variable: getOpt"
I searched the API documentation to no avail and couldn't find the getOpt definition.

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

Re: ExSetColor.js script issue

Post by CVH » Tue Nov 14, 2023 7:03 am

WildWolfCJ wrote:
Tue Nov 14, 2023 3:57 am
I searched the API documentation to no avail and couldn't find the getOpt() definition.
You are correct, I think this is deprecated.
(Commented out in RScriptHandlerEcma.srcml)

Other (active) Command Line tools include scripts/Tools/arguments.js to handle command line arguments.

Over to Andrew.

Regards,
CVH

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

Re: ExSetColor.js script issue

Post by CVH » Mon Nov 27, 2023 11:59 am

On Nov 19, 2023 Andrew ported ExSetColor.js to use arguments.js

This fix is not immediate and is most likely included in upcoming releases.
For evaluating this example script meanwhile you may want to source it directly from GitHub:
https://github.com/qcad/qcad/blob/maste ... etColor.js

Regards,
CVH

Post Reply

Return to “QCAD Programming, Script Programming and Contributing”