QCAD.org Forum

Discussion forum for contributors and developers who are using the QCAD version 3 ECMAScript development platform or the C++ plugin interface or who are otherwise looking to contribute to QCAD (translations, documentation, etc).

Hello. My question is: can I run my script under Linux QCAD using Linux command prompt.Something like this. Print in terminal: “./qcad myscript.qs” And can the script executing without QCAD GUI? I need to make my drawing by printing specific command in linux command prompt without using GUI. So after script end his work I want to have my drawing at destination directory.

This basically replaces the default scripts/autostart.js with any custom script.

Under Mac OS X, one might also want to pass the -command-line-application switch to prevent the application from showing its icon in the dock. This switch has no effect on other platforms.

If you want to allow multiple instances of your application to run simultaneously, use the command line switch -allow-multiple-instances. By default, only one instance of an application can run at a time to prevent a situation in which multiple processes access the same data base, configuration file and other resources.

Hello, Andrew! Thanks a lot for your reply! But I have got errors during executing script.
I print in my ubuntu terminal this string:
./qcad_demo -autostart '/home/alf3/Downloads/qcad-2.2.2.0-1-demo.linux.x86/scripts/demo01.qs'

but error has become:
RS_FileIO::fileImport: failed to import file: /home/alf3/Downloads/qcad-2.2.2.0-1-demo.linux.x86/scripts/demo01.qs. No filter found.

and also appears qcad main window with warning message:
cannot open the file
home/alf3/Downloads/qcad-2.2.2.0-1-demo.linux.x86/scripts/demo01.qs
please check your access rights, the file format and file extension.

Please note that we're in the process of releasing QCAD 3 Beta 3 which will also contain dwg2pdf.sh, a bash script that launches the ECMAScript ./scripts/Tools/Dwg2Pdf/Dwg2Pdf.js. This might be a good starting point for your project.

That's looks great! It seems I found what I've looking for a long time.

And how much will be cost QCAD 3 Professional license?
Can i buy it right now?
And one more question: can I use qcad 3 on linux with no any GUI (like GNOME etc.) installed? Just Linux server with NO GRAPHICS. Simple command prompt.

Our project is to make a system, that will collect input data with request form on our site, send it on hosting server and brings to user back drawing of product in PDF format, making on his own parameters.

alf2006x wrote:And one more question: can I use qcad 3 on linux with no any GUI (like GNOME etc.) installed? Just Linux server with NO GRAPHICS. Simple command prompt.

That's an interesting question. You definitely need those GUI related libraries to be installed that QCAD links against. It's also possible that an X11 server has to be running under Linux. I cannot answer that for sure though. If you have a chance, please try this and report back if possible.

alf2006x wrote:Our project is to make a system, that will collect input data with request form on our site, send it on hosting server and brings to user back drawing of product in PDF format, making on his own parameters.

Sounds interesting. The QCAD ECMAScript interface was designed with such projects in mind.

alf2006x wrote:And one more question: can I use qcad 3 on linux with no any GUI (like GNOME etc.) installed? Just Linux server with NO GRAPHICS. Simple command prompt.

Hello Alf, that really looks interesting. While installing X11 should not be a problem, I don't think the qt libraries that qcad links against will do without a DISPLAY available. A quick search turned out among others these relevant, but very old, links:

But my situation is much more tough.
I work in Linux only last week, since we make our desision to start that project. I have never use any NIX-system before.
Anyway I must do this. So I hope you will not leave me along with my task.

Alf, then you are in for some learning. The technical term for a system as you describe is "headless". In order to test headless QCAD you do not need to set up a computer in this way, all you have to do in a terminal is to clear the DISPLAY variable from the environment, before launching QCAD:

Especially, QCAD would need a switch to delay initialization of the X server connection. The question is, how much of the CAD and scripting functionality will be available without that connection. This would also be good for turnaround time, between calling the app and receiving results.

Very likely, there are ways around, eg with xvfb. Refer to this blog post as an example: http://blog.kagesenshi.org/2007/06/runn ... using.html - keep in mind, that if you process requests from anywhere on the web, a setup like this needs to be secured against malicious uses.

Andrew, that is the best news for me! Thank you very very much!
My task becomes easier because I already have working script wich works under Windows and uses Autocad 2010 to make drawings.
All I have to do is scrupulously rewriting my script.

And can you see the list of command, used in my windows script to tell me is every one will work on headless QCAD 3 Beta 3 ? Now I will collect all commands in the list.