Page 1 of 1

addSimpleText - need help

Posted: Mon Feb 25, 2019 2:56 am
by JSRoy
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

Re: addSimpleText - need help

Posted: Mon Feb 25, 2019 10:24 am
by andrew
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);

Re: addSimpleText - need help

Posted: Tue Feb 26, 2019 3:16 pm
by JSRoy
Thank you Andrew. That fixed my problem :)

Re: addSimpleText - need help

Posted: Tue Apr 07, 2020 10:22 pm
by dfriasb
Maybe I'm typing wrong, but full set of parameters is not working for me:

Code: Select all

addSimpleText('test', 0, 0, 0.15, 45, "Standard", "VAlignMiddle", "HAlignCenter", false, false)
Any help will be appreciated. Regards,
David.

Re: addSimpleText - need help

Posted: Wed Apr 08, 2020 8:43 am
by andrew

Code: Select all

addSimpleText("test", 0,0, 0.15, 45, "Standard", RS.VAlignMiddle, RS.HAlignCenter, false, false);