Hello and thank you for your time.
First of all, just let me say that the product you made is amazing and has been really helpful in the project I am working on.
I am wrecking my head around scripting some processes. In one of those, I need to export from DXF to PDF by tunning some PaperSpace parameters on the fly, so I wrote my own script from scratch. Everything runs fast and smoothly, although when printing the resulting file, lines are way too thin. In order to fix that, I added the following chunk of code changing LineWeight for the only existing layer:
var op = new RModifyObjectsOperation();
var layer = document.queryLayer("0");
qDebug("LW", layer.getLineweight()) // -3
layer.setLineweight(211);
op.addObject(layer);
di.applyOperation(op);
qDebug("LW", layer.getLineweight()) // 211
// Make sure changes are made
var layer = document.queryLayer("0");
qDebug("LW changed", layer.getLineweight()) // 211
While the code gives no errors, the resulting pdf still shows thin lines when printed. I would really appreciate some guidance here
Thanks again,
Pere
LineWeight Scripting
Moderator: andrew
Forum rules
Always indicate your operating system and QCAD version.
Attach drawing files and screenshots.
Post one question per topic.
Always indicate your operating system and QCAD version.
Attach drawing files and screenshots.
Post one question per topic.
Re: LineWeight Scripting
Must have messed up somewhere, code works perfect now. However, please let me ask one last thing.
In the code above I am manually changing the LW for one specific layer. Is there a way to change the global default value of every layer without needing to iterate over all of them?
Thanks again,
Pere
In the code above I am manually changing the LW for one specific layer. Is there a way to change the global default value of every layer without needing to iterate over all of them?
Thanks again,
Pere
Last edited by pmbrull on Mon Aug 27, 2018 8:22 am, edited 1 time in total.
Re: LineWeight Scripting
No, there's no "global" line weight.