We have moved to https://dokuwiki.librecad.org/
Lots of content was already moved to the new wiki, but there is still work to do. If you want to contribute, please register a new account at https://dokuwiki.librecad.org/
This wiki will be kept for a while to keep search engine results valid. Moved sites may be deleted here in future.
LibreCAD 3 - Plugin creation
From LibreCAD wiki
This is a quick guide on how to create a LibreCAD 3 plugin with the example of the rectangle plugin.
Contents
Plugin executions mode
Plugin in GUI mode
In this mode, the LC_interface variable is set to "gui". You can :
- Modify GUI (create toolbar, add buttons, ...)
- Manage multiple documents
- Manage interactions with custom entities
- Create functions that can be used outside the plugin
Quick script (GUI)
In this mode, the LC_interface is not set (equals to nil).
You can:
- Manage the active document (given by the document variable)
- Manage interactions with custom entity
Plugin in command line mode
In this mode, the LC_interface is set to "cli".
You can:
- Manage one document (given by the document variable)
- Create function that can be used in the main script