I'm writing a script for changing layers of all texts and dimensions simultaneously:
Code: Select all
var di = this.getDocumentInterface();
var document = this.getDocument();
var op = new RModifyObjectsOperation();
var entitiesIds = document.queryAllEntities(false, false);
for (var i=0; i<entitiesIds.length; i++) {
entityId = entitiesIds[i];
entity = document.queryEntity(entityId);
if (isDimensionEntity(entity)) {
entity.setLayerName("dim.");
entity.update();
op.addObject(entity)
}
else if (isTextEntity(entity)) {
entity.setLayerName("ret.");
entity.update();
op.addObject(entity)
}
} // looping ends
di.applyOperation(op);
Any help will be very welcomed. Best regards!
David