Hi Everyone,
This is my first forum post. I’ve been using QCAD for about 10 years for 2D mechanical design and love the interface. So intuitive. Thank you all for the support.
I have also used the QCAD V2.1 Script IDE to draw intricate layouts for optical calibration targets. I wrote a program that writes a .qs file containing tens of thousands of lines and arcs to create the .DXF file needed create the optical target itself. Below is a sample .qs (QCAD script input) file with most of the repetition removed.
I’m not sure where to post this questions as there seems to be another use of the word Script in the QCAD community related to extending the user interface with plug ins and such. This questions is all about running a script to create a drawing using QCAD and the Script IDE in the banner line of QCAD V2.1.
The actual question(s):
- How do I run script files (.qs) in QCAD V3. I can’t find an equivalent to the Script IDE from V2 that would allow me to load and run the example below.
- My real need is to add text to my optical calibration files and thus as commands in my script file. I can’t find the document that I learned how to draw lines and arcs when I originally developed this about 8 years ago. I’m happy to continue using QCAD V2 for this if this concept is no longer supported in V3, but need the syntax for drawing text.
Thank you,
Todd
– example script file Test.qs
function main()
{
var doc;
var view;
doc = new Document;
pen = new Pen(255, 255, 255, 0);
doc.setActivePen(pen);
view = new View;
var line = new Line(doc, -21.797096, -21.817531, -21.817531, -21.797096);
doc.addEntity(line);
var arc = new Arc(doc, +31.500000, +43.050000, +0.938000, +0.000000, +0.000000, 1);
doc.addEntity(arc);
var line = new Line(doc, +29.398050, +11.700050, +34.836050, +17.116950);
doc.addEntity(line);
.
. cut out commands for 10,000 more lines and arcs
.
var line = new Line(doc, +366.836050, +349.117050, +372.399950, +354.680950);
doc.addEntity(line);
view.redraw();
}