Seems I am a little confused by RAddObjectsOperation and RAddObjectOperation. In fact I only use the first plural one and never the second singular one.
These operations I call from helper functions, that draw geometric primitives, that create both operation and objects internally only.
- Code: Select all
var operation = new RAddObjectsOperation(false);
var linie = new RLineData(linien[l][0], linien[l][1]);
var entity = new RLineEntity(zeichnung.document, linie);
operation.addObject(entity);
zeichnung.documentInterface.applyOperation(operation);
If instead I kept on adding objects to the operation, and applied it only later, then would all objects end up in the same layer? Or in the layer, that was active, at the time they were added to the operation? Could it be about useCurrentAttributes?
I know it is trivial to find out myself, but I am lazy right now, please excuse the many words too, but maybe its interesting for others too. It may prove a performance benefit, especially when the script runs in the GUI.