Script Shell command does not do anything

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
GMOURRAL
Registered Member
Posts: 2
Joined: Fri Jan 30, 2026 7:41 am

Script Shell command does not do anything

Post by GMOURRAL » Fri Jan 30, 2026 8:34 am

Hello,
OS Windows 11 family
QCAD version 3.25.0.1
I wanted to the Script shell to automate some drawings.
I read the different tutorials, however when I tried to apply what I read, nothing happened. I searched through the different topics of the forum, but could not find anything relevant for my issue .
Here is what I did :
Menu Miscellaneous/development/Shell script
The shell script windows opens, displaying ecma>
I enter addLine(0,0,100,100), press the Enter key
Nothing happens : no line is displayed !
I must be missing something quite simple, as nobody has any issue with using the script shell.

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

Re: Script Shell command does not do anything

Post by CVH » Fri Jan 30, 2026 9:53 am

Hi, and welcome to the QCAD forum.

Code: Select all

addLine(0,0,100,100);
With 4 values should draw a line from (0.0, 0.0) to (100.0, 100.0)
It is an instruction of the Simple API.
Scripting uses the comma as list separator ... That wouldn't be an issue when locally the semicolon is in use.

If nothing is drawn we expect a warning message on the Command Line history.
For example when the current active layer is locked, frozen or hidden.
  • Transaction failed. Please check for block recursions and locked or invisible layers or blocks.
But attempting that with a locked layer crashes QCAD at my side (Win7 32bit QCAD 3.27.6 & QCAD 3.32.4)

With the GUI we might assume that the simple API is loaded but it doesn't hurt to be sure.
We then include simple.js so that the addLine method exists:

Code: Select all

include("scripts/simple.js");
addLine(0,0,100,100);
Works just fine in both versions.

I didn't test it with the 3.25.0.1 release but assume that it should work just like always.
Note that this is an older snapshot release (>2020/08/20 - 2020/08/31), current stable art is 3.32.6

Can anyone attempt this under the latest release and attempt the crash?
Crashing can be considered as a bug.

Regards,
CVH

GMOURRAL
Registered Member
Posts: 2
Joined: Fri Jan 30, 2026 7:41 am

Re: Script Shell command does not do anything

Post by GMOURRAL » Fri Jan 30, 2026 6:57 pm

I also assumed the simple API was already loaded but it was not such a case.
I included simple.js and it worked fine.
Thank you for your help.
Regards

Post Reply

Return to “QCAD 'How Do I' Questions”