Search found 160 matches

by hungerburg
Thu Oct 20, 2011 2:03 pm
Forum: QCAD Programming, Script Programming and Contributing
Topic: executing script at terminal command prompt
Replies: 62
Views: 158567

I would like to further expand the tutorial text:

Code: Select all

var td = new RTextData();
td.setText("QCAD rocks");
td.setTextHeight(1);
td.setPosition(p1);
operation.addObject(new RTextEntity(document, td));
Pasting this before the operation gets applied will write this flattering line - because it is true :)
by hungerburg
Thu Oct 20, 2011 1:15 pm
Forum: QCAD Programming, Script Programming and Contributing
Topic: executing script at terminal command prompt
Replies: 62
Views: 158567

include("scripts/ImportExport/SvgExporter/SvgExporterPG.js"); var exporter = new SvgExporterPG(document, { "scale": "10:1"}); exporter.exportFile("example.svg"); Obviously, this will fail when -no-gui was called for. Below patch helps though: --- SvgExporter.js~ 2011-10-20 14:11:45.527589416 +0200 ...
by hungerburg
Thu Oct 20, 2011 12:36 pm
Forum: QCAD Programming, Script Programming and Contributing
Topic: executing script at terminal command prompt
Replies: 62
Views: 158567

Alf, this might be off-topic, but I think it may be of use for you: In many places SVG can do, what you want PDF for… So if you paste these lines to the bottom of example.js, QCAD will write an SVG representation of the drawing: include("scripts/ImportExport/SvgExporter/SvgExporterPG.js"); var expor...
by hungerburg
Thu Oct 20, 2011 11:20 am
Forum: QCAD Programming, Script Programming and Contributing
Topic: executing script at terminal command prompt
Replies: 62
Views: 158567

Alf, previous post was general advise. This time I suggest: compare the contents of example.js with the text of the howto. I am sure you will find that they dont match.
by hungerburg
Thu Oct 20, 2011 11:11 am
Forum: QCAD Programming, Script Programming and Contributing
Topic: executing script at terminal command prompt
Replies: 62
Views: 158567

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 sc...
by hungerburg
Thu Oct 20, 2011 12:06 am
Forum: QCAD Programming, Script Programming and Contributing
Topic: executing script at terminal command prompt
Replies: 62
Views: 158567

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 ...
by hungerburg
Fri Oct 14, 2011 8:23 pm
Forum: QCAD Programming, Script Programming and Contributing
Topic: executing script at terminal command prompt
Replies: 62
Views: 158567

I immediately had to try this, and it works. And its FAST -- QCAD rocks! :) $ time DISPLAY="" qcad3 -no-gui -autostart scripts/date.js #77-Ubuntu SMP Tue Sep 13 19:39:17 UTC 2011 x86_64 real 0m0.209s user 0m0.240s sys 0m0.000s :) $ The smileys prompt above come from this .bashrc/.profile command: sm...
by hungerburg
Fri Oct 14, 2011 12:30 pm
Forum: QCAD Programming, Script Programming and Contributing
Topic: executing script at terminal command prompt
Replies: 62
Views: 158567

headless QCAD

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: unset...
by hungerburg
Tue Oct 11, 2011 12:43 pm
Forum: QCAD Programming, Script Programming and Contributing
Topic: executing script at terminal command prompt
Replies: 62
Views: 158567

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 wil...
by hungerburg
Mon Oct 03, 2011 12:32 pm
Forum: QCAD Programming, Script Programming and Contributing
Topic: External SVG to PDF rendering
Replies: 0
Views: 6936

External SVG to PDF rendering

One may export SVG with preserve geometry ticked, and then render SVG to PDF etc. Best results with apache FOP and below stylesheet: fop -xsl fo.xsl -xml Skizze.svg -pdf Skizze.pdf fop -xsl fo.xsl -xml Skizze.svg -png Skizze.png -dpi 150 Width and height are taken from the SVG. <?xml version="1.0" e...
by hungerburg
Wed Sep 28, 2011 3:26 pm
Forum: QCAD Programming, Script Programming and Contributing
Topic: Script file charset
Replies: 1
Views: 7055

Script file charset

In my script there are data structures that are visible to users. I want to have german umlauts in there. QCAD windows and QCAD linux use different charsets. All recent linux enviromnents default to utf-8, while windows (even 7) use something different. How can I have umlauts display right in both w...
by hungerburg
Tue Sep 27, 2011 9:57 am
Forum: QCAD Programming, Script Programming and Contributing
Topic: Reloading of Script before execution
Replies: 5
Views: 14801

QCAD3 rocks

Ahh, this is good news for people like me, that follow a very iterative approach to development - Thank You. I tried now calling a script from commandline with the name specified for such occasions in the "beginEvent", but get this Warning: RGuiAction::getByScriptFile: no action found: "MyScript". U...
by hungerburg
Mon Sep 26, 2011 3:09 pm
Forum: QCAD Programming, Script Programming and Contributing
Topic: Reloading of Script before execution
Replies: 5
Views: 14801

Reloading of Script before execution

Andrew, how do you do it, that a script gets reloaded from file on each execution? The first custom script, the one that is called from the menu or button, will be reloaded each time, if the "beginEvent" hook ends with a "delete Foo" statement, Foo being the name of the class itself. But classes ins...
by hungerburg
Thu Sep 15, 2011 10:52 am
Forum: QCAD Programming, Script Programming and Contributing
Topic: Example serializing object to XML
Replies: 0
Views: 6598

Example serializing object to XML

If one wants to persist some data to disk, the qt json serializer is most useful. Sometimes one may want to store some data in xml, below code can be useful then, that I want to share. Its very simple and might not handle everybodies requirements though. /** Objekt in XML Datei schreiben. * Erwartet...
by hungerburg
Wed Aug 17, 2011 10:38 am
Forum: dxflib Troubleshooting and Problems
Topic: Ubuntu LTS 10.04 Compile Issue
Replies: 3
Views: 31047

Never built dxflib, but reading the error message, you are missing an include. On my same ubuntu system "man strcasecmp" tells me, its "#include <strings.h>". that should fix the other str... failures too. Try and put that statement into "src/dl_writer_ascii.h".
--
peter

Go to advanced search