Good scripting tutorial

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

Moderator: andrew

Forum rules

Always indicate your operating system and QCAD version.

Attach drawing files and screenshots.

Post one question per topic.

Post Reply
fakeuser
Newbie Member
Posts: 5
Joined: Mon Nov 23, 2020 4:49 pm

Good scripting tutorial

Post by fakeuser » Mon Nov 23, 2020 4:57 pm

Hi,

is there a good scripting tutorial / book? The only thing i have is the sourcecode without any explanations of which code does what. In the QCAD book there is also nothing about scripting.

Thanks

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

Re: Good scripting tutorial

Post by CVH » Mon Nov 23, 2020 5:31 pm

Hi,

Yes but NO
All starts with javascript (Early version) or better ECMAScript

https://qcad.org/en/qcad-scripting
https://qcad.org/en/tutorial-script-programming

Many examples.
Scripts are mostly included in an installation in compiled form.
A fairly complete source apart from PRO scripts is github : https://github.com/qcad/qcad
What every script does is fairly self-explanatory.
I have a full download aside for reference.
It is not necessary to install them under QCAD (Rather counterproductive)

All the classes are documented here: https://www.qcad.org/doc/qcad/latest/de ... tated.html
Although that can be mince. After some months you get the hang of it.
The search button is my friend there.

Trial and error is a way.
NPP can search in all files in a folder, in all *.js, all *.ui or simply all.
Crawling through a copy of all masters with NPP reveals many methods.

Most questions get answered on the forum.

Regards,
CVH

fakeuser
Newbie Member
Posts: 5
Joined: Mon Nov 23, 2020 4:49 pm

Re: Good scripting tutorial

Post by fakeuser » Mon Nov 23, 2020 10:44 pm

Thanks. I knew all the sites you gave me before. The only thing i did not check was the classes (class list). I see that the event handlers are documented. Thats the most important thing.

By the way: I come from Java, C/C++, C#, PHP, JavaScript and i studied computer science. I did not have the impression that the scripts are self-explanatory. Some parts of it are, but others not.

Post Reply

Return to “QCAD 'How Do I' Questions”