Hi,
How can I remove a layer, and set an other one as current layer in the same operation.
Thanks
Doing layer changes in one operation
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.
Re: Doing layer changes in one operation
Delete layer "layer 1" and make layer "layer 3" the current layer:
Code: Select all
var document=getDocument();
var documentInterface=getDocumentInterface();
var op = new RAddObjectsOperation();
op.deleteObject(document.queryLayer("layer 1"));
var docVars = document.queryDocumentVariables();
docVars.setCurrentLayerId(document.getLayerId("layer 3"));
op.addObject(docVars);
documentInterface.applyOperation(op);