LibreCAD 3 - Document operations
LibreCAD 3 has many operations accessible in Lua. You can see the full up-to-date list here.
The Builder is a container for others Document operations (including Builder itself).
This class is used to prevent the Document being in invalid state on undo/redo. All the operations added to Builder are undo-ed at the same time.
The EntityBuilder is a class designed to insert entities in the document and modify them.
To use it, you have to add the entities using appendEntity() method.
If you need it, you can do operations on the entities before inserting them, with appendOperation() method.
If two operations are incompatible, you can use processStack() method, it will modify each entity and clear the Operation queue.
Push / SelectByLayer
Those are the most important operations and are required before doing anything else.
The operations use their own list of entities and not the one used by appendEntity(). The Push operation add every entity present in the EntityBuilder to the list, and SelectByLayer only add the ones from a specific layer. More selectors will be added in the future.
This will repeat each operation added before n times.
The other operations doesn't need explanations, this includes: