Using addText to add text to drawing using ECMA script

Use this forum to ask questions about how to do things in QCAD.

Moderator: andrew

Forum rules
Always indicate Operating system, QCAD version
Attach Drawing files, Screenshots
Post one question per topic.
Post Reply
robdurant
Registered Member
Posts: 2
Joined: Mon Aug 05, 2019 5:12 pm

Using addText to add text to drawing using ECMA script

Post by robdurant » Mon Aug 05, 2019 5:21 pm

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

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

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

Post by andrew » Mon Aug 05, 2019 5:42 pm

Please refer to the QCAD Simple API reference at:
https://qcad.org/doc/qcad/latest/develo ... 38e26ad26d

robdurant
Registered Member
Posts: 2
Joined: Mon Aug 05, 2019 5:12 pm

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

Post by robdurant » Mon Aug 05, 2019 5:50 pm

Brilliant. I'd found a different API, but not this one. That's exactly what I was looking for.

Thanks

Rob

Post Reply

Return to “QCAD 'How Do I' Questions”