I can create a dxf file with a script but when i try to specify a Lineweight the script fails at this line:
myLine.setLineweight(RLineweight::Weight100);
How should i adjust the line weight?
I am using qcad-3.27.5-pro-linux-x86_64.tar.gz on Ubuntu 20.04.3 LTS, command line.
Code: Select all
var spatialIndex = new RSpatialIndexSimple();
var document = new RDocument(storage, spatialIndex);
var di = new RDocumentInterface(document);
var operation = new RAddObjectsOperation();
var p1 = new RVector(7, 5);
var p2 = new RVector(10, 0);
var p3 = new RVector(5, Math.sin(RMath.deg2rad(60))*10);
var myLine = new RLineEntity(document, new RLineData(p1, p2));
myLine.setColor(new RColor("blue"));
myLine.setLineweight(RLineweight::Weight100) // Fails at this line RScriptHandlerEcma::eval: script engine exception: "SyntaxError: Parse error"
operation.addObject(myLine);
operation.addObject(new RLineEntity(document, new RLineData(p2, p3)));
operation.addObject(new RLineEntity(document, new RLineData(p3, p1)));
operation.apply(document);
di.exportFile("test-out-02.dxf", "DXF 2000");