How to catch command from command line in a script

Discussion forum for C++ and script developers who are using the QCAD development platform or who are looking to contribute to QCAD (translations, documentation, etc).

Moderator: andrew

Forum rules

Always indicate your operating system and QCAD version.

Attach drawing files, scripts and screenshots.

Post one question per topic.

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 6240 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: 9037
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 Programming, Script Programming and Contributing”