executing script at terminal command prompt
Moderator: andrew
Forum rules
Always indicate your operating system and QCAD version.
Attach drawing files, scripts and screenshots.
Post one question per topic.
Always indicate your operating system and QCAD version.
Attach drawing files, scripts and screenshots.
Post one question per topic.
The full list of command in my windows script is below:
line
rectang
circle
ellipse
arc
copybase
pasteblock
fillet
chamfer
rotate
scale
trim
extend
erase
mirror
move
-color
-hatch
-linetype
ltscale
dimlinear
dimangular
dimaligned
zoom
-mtext
-text
hungerburg, may I ask you to make a simple script wich will use maximum of theese commands to make a drawind, and save the drawing in script locate folder or in any other filder. I see you very good linux and QCAD user.
line
rectang
circle
ellipse
arc
copybase
pasteblock
fillet
chamfer
rotate
scale
trim
extend
erase
mirror
move
-color
-hatch
-linetype
ltscale
dimlinear
dimangular
dimaligned
zoom
-mtext
-text
hungerburg, may I ask you to make a simple script wich will use maximum of theese commands to make a drawind, and save the drawing in script locate folder or in any other filder. I see you very good linux and QCAD user.
hungerburg, andrew please help me. I understand, that this is maybe my arrogance to ask you write some scripts. But I begin to get confused. Almost get lost.
If you can - just write the script, wich draws two lines
line (0,0) - (50,50)
line (50,50) - (0,100)
and makes a chamfer (or fillet) between this lines
and save this drawing as pdf anywhere.
Thanks in advance.
If you can - just write the script, wich draws two lines
line (0,0) - (50,50)
line (50,50) - (0,100)
and makes a chamfer (or fillet) between this lines
and save this drawing as pdf anywhere.
Thanks in advance.
Rather than posting large pieces of code to this forum, we are continuously updating our API documentation and howtos.
Here's a howto about creating a drawing document in a command line application and adding three lines that form a triangle. The drawing is also saved to a DXF file:
http://www.ribbonsoft.com/doc/qcad/3.0/ ... awing.html
More will follow...
Here's a howto about creating a drawing document in a command line application and adding three lines that form a triangle. The drawing is also saved to a DXF file:
http://www.ribbonsoft.com/doc/qcad/3.0/ ... awing.html
More will follow...
I tried to run script from link, byt something is wrong with it (please look at my log below).
Then I comment the last row: di.exportFile("example.dxf", "DXF 2000");
Then no any errors arrived.
But I can't get result file.
alf3@ubuntu:~/Downloads/qcad-3.0.0-beta3-trial-linux$ DISPLAY="" ./qcad-trial -no-gui -autostart '/home/alf3/Downloads/example.js'
#50-Ubuntu SMP Mon Sep 12 21:18:14 UTC 2011
i686
RDwgExporter::exportDocumentSettings
RDwgExporter::addXData: "Grid/DisplayGrid" : QVariant(bool, true)
RDwgExporter::setXData
type name: bool
"ANGBASE"
"ANGDIR"
"ATTMODE"
"AUNITS"
...
"VISRETAIN" false
"WORLDVIEW" false
alf3@ubuntu:~/Downloads/qcad-3.0.0-beta3-trial-linux$
Then I comment the last row: di.exportFile("example.dxf", "DXF 2000");
Then no any errors arrived.
But I can't get result file.
alf3@ubuntu:~/Downloads/qcad-3.0.0-beta3-trial-linux$ DISPLAY="" ./qcad-trial -no-gui -autostart '/home/alf3/Downloads/example.js'
#50-Ubuntu SMP Mon Sep 12 21:18:14 UTC 2011
i686
RDwgExporter::exportDocumentSettings
RDwgExporter::addXData: "Grid/DisplayGrid" : QVariant(bool, true)
RDwgExporter::setXData
type name: bool
"ANGBASE"
"ANGDIR"
"ATTMODE"
"AUNITS"
...
"VISRETAIN" false
"WORLDVIEW" false
alf3@ubuntu:~/Downloads/qcad-3.0.0-beta3-trial-linux$
- hungerburg
- Premier Member
- Posts: 160
- Joined: Fri May 28, 2010 7:35 pm
hello Alf,
where did you look for the file "example.dxf"? I found it in /opt/qcad3, because this is where I installed qcad3. (That's called the "working directory" of the application. Unfortunately this is different from the "current directory", the one where I issue the command…)
You will not find it though, if you comment the line that saves the drawing to file Maybe make the line read "di.exportFile("/home/alf/example.dxf", "DXF 2000");" to have it created in your home directory, if you go by the name "alf" on your system…
where did you look for the file "example.dxf"? I found it in /opt/qcad3, because this is where I installed qcad3. (That's called the "working directory" of the application. Unfortunately this is different from the "current directory", the one where I issue the command…)
You will not find it though, if you comment the line that saves the drawing to file Maybe make the line read "di.exportFile("/home/alf/example.dxf", "DXF 2000");" to have it created in your home directory, if you go by the name "alf" on your system…
hello, hungerburg
that is fantastic! i've found my example.dxf file in qcad directory! that wasn't , that was log.
but now it dont work again.
first it writes an error:
alf3@ubuntu:~/Downloads/qcad-3.0.0-beta3-trial-linux$ time DISPLAY="" ./qcad-trial -no-gui -autostart '/home/alf3/Downloads/example.js'
#50-Ubuntu SMP Mon Sep 12 21:18:14 UTC 2011
i686
RFileExporterRegistry::getFileExporter: No suitable exporter found
real 0m1.398s
user 0m0.340s
sys 0m0.256s
then i goes to site again, copy text of script and make my new file example.js
but now it writes this:
alf3@ubuntu:~/Downloads/qcad-3.0.0-beta3-trial-linux$ time DISPLAY="" ./qcad-trial -no-gui -autostart '/home/alf3/Downloads/example.js'
#50-Ubuntu SMP Mon Sep 12 21:18:14 UTC 2011
i686
QWidget: Cannot create a QWidget when no GUI is being used
./qcad-trial: строка 39: 15328 Аварийный останов LD_LIBRARY_PATH="$DIR" "$binary" $OPT1 $OPT2 "$@"
real 0m0.522s
user 0m0.232s
sys 0m0.132s
i cant understand anything . what was happend?
that is fantastic! i've found my example.dxf file in qcad directory! that wasn't , that was log.
but now it dont work again.
first it writes an error:
alf3@ubuntu:~/Downloads/qcad-3.0.0-beta3-trial-linux$ time DISPLAY="" ./qcad-trial -no-gui -autostart '/home/alf3/Downloads/example.js'
#50-Ubuntu SMP Mon Sep 12 21:18:14 UTC 2011
i686
RFileExporterRegistry::getFileExporter: No suitable exporter found
real 0m1.398s
user 0m0.340s
sys 0m0.256s
then i goes to site again, copy text of script and make my new file example.js
but now it writes this:
alf3@ubuntu:~/Downloads/qcad-3.0.0-beta3-trial-linux$ time DISPLAY="" ./qcad-trial -no-gui -autostart '/home/alf3/Downloads/example.js'
#50-Ubuntu SMP Mon Sep 12 21:18:14 UTC 2011
i686
QWidget: Cannot create a QWidget when no GUI is being used
./qcad-trial: строка 39: 15328 Аварийный останов LD_LIBRARY_PATH="$DIR" "$binary" $OPT1 $OPT2 "$@"
real 0m0.522s
user 0m0.232s
sys 0m0.132s
i cant understand anything . what was happend?
- hungerburg
- Premier Member
- Posts: 160
- Joined: Fri May 28, 2010 7:35 pm
Yes, that is really strange. Things should not fail inconsistently.
So you did modify example.js and it stopped working? You then replaced the contents of example.js with the text from the howto? and it still doesnt work.
Perhaps you changed something else? If you cannot remember, just start from scratch. Unpack the qcad archive again. Try with different arguments. What widget will be created, if you allow that? Etc.
As a developer, you have to be very careful in what you are doing. Best practice was, to note every move you make.
So you did modify example.js and it stopped working? You then replaced the contents of example.js with the text from the howto? and it still doesnt work.
Perhaps you changed something else? If you cannot remember, just start from scratch. Unpack the qcad archive again. Try with different arguments. What widget will be created, if you allow that? Etc.
As a developer, you have to be very careful in what you are doing. Best practice was, to note every move you make.
- hungerburg
- Premier Member
- Posts: 160
- Joined: Fri May 28, 2010 7:35 pm