How to catch command from command line in a script

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
dzenita
Newbie Member
Posts: 6
Joined: Thu Oct 19, 2017 2:34 pm

How to catch command from command line in a script

Post by dzenita » Mon Nov 27, 2017 3:54 pm

Hi all,

QCad has support for drawing lines, circles via command line like this :

2017-11-27 15_39_08-Untitled 1 _ - QCAD.png
2017-11-27 15_39_08-Untitled 1 _ - QCAD.png (13.99 KiB) Viewed 2243 times
but how can we draw line using one row, one step, using command like this --> line (10;10 , 20;20)

And how to catch command from command line in a script ?
I have some custom functions which I should call from command line with parameters in one row, is that possible. I am using QCad 3.19.1 version.


Thanks,
Dzenita

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

Re: How to catch command from command line in a script

Post by andrew » Mon Nov 27, 2017 4:48 pm

You might want to use the script shell for this:

View > Toolbars > Script Shell

Code: Select all

addLine(10,10, 20,20);

Code: Select all

for (i=0; i<10; i++) { addLine(10,i*10, 20,i*10); }
See also:
https://www.qcad.org/doc/qcad/latest/de ... imple.html

dzenita
Newbie Member
Posts: 6
Joined: Thu Oct 19, 2017 2:34 pm

Re: How to catch command from command line in a script

Post by dzenita » Wed Nov 29, 2017 1:19 pm

Great, thanks a lot Andrew.

Best regards,
Dzenita

Post Reply

Return to “QCAD Developers and Contributors”