Page 1 of 1

Using addText to add text to drawing using ECMA script

Posted: Mon Aug 05, 2019 5:21 pm
by robdurant
Hi,

I've been scratching my head for a while now. I've written a script which successfully uses addSpline(v,"false") to add an array (v) of x,y coordinates as a curtate cycloid curve... that's all working, but now I want to add some labels to the curve... I've tried addText("SOME TEXT"); and addLabel("some text");, and various other incarnations, as I wondered whether I had the correct function name, but the wrong number of attributes... Each time I try to use it it responds with ...

ReferenceError: Can't find variable: addText
or
ReferenceError: Can't find variable: addLabel

Any help would be appreciated. I presume it needs coordinate values and text?

I'm running the script using the XC (Run Script) command.

Thanks

Rob

Re: Using addText to add text to drawing using ECMA script

Posted: Mon Aug 05, 2019 5:42 pm
by andrew
Please refer to the QCAD Simple API reference at:
https://qcad.org/doc/qcad/latest/develo ... 38e26ad26d

Re: Using addText to add text to drawing using ECMA script

Posted: Mon Aug 05, 2019 5:50 pm
by robdurant
Brilliant. I'd found a different API, but not this one. That's exactly what I was looking for.

Thanks

Rob