addSimpleText - need help

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

Moderator: andrew

Post Reply
JSRoy
Junior Member
Posts: 11
Joined: Fri Sep 22, 2017 9:28 pm

addSimpleText - need help

Post by JSRoy » Mon Feb 25, 2019 2:56 am

Hi all,

Maybe its late and my brain is not functioning properly, but I'm having a lot of problems using addSimpleText.

I am trying to use it in its simplest form:

Code: Select all

addSimpleText('test', 0, 0);
This gives me the following error:
Script exception in script '/home/jsroy/Documents/qcadScriptTest2.js': Error: : -1: -1: RTextData(): no matching constructor found. <native>(1, 1, 1, 100, 0, 0, 1, 2, 1, 'test', 'Standard', false, false, 0, true) at -1 addSimpleText(text = 'test', position = 1, height = 1) at /home/jsroy/opt/qcadcam-3.17.3-pro-linux-x86_64/scripts/simple_create.js:-1 anonymous() at 36 <anonymous>() at scripts/Misc/MiscDevelopment/RunScript/RunScript.js:117 <eval>() at 1 <native>() at -1 main() at scripts/autostart.js:769 <global>() at scripts/autostart.js:782

Any help would be appreciated.

Thank you,

Jean-Sebastien Roy

User avatar
andrew
Site Admin
Posts: 6502
Joined: Fri Mar 30, 2007 6:07 am

Re: addSimpleText - need help

Post by andrew » Mon Feb 25, 2019 10:24 am

This set of parameters is currently not supported.

Instead, try:

Code: Select all

addSimpleText('test', [0, 0]);
or:

Code: Select all

addSimpleText('test', new RVector(0, 0));
or the full set of parameters:

Code: Select all

addSimpleText('test', 0, 0, height, angle, font, vAlign, hAlign, bold, italic);

JSRoy
Junior Member
Posts: 11
Joined: Fri Sep 22, 2017 9:28 pm

Re: addSimpleText - need help

Post by JSRoy » Tue Feb 26, 2019 3:16 pm

Thank you Andrew. That fixed my problem :)

Post Reply

Return to “QCAD Developers and Contributors”